[Bug 26958] New: On not precluding updates in XQuery 3.0

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

            Bug ID: 26958
           Summary: On not precluding updates in XQuery 3.0
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: jonathan.robie@gmail.com
        QA Contact: public-qt-comments@w3.org

At the Hursley meeting, we decided to specify identity as follows in XDM,
XPath/XQuery, and F&O:

ACTION A-579-17: Norm to write up maps and arrays in
the XDM in a way that doesn't preclude updates operating
on them (e.g. they have identity even if it's not exposed).

ACTION A-579-18: Jonathan to make sure XPath/XQuery text
does not preclude updates to maps and arrays, e.g. by being
explicit that they might have a non-exposed id.

ACTION A-579-19: Mike Kay to check that F&O does not preclude
updates to maps and arrays, e.g. by being explicit that
they might have a non-exposed id.

Note: There were two action items named A-579-18, and one of them got lost in
our action item tracking due to the duplicate name. 

I do not think that our LCWDs reflect that decision. On Tuesday's call, we
revisited the issue and reached this compromise:

https://lists.w3.org/Archives/Member/w3c-xsl-query/2014Sep/0119.html

<p>This version of the XPath Data Model does not specify whether or
not maps have any identity other than their values. No operations
currently defined on maps depend on the notion of map identity. Other
specifications, for example, the XQuery Update Facility, may make
identity of maps explicit.</p>

There's a problem with this compromise: it results in two sets of behavior that
can be distinguished only when updates are implemented.  If implementations
create and persist maps and arrays between now and then, identical queries can
create XDM instance that behave differently when updated.  

Suppose we ultimately decide that maps and arrays have identity, which is
probably essential to have in-situ update.  We do not specify whether an array
or map that occurs as a value in another array or map is copied or referenced. 
That difference can be observed only when updates are available.

An example (in pseudocode, assuming maps and arrays do have identity):

$x := [ 1, 2, 3 ]
$y := { "x" : $x }
$z := { "x" : $x }

Two implementations persist data created with this query. Later, we implement
updates for maps, and the value of $y("x") is replaced with the array [2, 4,
6].

What is the value of $z? 

I do not believe that the value of $z should be changed, so I think that we
should use copy semantics here.  Is there a good way to say this without
referring to identity?

Elements do have identity:

$x := <i>1 2 3</i>
$y := { "x" : $x }
$z := { "x" : $x }

If this instance is persisted, what should the update semantics be?

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

Received on Thursday, 2 October 2014 22:39:33 UTC