W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2009

[Bug 6871] New: [FO] Erronneous op:time-*–to–value comparison operator mapping?

From: <bugzilla@wiggum.w3.org>
Date: Fri, 08 May 2009 12:28:00 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-6871-523@http.www.w3.org/Bugs/Public/>

           Summary: [FO] Erronneous op:time-*–to–value comparison
                    operator mapping?
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: bogdanb+w3c+bugzilla@gmail.com
         QAContact: public-qt-comments@w3.org


Currently the spec at http://www.w3.org/TR/2007/REC-xpath-functions-20070123/
contains the following notes:

*** quote ***
10.4.12 op:time-equal [...] This function backs up the "eq", "ne", "le" and
"ge" operators on xs:time values.

10.4.13 op:time-less-than [...] This function backs up the "lt" and "le"
operators on xs:time values.

10.4.14 op:time-greater-than [...] This function backs up the "gt" and "ge"
operators on xs:time values.
*** end quote ***

However, according to http://www.w3.org/TR/2007/REC-xquery-20070123/#mapping
the operators are mapped thus:

A eq B -> op:time-equal(A, B)
A ne B -> fn:not(op:time-equal(A, B))
A gt B -> op:time-greater-than(A, B)
A lt B -> op:time-less-than(A, B)
A ge B -> fn:not(op:time-less-than(A, B))
A le B -> fn:not(op:time-greater-than(A, B))

The mapping would suggest that op:time-equal backs up "eq" and "ne";
op:time-greater-than backs up "gt" and "le"; and op:time-less-than backs up
"lt" and "ge".

However I'm not sure the mapping in the XQuery spec is what is intended: Using
that mapping, two xs:time values that should be incomparable because of
time-zone differences would return false from the "eq", "gt" and "lt"
operators, but true for "ne" (correct), "ge" and "le"—the latter two would
seem wrong. To reflect incomparable values, the "le" and "ge" operators should
map to “op:time-less-than(A, B) or op:time-equal(A, B)” and
“op:time-greater-than(A, B) or op:time-equal(A, B)”, respectively, similar
to how numeric values are compared.

I think something similar should apply to xs:dateTime, but I haven't checked
thoroughly that case yet.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 8 May 2009 12:28:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:27 UTC