[Bug 27392] New: Type checking of functions

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27392

            Bug ID: 27392
           Summary: Type checking of functions
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: christian.gruen@gmail.com
        QA Contact: public-qt-comments@w3.org

Section 2.3.4 Errors and Optimization of the XQuery 3.1 spec says that:

"The effect of these rules is that the processor is free to stop examining
further items in a sequence as soon as it can establish that further items
would not affect the result except possibly by causing an error. For example,
the processor may return true as the result of the expression S1 = S2 as soon
as it finds a pair of equal values from the two sequences."

This is currently specified at the level of expressions, but I have not found a
clear hint if it can also be applied to type checks.

See the following example:

  function() as xs:integer+ { 1 to 100000, <x/> }() = 1

This query could be rewritten to (something similar like) the following
expression, and it would yield true (provided that a processor evaluates the
query in a streaming manner):

  (1 to 100000, <x/>) ! (. treat as xs:integer) = 1

Another example: Strict type checks would prevent a query processor from
streaming results of functions if the return type cannot be statically
determined:

  function($x) as xs:integer+ { 1 to 1000000000, $x }(123)[1]

As the examples indicate, I would clearly be in favor of allowing iterative
type checking.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 21 November 2014 16:07:33 UTC