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

Re: an XML Schema intro from an RDF angle [was: Helping...]

From: Dan Connolly <connolly@w3.org>
Date: Fri, 18 May 2001 11:47:22 -0500
Message-ID: <3B05521A.7BC75BD8@w3.org>
To: Graham Klyne <Graham.Klyne@Baltimore.com>
CC: rdf core <w3c-rdfcore-wg@w3.org>
Graham Klyne wrote:
> 
> At 10:42 PM 5/17/01 -0500, Dan Connolly wrote:
> >I'd appreciate it if anybody who *doesn't* know XML schema
> >would take a look at this stuff and tell me if you're able
> >to make sense of it.
> 
> The first example (RDF0) seems straightforward.
> 
> The second (RDF1), I think I see the pattern but am not completely sure:
> 
>          <element name="typedNode" abstract="true" type="rdf:typedNodeType"/>
> 
> Seems to introduce a type, defined below, for element name
> "typedNode".  Being abstract, it can't be used directly, but forms a
> template for instantiations that can:
> 
>          <element name="Description" type="rdf:typedNodeType"
> substitutionGroup="rdf:typedNode"/>
> 
> Thus, by this schema, only <Description> elements can appear in <RDF>?

Yes, you've got it.

If you want to be able to use other elements in <RDF>, you
have to declare them similarly. If you follow the
link to the Aug 2000 materials, you'll find a considerably
more complete XML Schema for RDF (though it's based
on an outdated version of XML Schema):

=============
http://www.w3.org/2000/07/DAML-0-5-syntax

  <!-- so much for syntax structure. Now for the particular
       properties and classes... -->

  <element name="Statement"
           type="rdf:typedNodeType" equivClass="rdf:typedNode" />

  <element name="Property"
           type="rdf:typedNodeType" equivClass="rdf:typedNode" />
=============

So yes, if you want to check your RDF document using
XML Schema technology, you have to have declarations
for all the classes, properties, etc. that you want
to use. We need one for dublin core, one for
DAML, etc. etc.; the good news is (a) they're easy
to make; we might even be able to automate
the translation from RDF schema to XML Schema
(and/or the other way around) and (b) the benefit
of providing an XML Schema is that it helps you
find typos; e.g. if you write dc:author
in stead of dc:creator, there's nothing wrong
with that from an RDF schema perspective, but
checking it with XML Schema technology flags
it as an undeclared element.

Actually, I suppose there are ways to use RDF schema
to find such typos; TimBL has been hacking in that
direction. And there are ways to describe RDF
syntax with a less constraining XML Schema that
would allow more stuff to go undeclared, but
wouldn't find errors. This is just one approach.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Friday, 18 May 2001 12:47:35 EDT

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