Skip to content

Instantly share code, notes, and snippets.

@ewg118
Created July 1, 2015 15:01
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/66600d9713bc1e35441a to your computer and use it in GitHub Desktop.
Save ewg118/66600d9713bc1e35441a to your computer and use it in GitHub Desktop.
How to get all Abbasid rulers ordered chronologically in nomisma.org SPARQL endpoint
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX osgeo: <http://data.ordnancesurvey.co.uk/ontology/geometry/>
PREFIX rdac: <http://www.rdaregistry.info/Elements/c/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX spatial: <http://jena.apache.org/spatial#>
PREFIX un: <http://www.owl-ontologies.com/Ontology1181490123.owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?label ?startDate ?endDate WHERE {
?s a foaf:Person ;
org:hasMembership ?membership .
?s skos:prefLabel ?label FILTER langMatches(lang(?label), "en") .
?membership org:organization nm:abbasids ;
nmo:hasStartDate ?startDate ;
nmo:hasEndDate ?endDate
} ORDER BY ?endDate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment