Skip to content

Instantly share code, notes, and snippets.

@portableant
Last active August 29, 2015 14:08
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 portableant/eb13e1f6c0cb3fc92141 to your computer and use it in GitHub Desktop.
Save portableant/eb13e1f6c0cb3fc92141 to your computer and use it in GitHub Desktop.
Sparql query to get Woden depictions between 410 and 1100 AD in BEP collection
#Early medieval
PREFIX crm: <http://erlangen-crm.org/current/> #Prefix for the CIDOC-CRM
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> #Prefix for SKOS terminologies
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bmo: <http://collection.britishmuseum.org/id/ontology/> #British Museum Ontology PX_
PREFIX fts: <http://www.ontotext.com/owlim/fts#> #OWLIM Fast Text serach
PREFIX ecrm: <http://erlangen-crm.org/current/>
SELECT
?object #Object URI
?keeper #Departmental name
?label #Object type
?metal #Metal name
?objectphy #Object physical Description (sub property of P2_has_note)
?startdate #xsd start date for range
?enddate #xsd end date for range
?comment #curatorial comments on the object (sub property of P2_has_note)
?person #The person depicted
WHERE
{
?object crm:P2_has_type ?objecttype . #An object has an object type
?objecttype skos:prefLabel ?label . #Get the label
#?objecttype skos:prefLabel "brooch" . #Uncomment to get brooches
?object bmo:PX_physical_description ?objectphy . #has a physical description
?object bmo:PX_curatorial_comment ?comment . #has a curatorial comment
?object crm:P45_consists_of ?materialid . #The object is made of a material
?materialid skos:prefLabel ?metal . #The material label has some text
?object crm:P108i_was_produced_by ?production . #The Object was produced through a production event
?production crm:P9_consists_of ?productionpart . #The production event consists of parts
?productionpart crm:P4_has_time-span ?timespandate . #One part describes a time span
?timespandate crm:P82a_begin_of_the_begin ?startdate . #The time span has a begining date
?timespandate crm:P82b_end_of_the_end ?enddate . #The time span has an end date
?object ecrm:P65_shows_visual_item ?depiction . #Shows a visual depiction
?depiction ecrm:P138_represents ?represents . #Depicts something
?represents skos:prefLabel ?person . #Get the preferred label for the depicted entity
?represents skos:prefLabel "Woden" . #Filter for Woden
?object crm:P108i_was_produced_by ?production . #The object was produced through a production event
?production crm:P9_consists_of ?productionpart1 . #The production event consists of parts
?productionpart1 crm:P10_falls_within ?matcultureid . #One part describes the cultural period
?department crm:P50_has_current_keeper ?dept . #Get the department that has custody
?dept skos:prefLabel "BM Department Prehistory and Europe" . #Where department is BEP
?dept skos:prefLabel ?keeper . #Department name
{
FILTER (
(?startdate >= "0410-01-01"^^xsd:date)
&&
(?enddate <= "1100-12-31"^^xsd:date)
)}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment