Skip to content

Instantly share code, notes, and snippets.

@jindrichmynarz
Created June 28, 2016 06:50
Generating SPARQL: example query
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?person
(SAMPLE(?_name) AS ?name)
(SAMPLE(?_birthDate) AS ?birthDate)
(SAMPLE(?_deathDate) AS ?deathDate)
WHERE {
{
SELECT ?person
WHERE {
{
SELECT DISTINCT ?person
WHERE {
?person a foaf:Person ;
foaf:name [] ;
dbo:birthDate [] .
}
ORDER BY ?person
}
}
LIMIT 10000
OFFSET 0
}
?person foaf:name ?_name ;
dbo:birthDate ?_birthDate .
OPTIONAL {
?person dbo:deathDate ?_deathDate .
}
}
GROUP BY ?person
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment