-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrdf.xsd
262 lines (212 loc) · 7.59 KB
/
rdf.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml:base="http://www.w3.org/1999/02/22-rdf-syntax-ns"
>
<xs:annotation>
<xs:documentation>
<div xmlns="http://www.w3.org/1999/xhtml">
<h1>XML Schema for RDF</h1>
<p>$Id: rdf.xsd,v 1.17 2000/08/04 14:37:44 swick Exp $</p>
<p>originally derived from <a
href="http://www.oasis-open.org/cover/xmlSchemaForRDF.html">Rick J's
work</a>:
</p>
<pre>
From: Rick JELLIFFE <ricko@allette.com.au>
To: xml-dev@xml.org
Subject: Re: new public working draft of XML Schema
Date: Sat, 26 Feb 2000 23:05:20 +0800
</pre>
<p>then modified to match
<a href="http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/#grammar">the RDF formal grammar</a></p>
<blockquote>
<p>created 2000-12-25, <br />
Rick Jelliffe,
<br />
Academia Sinica Computing Centre. <br />
Thanks to Henry Thompson for help. </p>
<p>RDF Specification at
<a href="http://www.w3.org/TR">W3C</a>.
</p>
</blockquote>
<p>Later, taken from http://www.w3.org/2001/XMLSchema and updated</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:attribute name="datatype" type="xs:string" />
<!-- Top-level of RDF Document -->
<xs:element name="RDF">
<xs:complexType>
<xs:sequence maxOccurs="unbounded" >
<xs:group ref="obj"/> <!-- abstract -->
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="obj">
<xs:choice>
<xs:element ref="typedNode"/>
<xs:group ref="container"/>
</xs:choice>
</xs:group>
<!-- @@check this after doing typednode -->
<xs:element name="Description"
type="typedNodeType" />
<xs:group name="container">
<!-- @@ spec says you can subclass this, but that
makes parsing depend on schema info. Bad. -->
<xs:choice>
<xs:element ref="Bag"/>
<xs:element ref="Seq"/>
<xs:element ref="Alt"/>
</xs:choice>
</xs:group>
<xs:attributeGroup name="idAboutAttrOpt">
<xs:annotation><xs:documentation source="http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/#aboutAttr"/></xs:annotation>
<xs:attributeGroup ref="aboutAttrOpt"/>
<xs:attributeGroup ref="idAttrOpt"/>
<!-- @@leave out aboutEachAttr for now -->
</xs:attributeGroup>
<xs:attribute name="ID" type="xs:ID" />
<!--
-->
<xs:attributeGroup name="idAttrOpt">
<xs:attribute ref="ID" use='optional'/>
</xs:attributeGroup>
<xs:attribute name="about" type="xs:anyURI" />
<xs:attributeGroup name="aboutAttrOpt">
<xs:attribute name="about" use='optional' type="xs:anyURI" />
<xs:attribute ref="about" use='optional' />
</xs:attributeGroup>
<!-- leaving out aboutEachAttr for now @@-->
<!-- leaving out bagIdAttr @@-->
<!-- leaving out propAttr @@-->
<!-- leaving out typeAttr @@-->
<xs:element name="propertyElt" abstract="true"
type="propertyEltType" />
<xs:complexType name="propertyEltType">
<xs:annotation>
<xs:documentation>this is a "union type"; use
xsi:type in the instance to discriminate between concrete subtypes
</xs:documentation>
</xs:annotation>
</xs:complexType>
<xs:complexType name="propertyEltValue">
<xs:attributeGroup ref="idAttrOpt"/>
</xs:complexType>
<xs:complexType name="propertyEltLiteral">
<xs:sequence>
<xs:any minOccurs="0" processContents="skip"/>
</xs:sequence>
<xs:attributeGroup ref="idAttrOpt"/>
<!--
TODO cxsd complains if I don't comment this out:
"Member with multiple types: parseType"
<xs:attributeGroup ref="parseLiteral"/>
-->
</xs:complexType>
<xs:complexType name="propertyEltResource">
<xs:sequence maxOccurs="unbounded" >
<xs:element ref="propertyElt" /><!--abstract !-->
</xs:sequence>
</xs:complexType>
<xs:complexType name="propertyEltRef">
<xs:attributeGroup ref="idRefAttrOpt"/>
<!-- @@leaving out bagIdAttr? -->
<!-- @@leaving out propAttr* -->
</xs:complexType>
<xs:element name="typedNode" abstract="true"
type="typedNodeType"/>
<xs:complexType name="typedNodeType">
<xs:sequence maxOccurs="unbounded">
<xs:element ref="propertyElt"/>
</xs:sequence>
<xs:attributeGroup ref="idAboutAttrOpt"/>
<!--@@leaving out bagidattr, propattr -->
</xs:complexType>
<xs:attributeGroup name="idRefAttrOpt">
<xs:attributeGroup ref="idAttrOpt"/>
<xs:attributeGroup ref="resourceAttrOpt"/>
</xs:attributeGroup>
<!--@@ can complex types be abstract? or just elements? -->
<xs:complexType name="value" abstract="true"/>
<xs:complexType name="valueObj">
<xs:group ref="obj"/>
</xs:complexType>
<xs:complexType name="valueString">
<xs:sequence/> <!-- no subelements -->
</xs:complexType>
<xs:attribute name="resource" type="xs:anyURI" />
<xs:attributeGroup name="resourceAttrOpt">
<xs:attribute name="resource" use='optional' type="xs:anyURI" />
<xs:attribute ref="resource" use='optional' />
</xs:attributeGroup>
<xs:attributeGroup name="resourceAttr">
<!-- @@er... which one to require? -->
<xs:attribute name="resource" use='optional' type="xs:anyURI" />
<xs:attribute ref="resource" use='optional' />
</xs:attributeGroup>
<xs:element name="Seq" type="members"/>
<xs:element name="Bag" type="members"/>
<xs:element name="Alt" type="members"/>
<!-- @@restrict Alt to have at least one member -->
<xs:complexType name="members">
<xs:sequence maxOccurs="unbounded">
<xs:element name="li" type="item"/>
</xs:sequence>
<xs:attributeGroup ref="idAttrOpt"/>
<!-- @@leaving out memberAttr* -->
</xs:complexType>
<xs:complexType name="item">
<xs:annotation>
<xs:documentation>this is a "union type"; use
xsi:type in the instance to discriminate between concrete subtypes.
@@hmm... can I mark this as "abstract" somehow?
</xs:documentation>
</xs:annotation>
</xs:complexType>
<xs:complexType name="referencedItem">
<xs:attributeGroup ref="resourceAttr"/>
</xs:complexType>
<!-- @@strictly speaking, inlineItem should be
specified as subtypes, one of propertyEltValue,
propertyEltLiteral, and propertyEltResource,
with use="prohibited" on some attributes to
get rid of them. But I'm gonna skip it for now -->
<!--
<xs:attribute name="parseType"/>
-->
<xs:attributeGroup name="parseLiteral">
<xs:attribute name="parseType" fixed="Literal" />
<!--
<xs:attribute ref="parseType" fixed="Literal" />
-->
</xs:attributeGroup>
<xs:attributeGroup name="parseResource">
<xs:attribute name="parseType" fixed="Resource" />
<!--
<xs:attribute ref="parseType" fixed="Resource" />
-->
</xs:attributeGroup>
<!-- so much for syntax structure. Now for the particular
properties and classes... -->
<xs:element name="Statement"
type="typedNodeType" />
<xs:element name="Property"
type="typedNodeType" />
<!-- these are is constrained to use resource="...";
use xsi:type to do something else -->
<xs:element name="subject"
type="propertyEltRef" />
<xs:element name="predicate"
type="propertyEltRef" />
<xs:element name="object"
type="propertyEltRef" />
<xs:element name="type"
type="propertyEltRef" />
<!-- constrained to the <value>...</value> syntax -->
<xs:element name="value"
type="valueString" />
</xs:schema>