Allow 'browse-url-emacs' to fetch URL in the selected window
[emacs.git] / etc / schema / rdfxml.rnc
blob3b9a7f025da12759f8615b107d8ae530b82fef38
1 # RELAX NG Compact Schema for RDF/XML Syntax
3 # Copyright (C) 2001-2008 World Wide Web Consortium, (Massachusetts
4 # Institute of Technology, European Research Consortium for
5 # Informatics and Mathematics, Keio University).  All Rights Reserved.
6 # This work is distributed under the W3C(R) Software License in the
7 # hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8 # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9 # PURPOSE.
11 # This schema is for information only and NON-NORMATIVE
13 # It is based on one originally written by James Clark in
14 # http://lists.w3.org/Archives/Public/www-rdf-comments/2001JulSep/0248.html
15 # and updated with later changes.
17 namespace local = ""
18 namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
19 datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
22 start = doc
25 # I cannot seem to do this in RNGC so they are expanded in-line
27 # coreSyntaxTerms = rdf:RDF | rdf:ID | rdf:about | rdf:parseType | rdf:resource | rdf:nodeID | rdf:datatype
28 # syntaxTerms = coreSyntaxTerms | rdf:Description | rdf:li
29 # oldTerms    = rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID
30 # nodeElementURIs       = * - ( coreSyntaxTerms | rdf:li | oldTerms )
31 # propertyElementURIs   = * - ( coreSyntaxTerms | rdf:Description | oldTerms )
32 # propertyAttributeURIs = * - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms )
34 # Also needed to allow rdf:li on all property element productions
35 # since we can't capture the rdf:li rewriting to rdf_<n> in relaxng
37 # Need to add these explicitly
38 xmllang = attribute xml:lang { text }
39 xmlbase = attribute xml:base { text }
40 # and to forbid every other xml:* attribute, element
42 doc = 
43   RDF
45 RDF =
46   element rdf:RDF { 
47      xmllang?, xmlbase?, nodeElementList
50 nodeElementList = 
51   nodeElement*
53   # Should be something like:
54   #  ws* , (  nodeElement , ws* )*
55   # but RELAXNG does this by default, ignoring whitespace separating tags.
57 nodeElement =
58   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
59                 rdf:resource | rdf:nodeID | rdf:datatype | rdf:li |
60                 rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID ) {
61       (idAttr | nodeIdAttr | aboutAttr )?, xmllang?, xmlbase?, propertyAttr*, propertyEltList
62   }
64   # It is not possible to say "and not things
65   # beginning with _ in the rdf: namespace" in RELAX NG.
67 ws = 
68   " "
70   # Not used in this RELAX NG schema; but should be any legal XML
71   # whitespace defined by http://www.w3.org/TR/2000/REC-xml-20001006#NT-S
74 propertyEltList = 
75   propertyElt*
77   # Should be something like:
78   #  ws* , ( propertyElt , ws* )*
79   # but RELAXNG does this by default, ignoring whitespace separating tags.
81 propertyElt = 
82   resourcePropertyElt | 
83   literalPropertyElt | 
84   parseTypeLiteralPropertyElt |
85   parseTypeResourcePropertyElt |
86   parseTypeCollectionPropertyElt |
87   parseTypeOtherPropertyElt |
88   emptyPropertyElt
90 resourcePropertyElt = 
91   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
92                 rdf:resource | rdf:nodeID | rdf:datatype |
93                 rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
94                 xml:* ) {
95       idAttr?, xmllang?, xmlbase?, nodeElement
96   }
98 literalPropertyElt =
99   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
100                 rdf:resource | rdf:nodeID | rdf:datatype |
101                 rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
102                 xml:* ) {
103       (idAttr | datatypeAttr )?, xmllang?, xmlbase?, text 
104   }
106 parseTypeLiteralPropertyElt = 
107   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
108                 rdf:resource | rdf:nodeID | rdf:datatype |
109                 rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
110                 xml:* ) {
111       idAttr?, parseLiteral, xmllang?, xmlbase?, literal 
112   }
114 parseTypeResourcePropertyElt = 
115   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
116                 rdf:resource | rdf:nodeID | rdf:datatype |
117                 rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
118                 xml:* ) {
119       idAttr?, parseResource, xmllang?, xmlbase?, propertyEltList
120   }
122 parseTypeCollectionPropertyElt = 
123   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
124                 rdf:resource | rdf:nodeID | rdf:datatype |
125                 rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
126                 xml:* ) {
127       idAttr?, xmllang?, xmlbase?, parseCollection, nodeElementList
128   }
130 parseTypeOtherPropertyElt = 
131   element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
132                 rdf:resource | rdf:nodeID | rdf:datatype |
133                 rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
134                 xml:* ) {
135       idAttr?, xmllang?, xmlbase?, parseOther, any
136   }
138 emptyPropertyElt =
139    element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
140                  rdf:resource | rdf:nodeID | rdf:datatype |
141                  rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
142                  xml:* ) {
143        idAttr?, (resourceAttr | nodeIdAttr)?, xmllang?, xmlbase?, propertyAttr*
144    }
146 idAttr = 
147   attribute rdf:ID { 
148       IDsymbol 
149   }
151 nodeIdAttr = 
152   attribute rdf:nodeID { 
153       IDsymbol 
154   }
156 aboutAttr = 
157   attribute rdf:about { 
158       URI-reference 
159   }
161 propertyAttr = 
162   attribute * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
163                   rdf:resource | rdf:nodeID | rdf:datatype | rdf:li |
164                   rdf:Description | rdf:aboutEach |
165                   rdf:aboutEachPrefix | rdf:bagID |
166                   xml:* ) {
167       string
168   }
170 resourceAttr = 
171   attribute rdf:resource {
172       URI-reference 
173   }
175 datatypeAttr = 
176   attribute rdf:datatype {
177       URI-reference 
178   }
180 parseLiteral = 
181   attribute rdf:parseType {
182       "Literal" 
183   }
185 parseResource = 
186   attribute rdf:parseType {
187       "Resource"
188   }
190 parseCollection = 
191   attribute rdf:parseType {
192       "Collection"
193   }
195 parseOther = 
196   attribute rdf:parseType {
197       text
198   }
200 URI-reference = 
201   string
203 literal =
204   any
206 IDsymbol = 
207   xsd:NMTOKEN
209 any =
210   mixed { element * { attribute * { text }*, any }* }