Page MenuHomePhabricator

Invalid results for events that occurred YYYY-MM-DD 'OR' YYYY-MM-DD
Closed, ResolvedPublic5 Estimated Story PointsBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Query for a event that occurred on either of the given two or three dates
  • Example - https://w-beta.wmflabs.org/JE
  • When queried for event on a single date - correct results are shown

What happens?:
Results shown are wrong.

What should have happened instead?:
Results must contain the events which occurred on either of date entered

Notes:

  • This probably also causes the parent task T280507. Check if the issue there persists after this one here has been fixed.

Event Timeline

amy_rc renamed this task from Invalid results for events that occurred YYYY-MM-DD OR YYYY-MM-DD to Invalid results for events that occurred YYYY-MM-DD 'OR' YYYY-MM-DD.Mon, Apr 19, 10:26 AM

I had a quick look at the SPARQL produced by the query linked from above.

actual sparql:

SELECT DISTINCT ?item ?itemLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  {
    SELECT DISTINCT ?item WHERE {
      { ?item p:P585 ?statement_0. }
      UNION
      { ?statement_0 psv:P585 ?statementValue_0. }
      UNION
      { ?statementValue_0 wikibase:timePrecision ?precision_0. }
      UNION
      { FILTER(?precision_0 >= 11 ) }
      UNION
      { ?statementValue_0 wikibase:timeValue ?P585_0. }
      UNION
      { BIND("+2009-11-01T00:00:00Z"^^xsd:dateTime AS ?P585_0) }
      UNION
      { ?item p:P585 ?statement_1. }
      UNION
      { ?statement_1 psv:P585 ?statementValue_1. }
      UNION
      { ?statementValue_1 wikibase:timePrecision ?precision_1. }
      UNION
      { FILTER(?precision_1 >= 11 ) }
      UNION
      { ?statementValue_1 wikibase:timeValue ?P585_1. }
      UNION
      { BIND("+2010-11-01T00:00:00Z"^^xsd:dateTime AS ?P585_1) }
    }
    LIMIT 10
  }
}

expected sparql:

SELECT DISTINCT ?item ?itemLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  {
    SELECT DISTINCT ?item WHERE {
      {
       ?item p:P585 ?statement_0.
       ?statement_0 psv:P585 ?statementValue_0. 
       ?statementValue_0 wikibase:timePrecision ?precision_0. 
       FILTER(?precision_0 >= 11 ) 
       ?statementValue_0 wikibase:timeValue ?P585_0. 
       BIND("+2009-11-01T00:00:00Z"^^xsd:dateTime AS ?P585_0)
      }
      UNION
      {
       ?item p:P585 ?statement_1. 
       ?statement_1 psv:P585 ?statementValue_1.
       ?statementValue_1 wikibase:timePrecision ?precision_1.
       FILTER(?precision_1 >= 11 ) 
       ?statementValue_1 wikibase:timeValue ?P585_1. 
       BIND("+2010-11-01T00:00:00Z"^^xsd:dateTime AS ?P585_1)
      }
    }
    LIMIT 10
  }
}

Change 682923 had a related patch set uploaded (by Guergana Tzatchkova; author: Guergana Tzatchkova):

[wikidata/query-builder@master] Fix SPARQL events that occurred YYYY-MM-DD 'OR' YYYY-MM-DD

https://gerrit.wikimedia.org/r/682923

Change 682923 merged by jenkins-bot:

[wikidata/query-builder@master] Fix SPARQL events that occurred YYYY-MM-DD 'OR' YYYY-MM-DD

https://gerrit.wikimedia.org/r/682923