-
Notifications
You must be signed in to change notification settings - Fork 0
/
capitains.rng
341 lines (338 loc) · 10.4 KB
/
capitains.rng
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://purl.org/capitains/ns/1.0#"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<!-- je restructurerais bien le schéma en listant les patterns par NS, puis regroupement par ref dans le pattern collection -->
<!-- idem, il faut mieux documenter et inscrire dans le schéma les 2 choix de structuration: élément capitains:collection renseigné OU lien vers fichier de méta -->
<start>
<ref name="collection"/>
</start>
<define name="collection">
<element name="collection">
<choice>
<ref name="local"/>
<ref name="remote"/>
</choice>
</element>
</define>
<define name="local">
<group>
<a:documentation xml:lang="eng">This group is required for completely described collections,
for example root collection of the document.</a:documentation>
<interleave>
<optional>
<ref name="readable"/>
</optional>
<ref name="identifier.el"/>
<oneOrMore>
<ref name="dc.title"/>
</oneOrMore>
<oneOrMore>
<ref name="dc.type"/>
</oneOrMore>
<optional>
<ref name="parent"/>
</optional>
<zeroOrMore>
<ref name="dc.description"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.contributor"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.coverage"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.creator"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.date"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.format"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.identifier"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.publisher"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.relation"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.rights"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.source"/>
</zeroOrMore>
<zeroOrMore>
<ref name="dc.subject"/>
</zeroOrMore>
<optional>
<ref name="members"/>
</optional>
<optional>
<ref name="structured-metadata"/>
</optional>
</interleave>
</group>
</define>
<define name="remote">
<group>
<ref name="identifier.att"/>
<optional>
<ref name="path"></ref>
</optional>
<empty/>
</group>
</define>
<!-- Capitains -->
<!-- factoriser les 2 définitions (el, att) ? -->
<define name="identifier.el">
<element name="identifier">
<a:documentation xml:lang="eng">Identifier of the collection required in the API (CTS URN,
HTTP Address, DOI, ARK, etc.)</a:documentation>
<data type="anyURI"/>
</element>
</define>
<define name="identifier.att">
<attribute name="identifier">
<a:documentation xml:lang="eng">Identifier of the collection if required in an API (CTS URN,
HTTP Address, DOI, ARK, etc.)</a:documentation>
<data type="anyURI"/>
</attribute>
</define>
<define name="parent">
<element name="parent">
<a:documentation xml:lang="eng">Identifier of the parent if required by a parent
collection</a:documentation>
<data type="anyURI"/>
</element>
</define>
<define name="readable">
<a:documentation>Boolean. Optional, false by default. When set to true, the described-document's
content (ie transcription) is readable.</a:documentation>
<choice>
<group>
<attribute name="readable">
<a:documentation>The collection IS readable: the text language(s) MUST be
specified.</a:documentation>
<value type="boolean">true</value>
</attribute>
<ref name="path" />
<oneOrMore>
<ref name="dc.language"/>
</oneOrMore>
</group>
<group>
<attribute name="readable">
<a:documentation>The collection IS NOT readable: the text language(s) can be
specified.</a:documentation>
<choice>
<empty/>
<value type="boolean">false</value>
</choice>
</attribute>
<zeroOrMore>
<ref name="dc.language"/>
</zeroOrMore>
</group>
</choice>
</define>
<define name="members">
<element name="members">
<oneOrMore>
<ref name="collection"/>
</oneOrMore>
</element>
</define>
<define name="path">
<attribute name="path">
<a:documentation xml:lang="eng">Relative address pointing to the metadata or the text
containing xml file.</a:documentation>
<data type="string"/>
</attribute>
</define>
<!-- Dublin Core -->
<define name="dc.title">
<element name="dc:title">
<a:documentation xml:lang="eng">Title of the collection (can be the author name, the work
title, a corpus name, etc.)</a:documentation>
<ref name="lang-att"/>
<data type="string"/>
</element>
</define>
<define name="dc.type">
<element name="dc:type">
<a:documentation xml:lang="eng">Type of the resource. Describes the type of concept this
collection [title?] embodies. </a:documentation>
<data type="anyURI"/>
</element>
</define>
<define name="dc.language">
<element name="dc:language">
<a:documentation xml:lang="eng">Language in which the document is written</a:documentation>
<data type="language"/>
</element>
</define>
<define name="dc.description">
<element name="dc:description">
<a:documentation xml:lang="eng">Description of the collection</a:documentation>
<ref name="lang-att"/>
<text/>
</element>
</define>
<define name="dc.contributor">
<element name="dc:contributor">
<a:documentation xml:lang="eng"> This holds contributor information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.coverage">
<element name="dc:coverage">
<a:documentation xml:lang="eng"> This holds coverage information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.creator">
<element name="dc:creator">
<a:documentation xml:lang="eng"> This holds creator information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.date">
<element name="dc:date">
<a:documentation xml:lang="eng"> This holds date information according to the Dublin
Core Elements ontology </a:documentation>
<choice>
<data type="date"/>
<data type="dateTime"/>
<text/>
</choice>
</element>
</define>
<define name="dc.format">
<element name="dc:format">
<a:documentation xml:lang="eng"> This holds format information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.identifier">
<element name="dc:identifier">
<a:documentation xml:lang="eng"> This holds identifier information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.publisher">
<element name="dc:publisher">
<a:documentation xml:lang="eng"> This holds publisher information according to the
Dublin Core Elements ontology </a:documentation>
<optional>
<ref name="lang-att"/>
</optional>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.relation">
<element name="dc:relation">
<a:documentation xml:lang="eng"> This holds relation information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.rights">
<element name="dc:rights">
<a:documentation xml:lang="eng"> This holds rights information according to the
Dublin Core Elements ontology </a:documentation>
<optional>
<ref name="lang-att"/>
</optional>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.source">
<element name="dc:source">
<a:documentation xml:lang="eng"> This holds hold source information according to the
Dublin Core Elements ontology </a:documentation>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="dc.subject">
<element name="dc:subject">
<a:documentation xml:lang="eng"> This holds hold subject information according to the
Dublin Core Elements ontology </a:documentation>
<optional>
<ref name="lang-att"/>
</optional>
<choice>
<data type="anyURI"/>
<text/>
</choice>
</element>
</define>
<define name="lang-att">
<attribute>
<a:documentation xml:lang="eng">Language in which the current node is
expressed</a:documentation>
<name ns="http://www.w3.org/XML/1998/namespace">lang</name>
<data type="language"/>
</attribute>
</define>
<!-- idée: pattern très générique: ns et datatype, sauf dc et ctp -->
<define name="structured-metadata">
<element>
<a:documentation>Structured metadata contains any other optional metadata that are not part of
DublinCore Elements and CapiTainS namespaces</a:documentation>
<name>structured-metadata</name>
<zeroOrMore>
<element>
<anyName>
<except>
<nsName ns="http://purl.org/dc/elements/1.1/"/>
<nsName ns="http://purl.org/ns/capitains"/>
</except>
</anyName>
<optional>
<ref name="lang-att"/>
</optional>
<text/>
</element>
</zeroOrMore>
</element>
</define>
<!-- -->
</grammar>