Skip to content

Filtering on xsd:dateTime drops boundary values when using timezone-aware data #2552

@zumbov2

Description

@zumbov2

Disclaimer: I’m not entirely sure whether this is a bug or just my misunderstanding of xsd:dateTime handling.

Describe the bug

When filtering cubes with xsd:dateTime dimensions in Visualize, observations at the lower boundary of a filter range can disappear if the underlying data contains timezone-aware values (e.g. Z).

It appears that during filter generation, Visualize converts these values to local time (e.g. UTC -> CET/CEST), while the SPARQL query compares them against timezone-less literals. This leads to inconsistent comparisons and causes some observations (typically boundary cases) to be excluded.

Steps to Reproduce

  • Use a cube with a dateTime dimension where values are stored with timezone
  • Open the cube in Visualize
  • Select "Table" as your chart type
  • Apply a filter on the dateTime dimension
  • Inspect the generated SPARQL query.
FILTER (
    (?dimension5 >= "2003-01-14T01:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
  )
  FILTER (
    (?dimension5 <= "2015-04-24T02:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
  )

Expected behavior

Filtering should be consistent with the underlying data semantics.

In particular, values representing the same instant (e.g. 2003-01-14T00:00:00Z and 2003-01-14T01:00:00 in CET) should not lead to observations being excluded due to timezone handling differences. Boundary values should remain included.

Screenshots or video

output2.mp4

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions