<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?dsd href="/Library/Schemas/dsd/dsd2.dsd"?>

<!DOCTYPE dsd:dsd [
   <!-- Used in annotation -->
   <!ENTITY lt       "&#38;#60;" >     <!-- less-than sign -->
   <!ENTITY gt       "&#62;" >         <!-- greater-than sign -->
   <!ENTITY dash     "&#x2010;" >      <!-- hyphen (true graphic) -->
   <!ENTITY ndash    "&#x2013;" >      <!-- en dash -->
   <!ENTITY mdash    "&#x2014;" >      <!-- em dash -->
   <!ENTITY ldquo    "&#x201c;" >      <!-- Left Double Quote -->
   <!ENTITY rdquo    "&#x201d;" >      <!-- Right Double Quote -->
   <!ENTITY lsquo    "&#x2018;" >      <!-- Left Single Quote -->
   <!ENTITY rsquo    "&#x2019;" >      <!-- Right Single Quote -->
   <!ENTITY bull     "&#x2022;" >      <!-- round bullet, filled -->
   <!ENTITY nbsp     "&#160;" >        <!-- no break space -->
   <!ENTITY rarr     "&#x2192;" >      <!-- right arrow -->
   <!ENTITY copy     "&#169;" >        <!-- copyright -->
   <!ENTITY lowbar   "_" >               <!-- low line -->
] >

<dsd:dsd
   xmlns:dsd="http://www.brics.dk/DSD/2.0"
   xmlns:m="http://www.brics.dk/DSD/2.0/meta"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

   xmlns:xhtml="http://www.w3.org/1999/xhtml"

   xmlns:doc="http://www.hsfr.org.uk/Schema/Doc"
   xmlns:list="http://www.hsfr.org.uk/Schema/List"
   xmlns:copyright="http://www.hsfr.org.uk/Schema/Copyright"
   xmlns:address="http://www.hsfr.org.uk/Schema/Address"
   xmlns:person="http://www.hsfr.org.uk/Schema/Person"
   xmlns:postcode="http://www.hsfr.org.uk/Schema/Postcode"
   xmlns:vers="http://www.hsfr.org.uk/Schema/Version" >

   <m:doc>
     <doc:title>Resource Description Framework: Base DSD Schema</doc:title>
     <doc:desc>
         <xhtml:p>This DSD-2 schema provides a minimal definition of the Resource Description Framework.
            It provides a baseline skeleton for higher level definitions such as RDFS and OWL into
            which it should be included. It has been difficult to produce this schema as there have
            been so many gaps in the formal grammar of RDF. The following represents the best fit so
            far against the current specification together with additional parts of the grammar left out.
            Some terms have been declared but not used, their use will be declared in higher level
            schemas for RDFS etc.</xhtml:p>
        
        <xhtml:p>The schema represents work in progress so any help here would
            be gratefully received. Any bug reports, help, suggestions, new task schemas etc to me,
            <xhtml:a href="h.field-richards@eris.qinetiq.gov.uk">Hugh Field-Richards</xhtml:a>. I will
            include them as soon as vacations, weekends, work etc allow.</xhtml:p>
                  
         <xhtml:p>Note that the member attributes of the form "<xhtml:code>rdf:&lowbar;n</xhtml:code>"
            cannot be catered for by DSD (or any other schema for that matter) &mdash; it ain't the right grammar.</xhtml:p>

      </doc:desc>
      <doc:versions>
         <vers:entry vers="0.00-0" day="20" month="January" year="2003" who="HSFR">Created</vers:entry>
         <vers:entry vers="0.00-1" day="15" month="May" year="2003" who="HSFR">Heavily modified in all areas!</vers:entry>
         <vers:entry vers="0.10-0" day="16" month="May" year="2003" who="HSFR">First released version</vers:entry>
         <vers:entry vers="0.11-0" day="28" month="February" year="2005" who="HSFR">Added externally accessable rules "rdf."</vers:entry>
         <vers:entry vers="0.20-0" day="28" month="February" year="2005" who="HSFR">Split off from original rdf.dsd</vers:entry>
         <vers:entry vers="1.00-0" day="1" month="March" year="2005" who="HSFR">Complete rewrite according to latest syntax. Major change to documentation (XHTML) and namespaces</vers:entry>
         <vers:entry vers="2.00-0" day="18" month="March" year="2005" who="HSFR">Another major rewrite with improved DSD syntax.</vers:entry>
         <vers:entry vers="2.10-0" day="6" month="April" year="2005" who="HSFR">Added extra vocabulary.</vers:entry>
         <vers:entry vers="2.10-1" day="8" month="April" year="2005" who="HSFR">Several tweakings to cater for empty elements.</vers:entry>
      </doc:versions>
      <doc:authors>
         <person:person>
            <person:forenames>
               <list:list type="ordered">
                  <list:item><person:forename type="primary">Hugh</person:forename></list:item>
                  <list:item><person:forename>Sherwood</person:forename></list:item>
               </list:list>
         </person:forenames>
            <person:surname>Field-Richards</person:surname>
            <person:email>h.field-richards@eris.qinetiq.gov.uk</person:email>
            <person:address>
               <address:address where="work">
                  <address:line numb="3">St Andrew's Road</address:line>
                  <address:line numb="1">Room G13</address:line>
                  <address:line numb="2">QinetiQ</address:line>
                  <address:town>Malvern</address:town>
                  <address:county>Worcs</address:county>
                  <address:country>United Kingdom</address:country>
                  <postcode:postcode>WR14 3PS</postcode:postcode>
               </address:address>
            </person:address>
         </person:person>
      </doc:authors>
      <doc:copyright>
         <copyright:who value="QinetiQ" />
         <copyright:date value="2003,2004,2005" />
         <copyright:leader value="Copyright" />
         <copyright:text>All copyright, database rights and other intellectual property in this
            software is the property of QinetiQ limited.  The software is being released
            free of charge for use in accordance with the terms of open source
            initiative GNU General Public Licence.</copyright:text>
         <copyright:disclaimer>QinetiQ Ltd does not verify or warrant the accuracy,
            completeness or suitability of this software for any particular purpose.
            Any use of this software whatsoever is entirely at the user's own risk and
            QinetiQ Ltd accepts no liability in relation thereto.</copyright:disclaimer>
      </doc:copyright>
   </m:doc>
   
   <dsd:import href="uri.dsd"/>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-* ELEMENT EXPRESSIONS *-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:boolexp id="rdf.coreSyntaxTerms">
      <m:doc>
         <xhtml:h2>Element Expressions</xhtml:h2>
         <xhtml:p>This defines a set of valid elements grouped as the specification. Note that
         the latter is presented in terms of variable names for the elements and attributes. We
         cannot do this in DSD &mdash; or for that matter in any other schema language except possibly
         RELAX&nbsp;NG. But that schema will only allow us to do it with the element names but
         not attributes.</xhtml:p>
         <xhtml:h3>Core Syntax Terms</xhtml:h3>
         <xhtml:pre>   "rdf:RDF" | "rdf:ID" | "rdf:about" | "rdf:parseType" | "rdf:resource" | "rdf:nodeID" | "rdf:datatype"</xhtml:pre>
      </m:doc>
      <dsd:or>
         <dsd:element name="rdf:RDF"/>
         <dsd:element name="rdf:ID"/>
         <dsd:element name="rdf:about"/>
         <dsd:element name="rdf:parseType"/>
         <dsd:element name="rdf:resource"/>
         <dsd:element name="rdf:nodeID"/>
         <dsd:element name="rdf:datatype"/>
      </dsd:or>
   </dsd:boolexp>

   <dsd:boolexp id="rdf.coreSyntaxTerms.content">
      <m:doc>
         <xhtml:p>The same as above except when for contents. This is repeated
         for all the vocabulary definitions below.</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:contents><dsd:element name="rdf:RDF"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:ID"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:about"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:parseType"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:resource"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:nodeID"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:datatype"/></dsd:contents>
      </dsd:or>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

   <dsd:boolexp id="rdf.oldTerms">
      <m:doc>
         <xhtml:h3>Old Terms</xhtml:h3>
         <xhtml:pre>   "rdf:aboutEach" | "rdf:aboutEachPrefix" | "rdf:bagID"</xhtml:pre>
      <xhtml:p>These are the names from the RDF vocabulary that have been withdrawn
         from the language.</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:element name="rdf:aboutEach"/>
         <dsd:element name="rdf:aboutEachPrefix"/>
         <dsd:element name="rdf:bagID"/>
      </dsd:or>
   </dsd:boolexp>

   <dsd:boolexp id="rdf.oldTerms.content">
      <dsd:or>
         <dsd:contents><dsd:element name="rdf:aboutEach"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:aboutEachPrefix"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:bagID"/></dsd:contents>
      </dsd:or>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.containerTerms">
      <m:doc>
         <xhtml:h3>Container Terms</xhtml:h3>
         <xhtml:pre>   "rdf:Bag" | "rdf:Seq" | "rdf:Alt"</xhtml:pre>
         <xhtml:p>These terms have been left out of the
            <xhtml:a href="http://www.w3.org/TR/rdf-syntax-grammar/" target="RDF">current
               RDF spec</xhtml:a>&nbsp;&mdash; I do not see why. They reappear in the
            <xhtml:a href="http://www.w3.org/TR/rdf-schema/" target="RDFS">RDFS spec</xhtml:a>
            but are given namespaces from the RDF, which I believe, means that they should
            appear in the RDF spec.</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:element name="rdf:Bag"/>
         <dsd:element name="rdf:Seq"/>
         <dsd:element name="rdf:Alt"/>
      </dsd:or>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.containerTerms.content">
      <dsd:or>
         <dsd:contents><dsd:element name="rdf:Bag"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:Seq"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:Alt"/></dsd:contents>
      </dsd:or>
   </dsd:boolexp>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.reificationTerms">
      <m:doc>
         <xhtml:h3>Reification Terms</xhtml:h3>
         <xhtml:pre>   "rdf:Statement" | "rdf:subject" | "rdf:predicate" | "rdf:object"</xhtml:pre>
      </m:doc>
      <dsd:or>
         <dsd:element name="rdf:Statement"/>
         <dsd:element name="rdf:subject"/>
         <dsd:element name="rdf:predicate"/>
         <dsd:element name="rdf:object"/>
      </dsd:or>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.reificationTerms.content">
      <dsd:or>
         <dsd:contents><dsd:element name="rdf:Statement"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:subject"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:predicate"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:object"/></dsd:contents>
      </dsd:or>
   </dsd:boolexp>
   
   <dsd:if><dsd:element name="rdf:object"/>
      <dsd:declare>
         <dsd:contents>
            <dsd:optional><dsd:string/></dsd:optional>
         </dsd:contents> 
      </dsd:declare>
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.collectionTerms">
      <m:doc>
         <xhtml:h3>Collection Terms</xhtml:h3>
         <xhtml:pre>   "rdf:List" | "rdf:first" | "rdf:rest" | "rdf:nill"</xhtml:pre>
      </m:doc>
      <dsd:or>
         <dsd:element name="rdf:List"/>
         <dsd:element name="rdf:first"/>
         <dsd:element name="rdf:rest"/>
         <dsd:element name="rdf:nill"/>
      </dsd:or>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.collectionTerms.content">
      <dsd:or>
         <dsd:contents><dsd:element name="rdf:List"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:first"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:rest"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:nill"/></dsd:contents>
      </dsd:or>
   </dsd:boolexp>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.classTerms">
      <m:doc>
         <xhtml:h3>Class Terms</xhtml:h3>
         <xhtml:pre>   "rdf:XMLLiteral" | "rdf:Property"</xhtml:pre>
      </m:doc>
      <dsd:or>
         <dsd:element name="rdf:XMLLiteral"/>
         <dsd:element name="rdf:Property"/>
      </dsd:or>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.classTerms.content">
      <dsd:or>
         <dsd:contents><dsd:element name="rdf:XMLLiteral"/></dsd:contents>
         <dsd:contents><dsd:element name="rdf:Property"/></dsd:contents>
      </dsd:or>
   </dsd:boolexp>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.utilityTerms">
      <m:doc>
         <xhtml:h3>Utility Terms</xhtml:h3>
         <xhtml:pre>   "rdf:value"</xhtml:pre>
      </m:doc>
      <dsd:element name="rdf:value"/>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.utilityTerms.content">
      <dsd:contents><dsd:element name="rdf:value"/></dsd:contents>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.extraTerms">
      <m:doc>
         <xhtml:h3>Extra Terms</xhtml:h3>
         <xhtml:p>These are the set of terms that do not appear int the ordinary grammar</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:boolexp ref="rdf.containerTerms"/>
         <dsd:boolexp ref="rdf.reificationTerms"/>
         <dsd:boolexp ref="rdf.collectionTerms"/>
         <dsd:boolexp ref="rdf.classTerms"/>
         <dsd:boolexp ref="rdf.utilityTerms"/>
      </dsd:or>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.syntaxTerms">
      <m:doc>
         <xhtml:h3>Syntax Terms</xhtml:h3>
         <xhtml:pre>   coreSyntaxTerms | "rdf:Description" | "rdf:li"</xhtml:pre>
         <xhtml:p>Note that these syntax terms are not used anywhere.</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:boolexp ref="rdf.coreSyntaxTerms"/>
         <dsd:element name="rdf:Description"/>
         <dsd:element name="rdf:li"/>
      </dsd:or>
   </dsd:boolexp>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-* ATTRIBUTE DEFINITIONS *-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:declare>
      <m:doc>
         <xhtml:h2>Attribute Definitions</xhtml:h2>
         <xhtml:h3>ID</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:ID">
         <dsd:stringtype ref="rdf-id"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>nodeID</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:nodeID">
         <dsd:stringtype ref="rdf-id"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>about</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:about">
         <dsd:stringtype ref="URI-ref"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>resource</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:resource">
         <dsd:stringtype ref="URI-ref"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>datatype</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:datatype">
         <dsd:stringtype ref="URI-ref"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>parseLiteral</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:parseLiteral">
         <dsd:string value="Literal"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>parseResource</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:parseResource">
         <dsd:string value="Resource"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>parseCollection</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:parseCollection">
         <dsd:string value="Collection"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>parseOther</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:parseOther">
         <dsd:stringtype ref="parse-other"/>
      </dsd:attribute>
   </dsd:declare>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:declare>
      <m:doc>
         <xhtml:h3>bagID</xhtml:h3>
      </m:doc>
      <dsd:attribute name="rdf:bagID">
         <dsd:string/>
      </dsd:attribute>
   </dsd:declare>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-* ELEMENT EXPRESSIONS *-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

   <dsd:boolexp id="rdf.propertyElementURIs.except">
      <m:doc>
         <xhtml:h3>Restriction on Property Elements</xhtml:h3>
         <xhtml:pre>   propertyElementURIs ::= anyURI - ( coreSyntaxTerms | "rdf:Description" | oldTerms )</xhtml:pre>
         <xhtml:p>The URIs that are allowed on property elements.</xhtml:p>
      </m:doc>
      <dsd:not>
         <dsd:or>
            <dsd:boolexp ref="rdf.coreSyntaxTerms"/>
            <dsd:element name="rdf:Description"/>
            <dsd:boolexp ref="rdf.oldTerms"/>
         </dsd:or>
      </dsd:not>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.propertyElementURIs.content.except">
      <dsd:not>
         <dsd:or>
            <dsd:boolexp ref="rdf.coreSyntaxTerms.content"/>
            <dsd:contents><dsd:element name="rdf:Description"/></dsd:contents>
            <dsd:boolexp ref="rdf.oldTerms.content"/>
         </dsd:or>
      </dsd:not>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-* ATTRIBUTE EXPRESSIONS *-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:boolexp id="rdf.attrib.coreSyntaxTerms">
      <m:doc>
         <xhtml:h2>Attribute Definitions</xhtml:h2>
         <xhtml:p>As was said we have to redefine all the above for attributes</xhtml:p>
         <xhtml:h3>Attribute Production coreSyntaxTerms</xhtml:h3>
         <xhtml:pre>   "rdf:RDF"
   | "rdf:ID"
   | "rdf:about"
   | "rdf:parseType"
   | "rdf:resource"
   | "rdf:nodeID"
   | "rdf:datatype"</xhtml:pre>
      </m:doc>
      <dsd:or>
         <dsd:attribute name="rdf:RDF"/>
         <dsd:attribute name="rdf:ID"/>
         <dsd:attribute name="rdf:about"/>
         <dsd:attribute name="rdf:parseType"/>
         <dsd:attribute name="rdf:resource"/>
         <dsd:attribute name="rdf:nodeID"/>
         <dsd:attribute name="rdf:datatype"/>
      </dsd:or>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

   <dsd:boolexp id="rdf.attrib.oldTerms">
      <m:doc>
         <xhtml:h3>Old Terms</xhtml:h3>
         <xhtml:pre>   "rdf:aboutEach" | "rdf:aboutEachPrefix" | "rdf:bagID"</xhtml:pre>
         <xhtml:p>These are the names from the RDF vocabulary that have been withdrawn
            from the language.</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:attribute name="rdf:aboutEach"/>
         <dsd:attribute name="rdf:aboutEachPrefix"/>
         <dsd:attribute name="rdf:bagID"/>
      </dsd:or>
   </dsd:boolexp>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:boolexp id="rdf.propertyAttributeURIs.except">
      <m:doc>
         <xhtml:h3>Restrictions on Property Attributes</xhtml:h3>
         <xhtml:pre>   propertyAttributeURIs ::= anyURI - ( coreSyntaxTerms | "rdf:Description" | "rdf:li" | oldTerms )</xhtml:pre>
         <xhtml:p>The RDF URI references that are allowed on property attributes.</xhtml:p>
      </m:doc>
      <dsd:not>
         <dsd:or>
            <dsd:boolexp ref="rdf.attrib.coreSyntaxTerms"/>
            <dsd:attribute name="rdf:Description"/>
            <dsd:attribute name="rdf:li"/>
            <dsd:boolexp ref="rdf.attrib.oldTerms"/>
         </dsd:or>
      </dsd:not>
   </dsd:boolexp>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-* COMMON REQUIREMENTS *-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:if><dsd:element name="rdf:"/>
      <m:doc>
         <xhtml:p>Any element within the rdf namespace can have any rdf attribute.
            Any restrictions to this are defined below. I am assuming that the
            all RDF vocabulary elements can have the <xhtml:i>ID</xhtml:i> attribute.
            This may prove a rash assumption.</xhtml:p>
         <xhtml:p>I am also permitting any RDF element to contain attributes from
            the XML namespace: xml:base, xml:lang, etc..</xhtml:p>
      </m:doc>
      <dsd:declare>
         <dsd:attribute name="rdf:"/>
         <dsd:attribute name="xml:"/>
      </dsd:declare>
   </dsd:if>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-* NODE ELEMENT LIST *-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:boolexp id="rdf.nodeElementURIs">
      <m:doc>
         <xhtml:h2>Node Elements</xhtml:h2>
         <xhtml:h3>Node Element Exceptions</xhtml:h3>
         <xhtml:pre>   nodeElementURIs ::= anyURI - ( coreSyntaxTerms | rdf:li | oldTerms )</xhtml:pre>
         <xhtml:p>Note that the <xhtml:i>anyURI</xhtml:i> means any <xhtml:i>within the RDF
            namespace</xhtml:i> here. We can provide further additions to this within
            higher level schemas.</xhtml:p>
      </m:doc>
      <dsd:or>
         <dsd:boolexp ref="rdf.coreSyntaxTerms"/>
         <dsd:element name="rdf:li"/>
         <dsd:boolexp ref="rdf.oldTerms"/>
      </dsd:or>
   </dsd:boolexp>

   <dsd:boolexp id="rdf.nodeElementURIs.except">
      <dsd:not>
         <dsd:boolexp ref="rdf.nodeElementURIs" />
      </dsd:not>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.nodeElementURIs.content.except">
      <dsd:not>
         <dsd:or>
            <dsd:boolexp ref="rdf.coreSyntaxTerms.content"/>
            <dsd:contents><dsd:element name="rdf:li"/></dsd:contents>
            <dsd:boolexp ref="rdf.oldTerms.content"/>
         </dsd:or>
      </dsd:not>
   </dsd:boolexp>

    <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:rule id="rdf.nodeElementList">
      <m:doc>
         <xhtml:h3>A List of Node Elements</xhtml:h3>
         <xhtml:pre>   nodeElementList ::= ws*, ( nodeElement , ws* )*</xhtml:pre>
         <xhtml:p>DSD removes and processes whitespace by default so we can make a
            simplification here.</xhtml:p>
      </m:doc>
      <dsd:declare>
         <dsd:contents>
            <dsd:repeat min="0">
               <dsd:element name="rdf:"/>
            </dsd:repeat>
         </dsd:contents>
      </dsd:declare>
      <dsd:require>
         <dsd:boolexp ref="rdf.nodeElementURIs.content.except"/>
      </dsd:require>
   </dsd:rule>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:rule id="rdf.nodeElement">
      <m:doc>
         <xhtml:h2>A Single Node Element</xhtml:h2>
      </m:doc>
      <dsd:declare>
         <dsd:contents>
            <dsd:optional>
               <dsd:element name="rdf:"/>
            </dsd:optional>
         </dsd:contents>
      </dsd:declare>
      <dsd:require>
         <dsd:boolexp ref="rdf.nodeElementURIs.content.except"/>
      </dsd:require>
   </dsd:rule>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:if>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.nodeElementURIs.except"/>
      </dsd:and>
      <m:doc>
         <xhtml:h3>Node Element</xhtml:h3>
         <xhtml:pre>   nodeElement ::= start-element( URI == nodeElementURIs )
            attributes == set( ( idAttr | nodeIdAttr | aboutAttr )?, propertyAttr* ) ) )
      propertyEltList
   end-element()</xhtml:pre>
         <xhtml:p>Note that <xhtml:code>propertyAttr</xhtml:code> is defined as any URI except a set of RDF
            URIs (see above). This means the contenttype <xhtml:i>rdf.propertyAttributeURIs</xhtml:i>
            is defined without the zero or more repeats. Any further restriction for a particular
            schema is done within that schema at a higher level.</xhtml:p>
         <xhtml:p>Looking at the attributes here we have the following that are allowed:
            <xhtml:code>rdf:ID</xhtml:code>, <xhtml:code>rdf:resource</xhtml:code>,
            <xhtml:code>rdf:nodeID</xhtml:code> and any defined by <xhtml:i>propertyAttr</xhtml:i>.
            Note that the attributes <xhtml:code>rdf:ID</xhtml:code>,
            <xhtml:code>rdf:resource</xhtml:code> and <xhtml:code>rdf:nodeID</xhtml:code>
            are also defined in <xhtml:i>coreSyntaxTerms</xhtml:i> and are therefore excluded
            in <xhtml:i>propertyAttributeURIs</xhtml:i>. So <xhtml:i>emptyPropertyElt</xhtml:i>
            both allows and disallows these attributes; while it will probably be argued
            that everyone knows what is meant, this is sloppy specifying. The end result is
            I have to specify the requirements in the boolexp below.</xhtml:p>
      </m:doc>
      <dsd:rule ref="rdf.propertyEltList.content" />
      <dsd:rule ref="rdf.nodeElement.attribs"/>
      <dsd:if>
         <dsd:and>
            <dsd:attribute name="rdf:"/>
            <dsd:boolexp ref="rdf.nodeElementURIs"/>
         </dsd:and>
         <dsd:require>
            <dsd:not>
               <dsd:or>
                  <dsd:attribute name="rdf:RDF"/>
                  <dsd:attribute name="rdf:parseType"/>
                  <dsd:attribute name="rdf:resource"/>
                  <dsd:attribute name="rdf:datatype"/>
                  <dsd:attribute name="rdf:li"/>
                  <dsd:boolexp ref="rdf.attrib.oldTerms"/>
               </dsd:or>
            </dsd:not>
         </dsd:require>
      </dsd:if>
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:rule id="rdf.nodeElement.attribs">
      <m:doc>
         <xhtml:p>Only one of these three attributes are allowed.</xhtml:p>
      </m:doc>
      <dsd:if>
         <dsd:or>
            <dsd:attribute name="rdf:ID"/>
            <dsd:attribute name="rdf:nodeID"/>
            <dsd:attribute name="rdf:about"/>
         </dsd:or>
         <dsd:require>
            <dsd:one>
               <dsd:attribute name="rdf:ID"/>
               <dsd:attribute name="rdf:nodeID"/>
               <dsd:attribute name="rdf:about"/>
            </dsd:one>
         </dsd:require>
      </dsd:if>
   </dsd:rule>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:rule id="rdf.propertyAttr">
      <m:doc>
         <xhtml:p>Any of the remaining attributes in the rdf namespace have to follow the
            exclusions.</xhtml:p>
      </m:doc>
      <dsd:if><dsd:attribute name="rdf:"/>
         <dsd:require>
            <dsd:boolexp ref="rdf.propertyAttributeURIs.except"/>
         </dsd:require>
      </dsd:if>
   </dsd:rule>

  <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-* PROPERTY ELT LIST *-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:rule id="rdf.propertyEltList.content">
      <m:doc>
         <xhtml:h3>Property Elt List</xhtml:h3>
         <xhtml:pre>   propertyEltList ::= ws* , ( propertyElt , ws* )*</xhtml:pre>
         <xhtml:pre>   propertyElt ::= resourcePropertyElt |
            literalPropertyElt |
            parseTypeLiteralPropertyElt |
            parseTypeResourcePropertyElt |
            parseTypeCollectionPropertyElt |
            parseTypeOtherPropertyElt |
            emptyPropertyElt</xhtml:pre>
         <xhtml:p>This is a slightly problematic definition. I can make a reasonable assumption that
            all the above resolve to a common element set (propertyElementURIs), but with a different
            attribute set. The content of each will be different dependent on the attribute and this
            is attempted in the rules that follow.</xhtml:p>
         <xhtml:p>The rule that follows should be used where
            <xhtml:i>rdf.propertyEltList</xhtml:i> appears.</xhtml:p>
      </m:doc>
      <dsd:declare>
         <dsd:contents>
            <dsd:repeat min="0">
               <dsd:element name="rdf:"/>
            </dsd:repeat>
         </dsd:contents>
      </dsd:declare>
      <dsd:if><dsd:element name="rdf:"/>
         <dsd:require>
            <dsd:boolexp ref="rdf.propertyElementURIs.content.except" />
         </dsd:require>
      </dsd:if>
   </dsd:rule>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-* RESOURCE PROPERTY *-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:boolexp id="rdf.resource.cond">
      <m:doc>
         <xhtml:h2>Resource Properties</xhtml:h2>
         <xhtml:h3>Resource Property Elt</xhtml:h3>
         <xhtml:pre>   resourcePropertyElt ::= start-element( URI == propertyElementURIs ), attributes == set( idAttr? ) )
      ws* nodeElement ws*
   end-element()</xhtml:pre>
         <xhtml:p>I have to have the rather mucky boolexp below as the RDF syntax is so crass.
            Remember that any RDF namespace element can have an RDF attribute. The rather nasty
            equiv expression here is saying "not( rdf:* ) except rdf:ID" (I hope).</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
         <dsd:not> <!-- not( rdf:* ) except rdf:ID -->
            <dsd:equiv>
               <dsd:attribute name="rdf:ID"/>
               <dsd:attribute name="rdf:"/>
            </dsd:equiv>
         </dsd:not>
      </dsd:and>
   </dsd:boolexp>

   <dsd:boolexp id="rdf.resourcePropertyElt">
      <dsd:and>
         <dsd:boolexp ref="rdf.resource.cond" />
         <dsd:child>
            <dsd:and>
               <dsd:element name="rdf:"/>
               <dsd:boolexp ref="rdf.nodeElementURIs.except"/>
            </dsd:and>
         </dsd:child>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:if><dsd:boolexp ref="rdf.resource.cond"/>
      <dsd:rule ref="rdf.nodeElement" />
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*- LITERAL PROPERTY *-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:boolexp id="rdf.literal.cond">
      <m:doc>
         <xhtml:h3>Literal Property Elt</xhtml:h3>
         <xhtml:p>This expression defines what is classed as a literal property. Note that
         the expression is not unambiguous and overlaps with others below.</xhtml:p>
         <xhtml:pre>   literalPropertyElt ::= start-element( URI == propertyElementURIs ), attributes == set( idAttr?, datatypeAttr? ) )
      text()
   end-element()</xhtml:pre>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
         <dsd:not> <!-- not( rdf:* ) except ( rdf:ID or rdf:datatype ) -->
            <dsd:equiv>
               <dsd:or>
                  <dsd:attribute name="rdf:ID"/>
                  <dsd:attribute name="rdf:datatype"/>
               </dsd:or>
               <dsd:attribute name="rdf:"/>
            </dsd:equiv>
         </dsd:not>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.literalPropertyElt">
      <m:doc>
         <xhtml:p>This expression defines what is classed as a literalPropertyElt. It includes
            the possible content but it still has an ambiguity problems.</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:boolexp ref="rdf.literal.cond"/>
         <dsd:contents><dsd:string/></dsd:contents>
      </dsd:and>
   </dsd:boolexp>

   <dsd:if><dsd:boolexp ref="rdf.literal.cond"/>
      <dsd:declare>
         <dsd:contents><dsd:string/></dsd:contents>
      </dsd:declare>
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*- PARSE TYPE LITERAL PROPERTY -*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   

   <dsd:boolexp id="rdf.parseTypeLiteral.cond">
      <m:doc>
         <xhtml:h3>Parse Type Literal Property Elt</xhtml:h3>
         <xhtml:pre>   parseTypeLiteralPropertyElt ::= start-element( URI == propertyElementURIs ), attributes == set( idAttr?, parseLiteral ) )
      literal
   end-element()</xhtml:pre>
         <xhtml:p>The definition of what is allowed in the "literal" content is defined at higher levels.
            However we can say it must not be character data.</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
          <dsd:attribute name="rdf:parseType">
            <dsd:string value="Literal"/>
          </dsd:attribute>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.parseTypeLiteralPropertyElt">
      <m:doc>
         <xhtml:p>This expression defines what is classed as a parseTypeLiteralPropertyElt.</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:boolexp ref="rdf.parseTypeLiteral.cond"/>
         <dsd:not>
            <dsd:contents><dsd:string/></dsd:contents>
         </dsd:not>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:if><dsd:boolexp ref="rdf.parseTypeLiteral.cond"/>
      <dsd:require>  
         <dsd:not>
            <dsd:contents><dsd:string/></dsd:contents>
         </dsd:not>
      </dsd:require>
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*- PARSE TYPE RESOURCE PROPERTY *-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:boolexp id="rdf.parseTypeResource.cond">
      <m:doc>
         <xhtml:h3>Parse Type Resource Property Elt</xhtml:h3>
         <xhtml:pre>   parseTypeResourcePropertyElt ::= start-element( URI == propertyElementURIs ), attributes == set( idAttr?, parseResource ) )
      propertyEltList
   end-element()</xhtml:pre>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
         <dsd:attribute name="rdf:parseType">
            <dsd:string value="Resource"/>
         </dsd:attribute>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.parseTypeResourcePropertyElt">
      <m:doc>
         <xhtml:p>This expression defines what is classed as a parseTypeResourcePropertyElt.</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:boolexp ref="rdf.parseTypeResource.cond"/>
         <dsd:child>
            <dsd:or>
               <dsd:boolexp ref="rdf.resource.cond"/>
               <dsd:boolexp ref="rdf.resourcePropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeLiteralPropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeResourcePropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeCollectionPropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeOtherPropertyElt"/>
               <dsd:boolexp ref="rdf.emptyPropertyElt"/>
            </dsd:or>
         </dsd:child>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:if><dsd:boolexp ref="rdf.parseTypeResource.cond"/>
      <dsd:rule ref="rdf.propertyEltList.content" />
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*- PARSE TYPE COLLECTION PROPERTY *-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:boolexp id="rdf.parseTypeCollection.cond">
      <m:doc>
         <xhtml:h3>Parse Type Collection Property Elt</xhtml:h3>
         <xhtml:pre>   parseTypeCollectionPropertyElt ::= start-element( URI == propertyElementURIs ), attributes == set( idAttr?, parseCollection ) )
      nodeElementList
   end-element()</xhtml:pre>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
         <dsd:attribute name="rdf:parseType">
            <dsd:string value="Collection"/>
         </dsd:attribute>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.parseTypeCollectionPropertyElt">
      <m:doc>
         <xhtml:p>This expression defines what is classed as a parseTypeCollectionPropertyElt.</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:boolexp ref="rdf.parseTypeCollection.cond"/>
         <dsd:child>
            <dsd:or>
               <dsd:boolexp ref="rdf.resource.cond"/>
               <dsd:boolexp ref="rdf.resourcePropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeLiteralPropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeResourcePropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeCollectionPropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeOtherPropertyElt"/>
               <dsd:boolexp ref="rdf.emptyPropertyElt"/>
            </dsd:or>
         </dsd:child>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:if><dsd:boolexp ref="rdf.parseTypeCollection.cond"/>
      <dsd:rule ref="rdf.nodeElementList"/>
   </dsd:if>

   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-* PARSE TYPE OTHER PROPERTY *-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:boolexp id="rdf.parseTypeOther.cond">
      <m:doc>
         <xhtml:h3>Parse Type Other Property Elt</xhtml:h3>
         <xhtml:pre>   parseTypeOtherPropertyElt ::= start-element( URI == propertyElementURIs ), attributes == set( idAttr?, parseOther ) )
      propertyEltList
   end-element()</xhtml:pre>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
         <dsd:attribute name="rdf:parseType">
            <dsd:stringtype ref="parse-other"/>
         </dsd:attribute>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.parseTypeOtherPropertyElt">
      <m:doc>
         <xhtml:p>This expression defines what is classed as a parseTypeCollectionPropertyElt. It includes
            the possible content but it still has ambiguity problems.</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:boolexp ref="rdf.parseTypeOther.cond"/>
         <dsd:child>
            <dsd:or>
               <dsd:boolexp ref="rdf.resource.cond"/>
               <dsd:boolexp ref="rdf.resourcePropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeLiteralPropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeResourcePropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeCollectionPropertyElt"/>
               <dsd:boolexp ref="rdf.parseTypeOtherPropertyElt"/>
               <dsd:boolexp ref="rdf.emptyPropertyElt"/>
            </dsd:or>
         </dsd:child>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:if><dsd:boolexp ref="rdf.parseTypeOther.cond"/>
      <dsd:rule ref="rdf.propertyEltList.content"/>
    </dsd:if>
   
    <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- EMPTY PROPERTY *-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
 
   <dsd:boolexp id="rdf.emptyProperty.cond">
      <m:doc>
         <xhtml:hr/>
         <xhtml:h3>Production emptyPropertyElt</xhtml:h3>
         <xhtml:pre>   emptyPropertyElt ::= start-element( URI == propertyElementURIs )
      attributes == set( idAttr?, ( resourceAttr | nodeIdAttr )?, propertyAttr*))
   end-element()</xhtml:pre>
         <xhtml:p>It should be noticed that resource is declared twice in the production
            for emptyPropertyEllt, once explicitly and once as an exclusion in propertyAttr. To overcome this
            I have had to expand everything here and not use previously defined rules. Nasty but
            necessary</xhtml:p>
      </m:doc>
      <dsd:and>
         <dsd:element name="rdf:"/>
         <dsd:boolexp ref="rdf.propertyElementURIs.except"/>
         <dsd:not>
            <dsd:or>
               <dsd:attribute name="rdf:RDF"/>
               <dsd:attribute name="rdf:about"/>
               <dsd:attribute name="rdf:parseType"/>
               <dsd:attribute name="rdf:datatype"/>
               <dsd:attribute name="rdf:Description"/>
               <dsd:attribute name="rdf:aboutEach"/>
               <dsd:attribute name="rdf:aboutEachPrefix"/>
               <dsd:attribute name="rdf:bagID"/>
            </dsd:or>
         </dsd:not>
         <dsd:child><dsd:element/></dsd:child>
         <dsd:contents><dsd:string/></dsd:contents>
      </dsd:and>
   </dsd:boolexp>
   
   <dsd:boolexp id="rdf.emptyPropertyElt">
      <m:doc>
         <xhtml:p>This expression defines what is classed as a emptyPropertyElt. It includes
            the possible (no) content but it still has ambiguity problems.</xhtml:p>
      </m:doc>
      <dsd:boolexp ref="rdf.emptyProperty.cond"/>
   </dsd:boolexp>

   <dsd:if><dsd:boolexp ref="rdf.emptyProperty.cond" />
      <dsd:if>
         <dsd:or>
            <dsd:attribute name="rdf:resource"/>
            <dsd:attribute name="rdf:nodeID"/>
         </dsd:or>
         <dsd:require>
            <dsd:one>
               <dsd:attribute name="rdf:resource"/>
               <dsd:attribute name="rdf:nodeID"/>
            </dsd:one>
         </dsd:require>
      </dsd:if>
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* CONTAINERS -*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:if><dsd:boolexp ref="rdf.containerTerms" />
      <m:doc>
         <xhtml:h2>Containers</xhtml:h2>
         <xhtml:p><xhtml:code>rdf:Seq</xhtml:code> and <xhtml:code>rdf:Bag</xhtml:code>
            both contain list items but can be a null list.</xhtml:p>
         <xhtml:p>Note that there is no formal defintion of these elements.</xhtml:p>
      </m:doc>
      <dsd:declare>
         <dsd:contents>
            <dsd:repeat min="0"><dsd:element name="rdf:li"/></dsd:repeat>
         </dsd:contents>
      </dsd:declare>
   </dsd:if>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* STRING TYPES -*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->   
   
   <dsd:stringtype id="rdf-id">
      <m:doc>
         <xhtml:h2>String Types</xhtml:h2>
         <xhtml:p>This needs extending as required</xhtml:p>
      </m:doc>
      <dsd:string/>
   </dsd:stringtype>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:stringtype id="URI-ref">
      <m:doc>
         <xhtml:h2>RDF URI String Type</xhtml:h2>
         <xhtml:p>The <xhtml:a href="http://www.w3.org/TR/rdf-syntax-grammar/" target="RDF">RDF spec</xhtml:a>
            says: "RDF URI references are compatible with the
            <xhtml:a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#anyURI"><xhtml:cite>anyURI</xhtml:cite></xhtml:a>
            datatype as defined by XML schema datatypes
            [<xhtml:a href="#ref-xml-schema2">XML-SCHEMA2</xhtml:a>], constrained to be an
            absolute rather than a relative URI reference."</xhtml:p>
      </m:doc>
      <dsd:stringtype ref="uri.absoluteURI"/>
   </dsd:stringtype>
   
   <!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
   
   <dsd:stringtype id="parse-other">
      <dsd:minus>
         <dsd:string/>
         <dsd:union>
            <dsd:string value="Literal"/>
            <dsd:string value="Resource"/>
            <dsd:string value="Collection"/>
         </dsd:union>
      </dsd:minus>
   </dsd:stringtype>
   
</dsd:dsd>

