Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CQL: closed-closed vs closed-open intervals #566

Closed
heidivanparys opened this issue Apr 19, 2021 · 3 comments
Closed

CQL: closed-closed vs closed-open intervals #566

heidivanparys opened this issue Apr 19, 2021 · 3 comments
Labels
CQL2 Editorial Editorial changes and document updates outside of requirements classes

Comments

@heidivanparys
Copy link
Contributor

The CQL standard does not mention anything about closed time intervals vs half-closed time intervals, nor does the Time Ontology it seems. The only thing is indirect: ISO 8601-1 says for time interval:

part of the time axis limited by two instants and, unless otherwise stated, the limiting instants themselves

Whether the end instant of a time interval is part of the interval itself will have consequences for the behaviour of the temporal relations MEET/METBY, BEGINS and ENDS.

Background info:
Time intervals are used for associating a valid time interval and a transaction time interval to a version of a feature in order to implement bitemporal history for features. Common practice is to use closed-open time intervals for this, this is e.g. the case for bitemporal databases implementing the SQL standard (ISO/IEC 9075), see also ISO/IEC TR 19075-2:2015. When implementing an API on top of a database with temporal data, we must be able to take closed-open time intervals into account.

@cportele
Copy link
Member

Since we use/reference ISO 8601, the rules of that standard applies, i.e., time intervals are closed. This is stated in Part 1 in the context of the datetime parameter:

For time intervals this includes the start and end time.

We need to restate this in Part 3.

It is unfortunate that different standards use different semantics, but this is the way it is. For servers using an SQL backend, they need to map this to a SQL query that fits the SQL definition, e.g. add a second at the end, if the temporal resolution is one second. We should also discuss this in a note.

@heidivanparys
Copy link
Contributor Author

For servers using an SQL backend, they need to map this to a SQL query that fits the SQL definition, e.g. add a second at the end, if the temporal resolution is one second. We should also discuss this in a note.

The simplest solution would be to combine instant-instant comparisons - as we do today in SQL queries - instead of using operators operating on time intervals and having to a second/a day/sht else (depending on the temporal resolution).

@cportele cportele added the Editorial Editorial changes and document updates outside of requirements classes label May 10, 2021
@cportele
Copy link
Member

Address this as part of the implementation of #570 and #565.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CQL2 Editorial Editorial changes and document updates outside of requirements classes
Development

No branches or pull requests

3 participants