I have the following SPARQL query:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX type: <http://dbpedia.org/class/yago/>
PREFIX prop: <http://dbpedia.org/property/>
SELECT *
WHERE {
?person a foaf:Person;
foaf:name ?name;
prop:deathCause ?death_cause.
FILTER (langMatches(lang(?name), "EN")) .
}
LIMIT 50
If you run it here: http://dbpedia.org/snorql/
You will see that you get a lot of results. Now I would like to filter out one cause of death, say, “Traffic collision”. So this should just be adding a filter:
FILTER (?death_cause = "Traffic collision").
Thus, the request should be as follows:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX type: <http://dbpedia.org/class/yago/>
PREFIX prop: <http://dbpedia.org/property/>
SELECT *
WHERE {
?person a foaf:Person;
foaf:name ?name;
prop:deathCause ?death_cause.
FILTER (?death_cause = "Traffic collision").
FILTER (langMatches(lang(?name), "EN")) .
}
LIMIT 50
However, this does not return anything. Who knows what is wrong with the request? Thank.
source
share