Skip to content

Instantly share code, notes, and snippets.

@ewg118
Created September 13, 2017 14:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ewg118/d4833fc0f61c17f84c723dcb3a7fe901 to your computer and use it in GitHub Desktop.
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