[ 
https://issues.apache.org/jira/browse/JENA-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14245884#comment-14245884
 ] 

ASF subversion and git services commented on JENA-814:
------------------------------------------------------

Commit 508ac678d8aa9a28a48af6bd014b11e1b9d26b20 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=508ac67 ]

JENA-814 : Handled mixed dayTime/yearMonth comparision.

Java says "equal" when they are in fact not comparable.

> 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.0.1, Fuseki 1.0.2, Fuseki 1.1.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:
> {noformat}
> 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 |
> --------
> {noformat}
> 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.
> {noformat}
>       Relation
> P1Y    > P364D         <> P365D  <> P366D  < P367D
> P1M    > P27D  <> P28D           <> P29D    <> P30D     <> P31D        < P32D
> P5M    > P149D         <> P150D  <> P151D  <> P152D  <> P153D < P154D
> {noformat}
> 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, 
> {noformat}
> 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
> {noformat}



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

Reply via email to