Skip to content

LOD sample EDH searches

Gabriel Bodard edited this page Nov 7, 2019 · 4 revisions

(The example searches below to be used in conjunction with the exercise in Session 6 Linked Open Data.)

  1. Show me all objects with a maximum height of 37cm:
PREFIX nmo: <http://nomisma.org/ontology#>

SELECT ?s
WHERE { ?s nmo:hasMaxHeight ?o .
    filter contains(?o, "(37)")
}
  1. Show me all objects dated 1CE or after:
PREFIX nmo: <http://nomisma.org/ontology#>

SELECT ?s ?sd 
WHERE {
     ?s nmo:hasStartDate ?sd .
filter( ?sd > "0000") .
}
  1. Show me all inscriptions that mention a person name:
PREFIX epi: <http://edh-www.adw.uni-heidelberg.de/edh/ontology#>

SELECT ?s ?p
WHERE {
     ?s epi:hasPerson ?p .
} 
  1. Show me all insciptions mentioning a person whose name includes "C." (Gaius):
PREFIX epi: <http://edh-www.adw.uni-heidelberg.de/edh/ontology#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?inscription ?person ?name
WHERE { ?inscription epi:hasPerson ?person .
     ?person foaf:name ?name . 
filter contains(?name, "C.")
} 
  1. Combined query: show me inscriptions mentioning people that are dated between 1-150 CE and are inscribed on statue bases:
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX epi: <http://edh-www.adw.uni-heidelberg.de/edh/ontology#>

SELECT ?inscription ?person ?monument_type ?startDate ?endDate
WHERE { ?inscription epi:hasPerson ?person ;
      epi:representsTypeOfMonument
           <http://edh-www.adw.uni-heidelberg.de/edh/type_of_monument/statue_base> ; 
      nmo:hasStartDate ?startDate ;
      nmo:hasEndDate ?endDate . 
filter (?startDate > "0000" && ?endDate < "0150")
}