W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > November 2001

RE: incomplete datatyping (was: Re: datatypes and MT)

From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
Date: Wed, 7 Nov 2001 11:23:18 -0000
To: "Graham Klyne" <Graham.Klyne@MIMEsweeper.com>, "Pat Hayes" <phayes@ai.uwf.edu>
Cc: "Sergey Melnik" <melnik@db.stanford.edu>, <w3c-rdfcore-wg@w3.org>
Message-ID: <JAEBJCLMIFLKLOJGMELDGEGNCCAA.jjc@hplb.hpl.hp.com>
>
> Suppose that in addition to:
>
>    monthOfBirth rdfs:range xxd:EnglishCalendarMonth .
>
> we can also presume:
>
>    monthOfBirth rdfs:range xxd:decimalInteger .
>
> (this being legit RDF) ... might the allow us to write:
>
>    _y monthOfBirth "July" .
>
> OR
>
>    _y monthOfBirth "7" .
>
> ?
>
> There are two points I see here:  (a) multiple datatype classes might
> permit ambiguity in the value denoted by a given literal string,
> and (b) a
> literal value might not have a defined mapping under some
> presumed datatype
> class.
>


I believe these issues are addressed by using an XML Schema union and then
following the example at

http://www.w3.org/TR/xmlschema-2/#union-datatypes
[[[

For example, given the definition below, the first instance of the <size>
element validates correctly as an integer (?3.3.13), the second and third as
string (?3.2.1).

  <xsd:element name='size'>
    <xsd:simpleType>
      <xsd:union>
        <xsd:simpleType>
          <xsd:restriction base='integer'/>
        </xsd:simpleType>
        <xsd:simpleType>
          <xsd:restriction base='string'/>
        </xsd:simpleType>
      </xsd:union>
    </xsd:simpleType>
  </xsd:element>

  <size>1</size>
  <size>large</size>
  <size xsi:type='xsd:string'>1</size>

]]]


Jeremy
Received on Wednesday, 7 November 2001 06:26:16 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:42:33 EDT