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

Date offset issue #3

Open
giacomociti opened this issue Aug 26, 2024 · 1 comment
Open

Date offset issue #3

giacomociti opened this issue Aug 26, 2024 · 1 comment

Comments

@giacomociti
Copy link
Owner

The following test:

  • core/node/minInclusive-003.ttl

fails due to a strange date offset issue (to be further investigated).

@giacomociti
Copy link
Owner Author

the problem is due to pred:dateTime-less-than-or-equal when comparing a date with an offset and another without.

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix list: <http://www.w3.org/2000/10/swap/list#> .
@prefix pred: <http://www.w3.org/2007/rif-builtin-predicate#>.

{
    ?t list:in ( 
        "2002-10-10T12:00:00-05:00"^^xsd:dateTime
        "2002-10-10T12:00:01-05:00"^^xsd:dateTime
        "2002-10-09T12:00:00-05:00"^^xsd:dateTime
    ) .
    ("2002-10-10T12:00:00"^^xsd:dateTime ?t) pred:dateTime-less-than-or-equal ?lte
}
=>
{
    ?t rdf:value ?lte .
} .

produces

"2002-10-10T12:00:00-05:00"^^xsd:dateTime rdf:value true.
"2002-10-10T12:00:01-05:00"^^xsd:dateTime rdf:value true.
"2002-10-09T12:00:00-05:00"^^xsd:dateTime rdf:value false.

The correct result should be false in all cases, according to the XSD spec:

Note: Since the order of a dateTime value having a ·timezoneOffset· relative to another value whose ·timezoneOffset· is absent is determined by imputing time zone offsets of both +14:00 and −14:00 to the value with no time zone offset, many such combinations will be ·incomparable· because the two imputed time zone offsets yield different orders.

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

No branches or pull requests

1 participant