visualization-tool icon indicating copy to clipboard operation
visualization-tool copied to clipboard

Filtering of timezone-based temporal dimension not working correctly

Open bprusinowski opened this issue 11 months ago • 1 comments

It looks that SPARQL filtering based on temporal dimensions is sometimes off. We should investigate this and use a correct way of filtering the data in SPARQL queries, possibly by using dateTimeZone instead of dateTime as value type.

How to reproduce

  1. Go to this link.
  2. Switch to a table chart.
  3. Open Active since field.
  4. ❌ Sort the table by Active since column and see that the date from the From date picker is not there.
  5. Toggle use most recent date switch and see that the newest date is there.

bprusinowski avatar Jan 10 '25 12:01 bprusinowski

@bprusinowski good catch, yeah you'd need to add the same TZ offset as in the data itself i.e.

  FILTER (
    (?dimension2 >= "2024-08-30T12:02:01+02:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
  )
  FILTER (
    (?dimension2 <= "2025-01-07T12:01:18+01:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
  )

... with that you get all the 143 expected results https://s.zazuko.com/Keb8Nd

for reference the current query omits the time zone offsets and looks like this

  FILTER (
    (?dimension2 >= "2024-08-30T12:02:01"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
  )
  FILTER (
    (?dimension2 <= "2025-01-07T12:01:18"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
  )

Rdataflow avatar Jan 10 '25 14:01 Rdataflow