Cover Pages Logo SEARCH
Advanced Search
Site Map
CP RSS Channel
Contact Us
Sponsoring CP
About Our Sponsors

Cover Stories
Articles & Papers
Press Releases

XML Query

XML Applications
General Apps
Government Apps
Academic Apps

Technology and Society
Tech Topics
Related Standards

XML Schema for RDF

Subject: Re: new public working draft of XML Schema 
From: Rick JELLIFFE <> 
Date: Sat, 26 Feb 2000 23:05:20 +0800 

"C. M. Sperberg-McQueen" wrote:

> Those interested in XML Schema may want to take a look at the new
> draft before the town-meeting on XML Schema Tuesday night at
> XTech.

For anyone interested, appended is a stab at an XML Schema for RDF. It shows
how abstract elements and equivClass is useful for constructing frameworks.  For
this kind of schema, it seems that there is an order to it:

  * first define the complex types,
  * then declare any abstract element which use the type
  * then declare the elements that use the complex types or which have an equivClass.

(where this is a logical order, not a lexical order: you do not need to
declare something before you reference it in XML Schemas, AFAIK.)

(I couldn't help thinking when making it that the US military IETM DTD would
have been much simpler  using this: it defines "templates" in comments to give
the element architecture that IETM DTDs should conform to {IETM=Interactive
Electronic Technical Manual}. These are  what XML Schemas calls abstract
elements, I think.)

In the documentation is a reference to a DTD I made for RDF too.  I would say
that the XML Schema is much more useful than the DTD: I think everything that
was in a comment in the DTD version can be put into a declaration in the XML Schema. (Except,
of course, for the RDF abbreviated syntax, but that is no surprise.)

Also noteworthy is that this XML Schema seems comparable, in line count, to
the DTD version.  I have repeatedly in the past pointed out how excellent DTDs
are for terseness,
so it is nice to see that for at least some schemas XML Schemas is not bad.

Rick Jelliffe
GeoTempo, Inc.

        xmlns:html="URL for HTML goes here"

                        <html:p>XML Schema for RDF,<html:br />
                        created 2000-12-25,               <html:br />
                        Rick Jelliffe, <html:br />
                        Academia Sinica Computing Centre.  <html:br />
                        Thanks to Henry Thompson for help.  </html:p>
                        <html:p>RDF Specification at
                        <html:a href="">W3C</html:a>.
                        <html:p>DTD version at
                        <html:a href=""
                        >Academia Sinica</html:a>.

        <!-- Top-level of RDF Document -->
        <element name="RDF">
                <complexType  content="elementOnly" >
                        <sequence  maxOccurs="*" >
                                        <element ref="rdf:TypedNode"   /><!-- abstract !-->
                                        <element ref="rdf:Bag" />
                                        <element ref="rdf:Seq" />
                                        <element ref="rdf:Alt" />

        <!-- RDF Typed nodes -->
       <complexType   name="TypedNodeType" content="elementOnly" >
                <sequence maxOccurs="*" >
                        <element ref="rdf:PropertyElt"   /><!--abstract !-->
                <attribute  name="id" minOccurs="0" type="ID"  />
                <attribute  name="type" minOccurs="0" type="string" />
                <attribute name="about" minOccurs="0" type="string" />
                <attribute  name="aboutEach" minOccurs="0" type="string" />
                <attribute   name="aboutEachPrefix" minOccurs="0" type="string" />
                <attribute  name="badID" minOccurs="0" type="ID" />
        <element name="TypedNode"  abstract="true"  type="rdf:TypedNodeType" />

        <element name="Description"
                type="rdf:TypedNodeType" equivClass="rdf:TypedNode" />

        <!-- RDF Property Elements -->
        <complexType  name="PropertyEltType" >
                <any minOccurs="0" />
                <attribute name="id"  minOccurs="0"  type="ID" />
                <attribute  name="resource" minOccurs="0"  type="string" />
                <attribute  name="value" minOccurs="0"  type="string" />
                <attribute  name="badID" minOccurs="0" type="ID"  />
                <attribute name="parseType"  minOccurs="0" >
                        <simpleType base="NMTOKEN">
                                 <enumeration value="Resource"/>
                                 <enumeration value="Literal" />
                <anyAttribute  />

        <element name="PropertyElt"  abstract="true" type="rdf:PropertyEltType" />

        <element   name="subject"   equivClass="rdf:PropertyElt"  />
        <element name="predicate"   equivClass="rdf:PropertyElt" />
        <element name="object"  equivClass="rdf:PropertyElt" />
        <element   name="type"  equivClass="rdf:PropertyElt" />

        <element name="value">
                        <any />
                        <anyAttribute />

        <!-- RDF Containers -->
        <complexType name="Container" abstract="true" content="elementOnly" >
                <sequence maxOccurs="*">
                        <element name="li">
                                        <attribute name="id"  minOccurs="0" type="ID" />
                                        <attribute name="parseType" minOccurs="0" >
                                                <simpleType base="NMTOKEN">
                                                     <enumeration value="Resource"/>
                                                     <enumeration value="Literal" />
                                        <anyAttribute />
                <attribute name="id" type="ID" />
                <anyAttribute />

        <element name="Alt" type="rdf:Container" />
        <element name="Bag" type="rdf:Container" />
        <element name="Seq" type="rdf:Container" />


<RDF xmlns="">
 <Description about="foo">
  <predicate value="prop"/>
  <object value="http:whoknows"/>


Prepared by Robin Cover for The XML Cover Pages archive. For schema description and references, see "XML Schemas."

Globe Image

Document URL: