Topic on Talk:Wikidata Query Service

Query with ISBLANK gives unexpected (empty) result on WDQS

2
Hannah Bast (talkcontribs)

The following query gives zero results on WDQS, but QLever and Virtuoso both return hits, and correctly so I think:

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?person ?date_of_birth WHERE {
  ?person wdt:P569 ?date_of_birth .
  FILTER ISBLANK(?date_of_birth)
}
LIMIT 10

Try it on WDQS: https://w.wiki/8Szp

Try it on QLever: https://qlever.cs.uni-freiburg.de/wikidata/2nzFYg

Try it on Virtuoso: https://wikidata.demo.openlinksw.com/sparql

PS: Not sure whether this is the right page for reporting this. If there is a better place, please let me know.

TomT0m (talkcontribs)

Wikidata changed its model a while ago and do not use blank nodes anymore to represent unknown value, for update performance reasons. "wikibase:isSomeValue" should be used instead of isblank, as a consequence. See this ticket for example task T244341

This query

SELECT ?person ?date_of_birth WHERE {
  ?person wdt:P569 ?date_of_birth .
  FILTER ( wikibase:isSomeValue( ?date_of_birth) )
}
LIMIT 10

Try it!

Reply to "Query with ISBLANK gives unexpected (empty) result on WDQS"