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

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

From: <Patrick.Stickler@nokia.com>
Date: Thu, 8 Aug 2002 10:07:23 +0300
Message-ID: <A03E60B17132A84F9B4BB5EEDE57957B5FBA77@trebe006.NOE.Nokia.com>
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>

> > 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 03:07:29 UTC

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