Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-814

Duration comparison returning incorrect results 28D = 1M and 365D = 1Y

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Fuseki 1.0.1, Fuseki 1.0.2, Fuseki 1.1.1
    • Jena 2.13.0
    • ARQ
    • None
    • OS X 10.10.1

    Description

      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
      

      Attachments

        Activity

          People

            andy Andy Seaborne
            aakeen Arthur Keen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: