RE: Partial type-assignment and ambiguous RELAX NG schema

The data model should not allow xs:anyType as an instance type
annotation since the instance should be a concrete type and not a
general abstract type. However you can certainly use an (anonymous)
union type...

Best regards
Michael

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Jonathan Robie
> Sent: Tuesday, October 21, 2003 7:01 AM
> To: MURATA Makoto (FAMILY Given); public-qt-comments@w3.org
> Cc: MURATA Makoto
> Subject: Re: Partial type-assignment and ambiguous RELAX NG schema
> 
> 
> At 09:44 AM 10/21/2003, MURATA Makoto (FAMILY Given) wrote:
> 
> >I am wondering if it the data model spec allows partial
type-assignment:
> >assigning types to some (but not all) of the elements or attributes.
> Such
> >partial type-assignment is particularly useful for RELAX NG schemas,
> >which are allowed to be ambiguous.
> 
> Hi Makoto,
> 
> Every element or attribute node in the data model has a type
annotation.
> This type annotation may name a very general type, such as xs:anyType,
or
> it may convey that a node is untyped, e.g. xdt:untypedAny. Would
assigning
> a very general type meet your needs?
> 
> >For example, consider a RNG schema (in the compact syntax) as
follows.
> >
> >start =
> >   element root {(aWithOptB, aWithB) | (aWithB, aWithOptB)}
> >aWithB    = element a {b}
> >aWithOptB = element a {b?}
> >b = element b {xsd:int}
> >
> >This schema is ambiguous: it allows two interpretations of
> ><root><a><b>3</b></a><a><b>4</b></a><root>.  Although this schema is
a
> bit
> >artificial, it is created by computing the difference of two schemas
> >by hand (i.e., a schema with optional <b>s and a schema without
<b>s).
> >
> >We cannot uniquely determine the type of the two <a>s in the
document,
> >but we can determine the type of the two <b>s.  Obviously, they are
> >of the type xsd:int.  Does the data type spec allow such partial type
> >assignment?
> 
> You could assign the nearest common root type to the two <a>s, which
may
> be
> as general as xs:anyType. I don't know what you want to do with this
data,
> so I can't tell if this is adequate. If the types are atomic types,
then
> assigning a very general type and relying on XQuery's implicit casts
could
> do the trick.
> 
> Jonathan
> 

Received on Tuesday, 21 October 2003 16:52:50 UTC