Skip to content

feat(cql2): align temporal predicates with CQL2 spec#155

Open
constantinius wants to merge 1 commit into
mainfrom
cql2-temporal-compliance
Open

feat(cql2): align temporal predicates with CQL2 spec#155
constantinius wants to merge 1 commit into
mainfrom
cql2-temporal-compliance

Conversation

@constantinius

Copy link
Copy Markdown
Contributor

Align the CQL2 Temporal conformance class with the OGC 21-065r2 spec.

Maps CQL2 spec operator names to existing AST types without renaming them, keeping all other parsers and backends unaffected.

Changes

  • Spec operator names: Map t_startsTimeBegins, t_startedByTimeBegunBy, t_finishesTimeEnds, t_finishedByTimeEndedBy in TEMPORAL_PREDICATES_MAP
  • JSON casing: Use camelCase keys per spec JSON schema (t_metBy, t_overlappedBy, t_startedBy, t_finishedBy)
  • T_INTERSECTS: Add new TimeIntersects AST node — was incorrectly aliased to TimeOverlaps
  • T_DISJOINT: Add to grammar and predicate map (AST node already existed)
  • Text syntax: Change from infix a T_BEFORE b to function-call T_BEFORE(a, b) per spec BNF
  • INTERVAL: Accept DATE strings and open-ended '..' parameters per spec

Design decision

The existing AST types (TimeBegins, TimeEnds, etc.) are preserved as-is. The CQL2 layer maps spec names to them without requiring changes to FES, ECQL, or any backend.

Spec reference

OGC 21-065r2 §6.9

Map CQL2 spec operator names to existing AST types without renaming
them, keeping all other parsers and backends unaffected.

- Use spec names in TEMPORAL_PREDICATES_MAP: t_starts → TimeBegins,
  t_startedBy → TimeBegunBy, t_finishes → TimeEnds,
  t_finishedBy → TimeEndedBy (camelCase keys per JSON schema)
- Add TimeIntersects AST node — t_intersects was incorrectly aliased
  to TimeOverlaps
- Add t_disjoint mapping (AST node TimeDisjoint already existed)
- Change text syntax from infix (a T_BEFORE b) to function-call
  T_BEFORE(a, b) per spec BNF
- Expand INTERVAL to accept DATE strings and open-ended '..' params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant