Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Get IIIF services for coins connected to coin types
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX svcs: <http://rdfs.org/sioc/services#>
SELECT ?object ?title ?identifier ?collection ?publisher ?dataset ?datasetTitle ?weight ?axis ?diameter ?obvService ?revService ?comService WHERE {
?object nmo:hasTypeSeriesItem <typeURI> ;
rdf:type nmo:NumismaticObject ;
dcterms:title ?title .
OPTIONAL { ?object dcterms:identifier ?identifier}
OPTIONAL { ?object nmo:hasCollection ?colUri .
?colUri skos:prefLabel ?collection FILTER(langMatches(lang(?collection), "EN"))}
?object void:inDataset ?dataset .
?dataset dcterms:publisher ?publisher ;
dcterms:title ?datasetTitle FILTER (lang(?datasetTitle) = "" || langMatches(lang(?datasetTitle), "en")) .
OPTIONAL { ?object nmo:hasWeight ?weight }
OPTIONAL { ?object nmo:hasAxis ?axis }
OPTIONAL { ?object nmo:hasDiameter ?diameter }
{ ?object foaf:depiction ?comRef .
?comRef svcs:has_service ?comService}
UNION {
{ ?object nmo:hasObverse/foaf:depiction ?obvRef.
?obvRef svcs:has_service ?obvService }
{ ?object nmo:hasReverse/foaf:depiction ?revRef .
?revRef svcs:has_service ?revService }
}
} ORDER BY ASC(?publisher) ASC(?collection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment