Arthur Keen created JENA-814:
--------------------------------

             Summary: Duration comparison returning incorrect results 28D = 1M 
and 365D = 1Y
                 Key: JENA-814
                 URL: https://issues.apache.org/jira/browse/JENA-814
             Project: Apache Jena
          Issue Type: Bug
          Components: ARQ
    Affects Versions: Fuseki 1.1.1, Fuseki 1.0.2, Fuseki 1.0.1
         Environment: OS X 10.10.1
            Reporter: Arthur Keen


When comparing equality of 28 days to 1 month and 365 days to 1 year in Fuseki 
1.1.1 and 1.0.1, Fuseki responds that they are the same, whereas the answer is 
indeterminate.

How to reproduce:

SELECT ("P28D"^^<http://www.w3.org/2001/XMLSchema#duration>
="P1M"^^<http://www.w3.org/2001/XMLSchema#duration> as ?same) {}
--------
| same |
========
| true |
--------
SELECT ("P365D"^^<http://www.w3.org/2001/XMLSchema#duration>
="P1Y"^^<http://www.w3.org/2001/XMLSchema#duration> as ?same) {}
--------
| same |
========
| true |
--------

Reference:
The following table shows the strongest relationship that can be determined 
between example durations. The symbol <> means that the order relation is 
indeterminate. Note that because of leap-seconds, a seconds field can vary from 
59 to 60. However, because of the way that addition is defined in Adding 
durations to dateTimes, they are still totally ordered.
        Relation
P1Y      > P364D         <> P365D  <> P366D  < P367D
P1M      > P27D  <> P28D           <> P29D    <> P30D     <> P31D        < P32D
P5M      > P149D         <> P150D  <> P151D  <> P152D  <> P153D < P154D
Implementations are free to optimize the computation of the ordering 
relationship. For example, the following table can be used to compare durations 
of a small number of months against days.

However, Fuseki seem to have implemented this ordering differently.
According to Fuseki, 

P1M == P28D  => true - not OK(should be indeterminate according to 
specification)
P1M <> P29D - OK
P1M <> P30D - OK
P1M <> P31D - OK
P1M < P32D - OK

P1Y == P365D -> true - not OK (should be indeterminate according to 
specification)
P1Y <> P366D - OK
P1Y < 367D OK



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to