Search code examples
sparqlwikidata-query-service

Wikidata Query Service - Bug on the 'Whose birthday is today?' SPARQL Query Examples


I was playing with the SPARQL query examples. The query 'Whose birthday is today' always ends up in a QueryTimeoutException (Query deadline is expired).

However If I change the birthdate property P569 to the death date property P570, the query runs without throwing an exception.

Is there something to do to have the birth query successfully executed?


Solution

  • I think the query is possibly too heavy for the wikibase service. If you just try to get all the properties through the person's properties, you will have success. I tried the following:

    PREFIX wikibase: <http://wikiba.se/ontology#>
    PREFIX wdt: <http://www.wikidata.org/prop/direct/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT distinct ?name (year(?date) as ?year)  WHERE {   
        ?entityS wdt:P569 ?date .
        ?entityS wdt:P1477 ?name.
        FILTER (datatype(?date) = xsd:dateTime) 
        FILTER (month(?date) = month(now()))
        FILTER (day(?date) = day(now()))
     }