W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

Re: Help wanted with XML Schema for Dublin Core in RDF/XML

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 11 Jan 2002 15:41:07 +0000
To: Dave Beckett <dave.beckett@bristol.ac.uk>
Cc: xmlschema-dev <xmlschema-dev@w3.org>, priscilla <priscilla@walmsley.com>
Message-ID: <f5bd70guc8c.fsf@cogsci.ed.ac.uk>
Here's a more general approach, only uses _two_ namespaces, could
serve as the starting point for a template for anyone wishing to
define a document type which provides for RDF descriptions from a
fixed vocabulary.

Please feel from to develop this further -- for your purposes you
would replace t: with dc: and myProp etc. with creator etc.

Note the example is not completely valid, intentionally -- creator is
not allowed.

ht

restricted-rdf.xsd:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ENTITY % p ''>
<!ENTITY % s ''>
]>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

  <element name="RDF">
    <complexType>
      <sequence>
        <element ref="rdf:Description" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>     
    </complexType>
  </element>

  <element name="Description">
    <complexType>
      <sequence>
        <element ref="rdf:any" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>     
      <attribute ref="rdf:about" use="optional"/>
    </complexType>
  </element>

  <attribute name="about" type="anyURI"/>
 
 <element name="any" abstract="true">
  <annotation>
   <documentation>Import this into a schema, and put something into the
substitution group of rdf:any to get a simple restricted version of rdf:RDF</documentation>
  </annotation>
 </element>
</schema>

simple-rdf-xmpl.xsd:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ENTITY % p ''>
<!ENTITY % s ''>
]>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:t="http://www.example.org/restrictedRDFexample"
 targetNamespace="http://www.example.org/restrictedRDFexample">


 <import namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         schemaLocation="restricted-rdf.xsd"/>

 <element name="top">
  <complexType>
   <sequence>
    <element ref="rdf:RDF"/>
   </sequence>
  </complexType>
 </element>
 
 <element name="myHead" substitutionGroup="rdf:any" abstract="true"/>
 
 <element name="myProp" substitutionGroup="t:myHead"/>
 
 <element name="myProp2" substitutionGroup="t:myHead"/>

 <element name="myProp3" substitutionGroup="t:myHead"/>
   
</schema>

simple-rdf-xmpl.xml:

<?xml version='1.0'?>
<top xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns="http://www.example.org/restrictedRDFexample"
     xsi:schemaLocation="http://www.example.org/restrictedRDFexample
                       simple-rdf-xmpl.xsd">
 <rdf:RDF>
  <rdf:Description rdf:about="http://www.ltg.ed.ac.uk/~ht/xsv-status.html">
     <myProp>Henry S. Thompson</myProp>
     <myProp2>The XSV Schema Validator</myProp2>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/">
    <creator>Tim Berners Lee</creator>
  </rdf:Description>
 </rdf:RDF>
</top>


-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Friday, 11 January 2002 10:41:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT