<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20828</bug_id>
          
          <creation_ts>2013-01-30 20:48:27 +0000</creation_ts>
          <short_desc>Typed Data Feature</short_desc>
          <delta_ts>2013-05-14 16:00:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://www.w3.org/Bugs/Public/show_bug.cgi?id=11585</see_also>
    
    <see_also>https://www.w3.org/Bugs/Public/show_bug.cgi?id=19750</see_also>
    
    <see_also>https://www.w3.org/Bugs/Public/show_bug.cgi?id=19365</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Robie">jonathan.robie</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>g</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82347</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-01-30 20:48:27 +0000</bug_when>
    <thetext>In yesterday&apos;s telcon, we discussed the need for a Typed Data Feature, which can be disabled to allow a processor to be completely untyped. 

Here is a proposal for the feature:

&lt;proposal&gt;

5.2.3 Typed Data Feature

[Definition: The Typed Data Feature permits a data model instance to contain element nodes types other than xs:untyped and attributes node types other than xs:untypedAtomic.]

If an XQuery implementation does not provide the Typed Data Feature, it MUST guarantee that the XDM has the type xs:untyped for every element node and  xs:untypedAtomic for every attribute node, including nodes created by the query.

&lt;/proposal&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82354</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-01-30 21:16:12 +0000</bug_when>
    <thetext>We need to say a little bit more than this.

We need to say something about the validate expression. Either we say that a processor that does not support typed data must not support validate (that is, it must not support the schema-aware feature). Or we might allow a processor to support validate, but to do so in such a way that no type annotations are present in the result.

Furthermore (and this is where the whole thing started), 3.9.1.3 §5.j says this: 

&quot;If construction mode in the static context is strip, the type-name property is xs:untyped. On the other hand, if construction mode is preserve, the type-name property is xs:anyType.&quot;

we should change this rule to say that if the typed data feature is not supported then the type is xs:untyped regardless of construction mode; or alternatively, to say that if the typed data feature is not supported then the construction mode must be strip.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82356</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-01-30 21:19:36 +0000</bug_when>
    <thetext>Good points.

I prefer:

* Do not support validate
* Require construction mode = strip

Don&apos;t let a query claim to validate without validating, or claim to preserve without preserving.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82360</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-01-30 21:52:18 +0000</bug_when>
    <thetext>&gt;Don&apos;t let a query claim to validate without validating, or claim to preserve
without preserving.

Well, most people would reckon that if you reject invalid documents then you are validating, regardless of what you do with valid ones; and most people would reckon that if the input is untyped and the output is untyped then you have preserved the type. So the alternatives are at least worth considering. 

But I don&apos;t feel strongly about it either way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84627</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-03-19 16:17:59 +0000</bug_when>
    <thetext>In today&apos;s discussion, we seemed to prefer the following approach:

* In untyped mode, schema import is a static error
* In untyped mode, validate is always lax
* In untyped mode, construction mode = strip

I will write a proposal along these lines later today.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84651</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-03-19 18:34:32 +0000</bug_when>
    <thetext>Revised proposal:

5.2.3 Typed Data Feature

[Definition: The Typed Data Feature permits a data model instance to contain element nodes types other than xs:untyped and attributes node types other than xs:untypedAtomic.]

If an XQuery implementation does not provide the Typed Data Feature, it MUST guarantee that:

1. The XDM has the type xs:untyped for every element node and  xs:untypedAtomic for every attribute node, including nodes created by the query.
2. If the query contains a schema import, an error is raised [err:XXXX].
3. validate {} is always done in lax mode. If the query specifies strict validation, an error is raised [err:XXXX].
4. Elements constructed by the query always have the type xs:untyped; attributes constructed by the query always have the type xs:untypedAtomic. (This is equivalent to using construction mode = strip.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87356</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-05-07 16:54:07 +0000</bug_when>
    <thetext>Revised proposal:

5.2.3 Typed Data Feature
 
[Definition: The Typed Data Feature permits a data model instance to contain
element nodes types other than xs:untyped and attributes node types other
than xs:untypedAtomic.]
 
If an XQuery implementation does not provide the Typed Data Feature, it MUST
guarantee that:

1. The XDM has the type xs:untyped for every element node and 
xs:untypedAtomic for every attribute node, including nodes created by the
query.
2. If the query contains a schema import, an error is raised [err:XXXX].
3. Elements constructed by the query always have the type xs:untyped;
attributes constructed by the query always have the type xs:untypedAtomic.
(This is equivalent to using construction mode = strip.)
5. If Typed Data is not enabled, Schema Aware must not be enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87357</commentid>
    <comment_count>7</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-05-07 16:56:18 +0000</bug_when>
    <thetext>Revised proposal:
 
5.2.3 Typed Data Feature
  
[Definition: The Typed Data Feature permits a data model instance to contain
element nodes types other than xs:untyped and attributes node types other
than xs:untypedAtomic.]
  
If an XQuery implementation does not provide the Typed Data Feature, it MUST
guarantee that:
 
1. The XDM has the type xs:untyped for every element node and 
xs:untypedAtomic for every attribute node, including nodes created by the
query.
2. Elements constructed by the query always have the type xs:untyped;
attributes constructed by the query always have the type xs:untypedAtomic.
(This is equivalent to using construction mode = strip.)
3. If Typed Data is not enabled, Schema Aware must not be enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87655</commentid>
    <comment_count>8</comment_count>
    <who name="Ghislain Fourny">g</who>
    <bug_when>2013-05-14 15:38:18 +0000</bug_when>
    <thetext>Using the wording which is already in the spec, I would suggest to express 3. as &quot;The Typed Data feature contains the Schema Aware feature&quot;.

I think that we should (re-)assign them names (for require/prohibit-feature) such that the former name is a prefix of the latter name, so that it fits in a feature hierarchy. For example:
typed-data
typed-data-syntax
typed-data-all-optional-features (implicit)

I also think that we should provide an error code to raise in case some typed data is received from an input source or from another module, if the feature is deactivated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87656</commentid>
    <comment_count>9</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-05-14 15:58:35 +0000</bug_when>
    <thetext>The WG adopted the proposal in Comment #8, modified as follows:

1. The names are typed-data / typed-data-schemas
2. If a module prohibits typed data, it treats all data as untyped (no error is raised)

The scope of the declaration is the module.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87657</commentid>
    <comment_count>10</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-05-14 16:00:07 +0000</bug_when>
    <thetext>Ghislain noted that we need to remember the implicit typed-data-all-optional-features, per the current design of optional features.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>