Ubercoder
Ubercoder

Reputation: 741

SPARQL query cannot find page that should exist

I am writing a query in DBpedia live http://dbpedia-live.openlinksw.com/sparql/ to return details of well known people. As a test case, I know there exists a page for the Roman Emperor Nero at http://dbpedia.org/page/Nero but my query does not return a row for him. My SPARQL query is:

# Runs in live (http://dbpedia-live.openlinksw.com/sparql/)
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?x0 ?name2 ?dob 
WHERE {
  ?x0 rdf:type foaf:Person.
  ?x0 rdfs:label ?name.
  ?x0 dbo:birthDate ?dob.
  FILTER REGEX(?name,"^Ner.*","i").
  BIND (str(?name) AS ?name2)
} ORDER BY ?name2 LIMIT 100

I checked the page http://dbpedia.org/page/Nero and it has the rdf:type, rdfs.label and dbo.birthDate properties referenced in my query. When I run the above query it returns 100 other people with name beginning "Ner" using the case insensitive version of REGEX.

So my question is: Why does the above query not return Nero in the list of results?

Upvotes: 1

Views: 62

Answers (1)

TallTed
TallTed

Reputation: 9444

First thing, note that on DBpedia, Nero (currently) comes in result rows 109 and 110, so you need at least 110 rows to see him.

Now, note that Nero's description on DBpedia-Live is different than on DBpedia -- and that neither is correct.

Of particular note, see that on DBpedia-Live, Nero's http://dbpedia.org/property/birthDate has one value -- 1937-12-15 (xsd:date) -- while on DBpedia, http://dbpedia.org/ontology/birthDate has two values -- 0037-12-15 (xsd:date) and 1937-12-15 (xsd:date).

Also note that on DBpedia-Live, Nero has no http://dbpedia.org/ontology/birthDate value -- while on DBpedia, http://dbpedia.org/property/birthDate has no value.

These results should be of interest to you -- on DBpedia, and on DBpedia-Live.

Upvotes: 2

Related Questions