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

>
> 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 UTC