W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > August 2002

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

From: Jos De_Roo <jos.deroo.jd@belgium.agfa.com>
Date: Thu, 8 Aug 2002 10:25:58 +0200
To: Patrick.Stickler@nokia.com
Cc: Graham.Klyne@MIMEsweeper.com, jjc@hplb.hpl.hp.com, melnik@db.stanford.edu, w3c-rdfcore-wg@w3.org
Message-ID: <OF52998082.605F3F1D-ONC1256C0F.002D85E5@agfa.be>

let's focus/stick to XML Schema primitive datatypes
such as testcased by DanC in
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/

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 (§ or Complex Type Definition 
(§ 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 xsi:type="xsd:decimal">10.50</USPrice>


   WidgetX USPrice "10.05" .
   USPrice rdfs:range xsd:decimal .
   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!

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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:53:59 UTC