Re: XML Schema is untidy (was RE: type test case)

let's focus/stick to XML Schema primitive datatypes
such as testcased by DanC in
http://www.w3.org/2000/10/swap/test/dt/typedLit.n3
I'm "more comfortable with it as each day goes by"
(especially after I was able last night to parse it)

-- ,
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/




Patrick.Stickler@nokia.com
Sent by: w3c-rdfcore-wg-request@w3.org
2002-08-08 09:07 AM

 
        To:     <melnik@db.stanford.edu>
        cc:     <jos.deroo.jd@belgium.agfa.com>, <Graham.Klyne@MIMEsweeper.com>, 
<jjc@hplb.hpl.hp.com>, <w3c-rdfcore-wg@w3.org>
        Subject:        XML Schema is untidy (was RE: type test case)




> > So, even if the "range" of xsi:type is a QName, that QName is
> > expected to denote an XML Schema type.
> >
> > No?
>
> This is not my reading. The first sentence of the paragraph
> refers to a
> usual case when the type is determined by the type associated
> with the
> XML element in the schema (i.e., no xsi:type is used). However, when
> xsi:type is there, its value is a QName, nothing said about
> it referring
> to an XSD type definition or anything else.
>
> Correct me if I'm wrong...

I thought I did ;-)

The text in question from the XML Schema spec is

   "The Simple Type Definition (§2.2.1.2) or Complex Type Definition 
(§2.2.1.3) used in ·validation· of an element is usually determined by 
reference to the appropriate schema components. An element information 
item in an instance may, however, explicitly assert its type using the 
attribute xsi:type. The value of this attribute is a ·QName·; see QName 
Interpretation (§3.15.3) for the means by which the ·QName· is associated 
with a type definition."

I.e., the type is *usually* specified in the schema, but can be specified
for each instance.

This is exactly the same relation as what should exist in RDF for local
versus global datatyping. I.e. one can assert a range for a property in
a schema to specify the type of the value denoted by the literal, or
one can assert the type locally for each instance of a literal.

Thus, the following two are very similar:

   <xsd:element name="USPrice" type="xsd:decimal"/>
   <USPrice>10.50</USPrice>
vs
   <USPrice xsi:type="xsd:decimal">10.50</USPrice>

or

   WidgetX USPrice "10.05" .
   USPrice rdfs:range xsd:decimal .
vs
   WidgetX USPrice [ xsd:decimal "10.05" ] .

In both cases, the element/property value denotes an actual
datatype value, but the datatype which is paired with the
lexical representation is either globally asserted by
schema, or locally asserted with the instance.

In other words, XML Schema employs *untidy* semantics for
lexical representations!

Patrick

Received on Thursday, 8 August 2002 04:26:38 UTC