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
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.
18 namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
19 datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
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
47 xmllang?, xmlbase?, nodeElementList
53 # Should be something like:
54 # ws* , ( nodeElement , ws* )*
55 # but RELAXNG does this by default, ignoring whitespace separating tags.
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
64 # It is not possible to say "and not things
65 # beginning with _ in the rdf: namespace" in RELAX NG.
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
77 # Should be something like:
78 # ws* , ( propertyElt , ws* )*
79 # but RELAXNG does this by default, ignoring whitespace separating tags.
84 parseTypeLiteralPropertyElt |
85 parseTypeResourcePropertyElt |
86 parseTypeCollectionPropertyElt |
87 parseTypeOtherPropertyElt |
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 |
95 idAttr?, xmllang?, xmlbase?, nodeElement
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 |
103 (idAttr | datatypeAttr )?, xmllang?, xmlbase?, text
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 |
111 idAttr?, parseLiteral, xmllang?, xmlbase?, literal
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 |
119 idAttr?, parseResource, xmllang?, xmlbase?, propertyEltList
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 |
127 idAttr?, xmllang?, xmlbase?, parseCollection, nodeElementList
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 |
135 idAttr?, xmllang?, xmlbase?, parseOther, any
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 |
143 idAttr?, (resourceAttr | nodeIdAttr)?, xmllang?, xmlbase?, propertyAttr*
152 attribute rdf:nodeID {
157 attribute rdf:about {
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 |
171 attribute rdf:resource {
176 attribute rdf:datatype {
181 attribute rdf:parseType {
186 attribute rdf:parseType {
191 attribute rdf:parseType {
196 attribute rdf:parseType {
210 mixed { element * { attribute * { text }*, any }* }