query-68f5c30e545be06e35d9b5514c9e8bb5

rq turtle/ttl

In short, the query was trying to use the wdt:P569 to select the truthy DoB value, but for reasons unknown (maybe a cut & paste error) also decided to go down the p:/ps: path to get exactly the same data. and we tell that part of the query that we're only interested in a statement which is BestRank, and we get what we wanted, a single row.?dob_stm a wikibase:BestRank and we constrain ?dob to the 23 April and for the reason above, find two rows. Add in the ?item wdt:P569 ?dob. Uncomment the ?item p:P569 ?dob_stm . ?dob_stm ps:P569 ?dob , then ?dob is unbound when we go into ?dob_stm a wikibase:BestRank, and the ?item wdt:P569 ?dobIf we comment out the after which the query looked for the P569 statament, and the ps: value for that statement - also bound as ?dob. That finds two rows, because 11 April 1891 Julian - one of the DoB statements, equals the truthy 23 April 1891 Gregorian DoB value. So for the optional clause, two dates are in scope.?item wdt:P569 ?dobAnd the cause is ... there are three DoB statements. The code as you supplied it required that a truthy DoB be found and bound as ?dob - (EC)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?dob ?dob_stm
WHERE 
{
VALUES   ?item {wd:Q49481}

 # ?item wdt:P569 ?dob .
  ?item p:P569 ?dob_stm .
  ?dob_stm ps:P569 ?dob .
# ?dob_stm a wikibase:BestRank  


  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?dob"):::projected v2("?dob_stm"):::projected v1("?item"):::projected c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?item/] bind0-->v1 bind00(["wd:Q49481"]) bind00 --> bind0 v1 --"p:P569"--> v2 v2 --"p:statement/P569"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end