Skip to content

Instantly share code, notes, and snippets.

@ringmaster
Created January 16, 2013 00:55
Show Gist options
  • Save ringmaster/4543687 to your computer and use it in GitHub Desktop.
Save ringmaster/4543687 to your computer and use it in GitHub Desktop.
Here's a sample query to find people for my dead pool using SPARQL and the dbpedia.
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?name ?birth ?death ?person ?wikipedia ?occupation WHERE {
?person dbo:birthDate ?birth .
?person foaf:name ?name .
?person a dbo:Actor .
OPTIONAL {?person dbo:deathDate ?death .}
OPTIONAL {?person dbpprop:dateOfDeath ?death2 .}
FILTER (?birth < "1950-01-01"^^xsd:date)
FILTER (?birth > "1890-01-01"^^xsd:date)
FILTER (!bound(?death))
FILTER (!bound(?death2))
}
ORDER BY asc(?birth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment