Skip to content

Instantly share code, notes, and snippets.

@ewg118
Created March 19, 2020 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewg118/b547e403670b8cd2bf79b2d14c5b5feb to your computer and use it in GitHub Desktop.
Save ewg118/b547e403670b8cd2bf79b2d14c5b5feb to your computer and use it in GitHub Desktop.
SPARQL query of (old) BM data model, running locally, for the coins of Philip II from Le Rider 1977
PREFIX bmo: <http://collection.britishmuseum.org/id/ontology/>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX ecrm: <http://erlangen-crm.org/current/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX object: <http://collection.britishmuseum.org/id/object/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX thes: <http://collection.britishmuseum.org/id/thesauri/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX thesDimension: <http://collection.britishmuseum.org/id/thesauri/dimension/>
SELECT ?s ?regno ?ref ?image ?weight ?axis ?diameter ?objectId ?hoard WHERE {
?s ecrm:P108i_was_produced_by/ecrm:P9_consists_of/ecrm:P17_was_motivated_by <http://collection.britishmuseum.org/id/person-institution/59777> ;
bmo:PX_display_wrap ?ref . FILTER regex(?ref, "le\\sRider\\s1977\\s[0-9]").
?s ecrm:P1_is_identified_by ?id1 .
?s ecrm:P1_is_identified_by ?id2 .
?id1 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/identifier/regno>;
rdfs:label ?regno .
?id2 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/identifier/codexid> ;
rdfs:label ?objectId
FILTER (contains(str(?s), 'CGR'))
OPTIONAL {?s bmo:PX_has_main_representation ?image }
OPTIONAL { ?s ecrm:P43_has_dimension ?wDim .
?wDim ecrm:P2_has_type thesDimension:weight .
?wDim ecrm:P90_has_value ?weight}
OPTIONAL { ?s ecrm:P43_has_dimension ?wAxis .
?wAxis ecrm:P2_has_type thesDimension:die-axis .
?wAxis ecrm:P90_has_value ?axis}
OPTIONAL {?s ecrm:P43_has_dimension ?wDiameter .
?wDiameter ecrm:P2_has_type thesDimension:diameter .
?wDiameter ecrm:P90_has_value ?diameter}
OPTIONAL {?s bmo:PX_display_wrap ?hoard . FILTER contains(?hoard, "IGCH")}
} ORDER BY ?ref
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment