Re: XQuery and RDF datatypes was: RDF specifications

Peter F. Patel-Schneider wrote:

>
> > I thought we were discussing XML Schema datatypes, if you are instead
> > talking XQuery algebra then I couldn't agree more on that value of
> > incorporating this into RDF for several reasons (read on).
>
> Nope, I'm talking about XML Schema datatypes.  As far as I know, XML
Schema
> datatypes are the only official way of putting datatype information in XML
> documents.

For simple types like "integer" and "float", I agree (XML 1.0 itself defines
defines a set of attribute types derived from SGML types), and for these XML
Schema does specify URI references. On the other hand DAML+OIL suggests that
XML Schema can be used for general datatypes. This poses a problem as I and
others have discussed before:
http://www.xmlhack.com/read.php?item=1137

For example (from a document you are well familiar with
http://www.daml.org/2001/03/daml+oil-walkthru.html#individuals) where it is
suggested that an XML Schema document can be referenced:


<xsd:schema xmlns:xsd ="http://www.w3.org/2000/10/XMLSchema#">

<xsd:simpleType name="over12">
  <!-- over12 is an XMLS datatype based on decimal -->
  <!-- with the added restriction that values must be >= 13 -->
  <xsd:restriction base="xsd:decimal">
  <xsd:minInclusive value="13"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="over17">
  <!-- over17 is an XMLS datatype based on positiveIntege -->
  <!-- with the added restriction that values must be >= 18 -->
  <xsd:restriction base="xsd:positiveInteger">
  <xsd:minInclusive value="18"/>
  </xsd:restriction>
</xsd:simpleType>
...
Then we could reference elements of this file in DAML+OIL restrictions, as
in

<daml:Class rdf:ID="Adult">
  <daml:intersectionOf rdf:parseType="daml:collection">
    <daml:Class rdf:about="#Person"/>
    <daml:Restriction>
      <daml:onProperty rdf:resource="#age"/>
      <daml:hasClass
rdf:resource="http://www.daml.org/2001/03/daml+oil-ex-dt#over17"/>
    </daml:Restriction>
  </daml:intersectionOf>
</daml:Class>

What you _wish_ to do is to use the value of the _name_ attribute as a
fragment identifier, correct? Firstly, the _actual_ XML Namespace for XML
Schema is http://www.w3.org/2001/XMLSchema (i.e. without the trailing '#',
which turns out to be important because if the "xsd" prefix is then used in
an RDF document ala <xsd:integer>5</xsd:integer> it will parse (via RDF)
rules to the URI http://www.w3.org/2001/XMLSchemainteger --- which is not
what you want)

Secondly, the "name" attribute in an XML Schema document is NOT of type ID,
i.e. is not used to create fragment identifiers. The problem is that "name"s
are not required to be unique in XML Schema, i.e. it is entirely possible to
have all of the above in a single schema:

<xsd:element name="foo"> ...
<xsd:attribute name="foo"> ...
<xsd:simpleType name="foo"> ...
<xsd:complexType name="foo"> ...

!!!

The XML Schema Formal Description discusses this specific issue and proposes
a _new_ URI syntax which does properly identify XML Schema items _but not by
name="foo"_

>
> [...]
>
> > > My stance is quite simple.
> > >
> > > 1/ RDF should incorporate XML Schema datatypes.
> >
> > I am not sure how RDF can 'incorporate' XML Schema datatypes alone. Do
you
> > mean that the RDF DT semantics should incorporate XSFD and/or XQFS? Or
do
> > you mean that RDF should incorporate the concepts of 'string' 'integer'
and
> > 'date'?
>
> The model theory should incorporate, at least, XML Schema primitive
> datatypes.  RDF/XML syntax should allow, at least, the specification of
XML
> Schema primitive datatypes, using the xsi:type construct.  (I would like
to
> go much further, of course.  I think that the natural place is to have the
> input to RDF from XML syntax be the XQuery 1.0 and XPath 2.0 Data model.)

For the above reason (namely that you need a correct way to generate a URI
for an XML Schema type) I think you will need to incorporate at least parts
of XS-formal and probably XQ-formal

> >
> > Careful, because there are known inconsistencies between XML Schema
_1.0_
> > and XSFD as well as XQFS (this is much of the _reason_ they were
developed
> > _after_ XML Schema 1.0 was specified). Hopefully the work of XSFD/XQFS
will
> > be incorporated into XSD 1.1.
>
> Yes, it would be much better if the XML-related stuff was in a better
> shape.  That is why I'm arguing for XML Schema---to pick one of the
> contenders, and the one that, I think, has the closest relationship to
> RDF/XML syntax.
>

Of course all the XML diehards I know say the same thing about RDF so there
you have it.

Jonathan

Received on Wednesday, 5 December 2001 19:22:30 UTC