visualization-tool
visualization-tool copied to clipboard
Filtering of timezone-based temporal dimension not working correctly
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
- Go to this link.
- Switch to a table chart.
- Open
Active sincefield. - ❌ Sort the table by
Active sincecolumn and see that the date from theFromdate picker is not there. - Toggle use most recent date switch and see that the newest date is there.
@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>)
)