Skip to content

Instantly share code, notes, and snippets.

@ewg118
Created June 28, 2019 19:09
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/bfe64f02ab5ca8876adab140da0c3472 to your computer and use it in GitHub Desktop.
Save ewg118/bfe64f02ab5ca8876adab140da0c3472 to your computer and use it in GitHub Desktop.
Query for Greek/Roman vases in the old British Museum SPARQL endpoint
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#>
SELECT ?object ?ware ?shape ?material ?codexid ?regno ?startDate ?endDate ?producedAt ?findspot ?desc ?height ?width ?length ?thickness ?weight (group_concat(distinct ?period;separator="|") as ?periods) (group_concat(distinct ?artist;separator="|") as ?artists) (group_concat(distinct ?technique;separator="|") as ?techniques) WHERE {
?object ecrm:P50_has_current_keeper <http://collection.britishmuseum.org/id/thesauri/department/G> ;
bmo:PX_ware ?ware ;
bmo:PX_object_type ?shape ;
ecrm:P45_consists_of ?material ;
ecrm:P108i_was_produced_by ?prod ;
ecrm:P1_is_identified_by ?id1 ;
ecrm:P1_is_identified_by ?id2 .
?id1 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/identifier/codexid> ;
rdfs:label ?codexid .
?id2 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/identifier/regno> ;
rdfs:label ?regno .
OPTIONAL {?prod ecrm:P9_consists_of/ecrm:P4_has_time-span ?span .
?span ecrm:P82a_begin_of_the_begin ?startDate ;
ecrm:P82b_end_of_the_end ?endDate}
OPTIONAL {?prod ecrm:P9_consists_of/ecrm:P10_falls_within ?period}
OPTIONAL {?prod ecrm:P9_consists_of/ecrm:P14_carried_out_by ?artist}
OPTIONAL {?prod ecrm:P9_consists_of/ecrm:P32_used_general_technique ?technique}
OPTIONAL {?prod ecrm:P9_consists_of/ecrm:P7_took_place_at ?producedAt}
OPTIONAL {?object ecrm:P12i_was_present_at ?foundAt .
?foundAt a bmo:EX_Discovery ;
ecrm:P7_took_place_at ?findspot}
OPTIONAL {?object bmo:PX_physical_description ?desc}
OPTIONAL {?object ecrm:P43_has_dimension ?dim1 .
?dim1 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/dimension/height> ;
ecrm:P90_has_value ?height
}
OPTIONAL {?object ecrm:P43_has_dimension ?dim2 .
?dim2 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/dimension/width> ;
ecrm:P90_has_value ?width
}
OPTIONAL {?object ecrm:P43_has_dimension ?dim3 .
?dim3 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/dimension/weight> ;
ecrm:P90_has_value ?weight
}
OPTIONAL {?object ecrm:P43_has_dimension ?dim4 .
?dim4 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/dimension/length> ;
ecrm:P90_has_value ?length
}
OPTIONAL {?object ecrm:P43_has_dimension ?dim5 .
?dim5 ecrm:P2_has_type <http://collection.britishmuseum.org/id/thesauri/dimension/thickness> ;
ecrm:P90_has_value ?thickness
}
} GROUP BY ?object ?ware ?shape ?material ?codexid ?regno ?startDate ?endDate ?producedAt ?findspot ?desc ?height ?width ?length ?thickness ?weight LIMIT 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment