-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtalia_import.xsd
323 lines (300 loc) · 14.5 KB
/
talia_import.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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Schema file for the Hyper Import Format. This format can be used to check the Hyper XML
that will be imported in Talia. The format is quite particular for the Discovery
project; it is based on the original data format of the Hyper software.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
The 'relations' element can be used in almost all sources. Each relation
needs a predicate and an object. The predicate should refer to a predicate
defined in the ontology, and the object should refer to an actual Source
-->
<xs:complexType name="relationsType">
<xs:sequence>
<xs:element name="relation" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="predicate" type="xs:string"/>
<xs:element name="object" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="predicateAndObject">
<xs:selector xpath="."/>
<xs:field xpath="object"/>
<xs:field xpath="predicate"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Special date type, accepts a subset of ISO 8601 without much checking -->
<xs:simpleType name="taliaDate">
<xs:restriction base="xs:string">
<xs:pattern value="\d{4}(-\d{2})?(-\d{2})?(.\d{2}:\d{2}.?)?"/>
</xs:restriction>
</xs:simpleType>
<!--
A 'catalog' element descries a catalog of elements. At the momet it
only accepts one parameter (apart from the siglm:
* position - Gives a position for ordering the catalogs on the site
-->
<xs:complexType name="catalogType">
<xs:sequence>
<xs:element name="siglum" type="xs:string"></xs:element>
<xs:element name="position" type="xs:integer"></xs:element>
</xs:sequence>
</xs:complexType>
<!--
These are the base elements that are common to all sources:
* catalog - The catalog of which this source is part
* siglum - The unique (within this installation) siglum of the source
* title - The title of the surce
* type - Describes the internal type of the source (if any)
* subtype - Describes the internal subtype of the source's type (if any)
-->
<xs:complexType name="sourceType">
<xs:sequence>
<xs:element name="catalog" type="xs:string" minOccurs="0"/>
<xs:element name="siglum" type="xs:string"/>
<xs:element name="title" type="xs:string"/>
<xs:element name="type" type="xs:string" minOccurs="0"/>
<xs:element name="subtype" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!--
A book element usually represents a (physical) book and consist of
sub-elements like chapters and pages.
* coprightNote - String with a text describing the conditions for using this book
* description - A description of the book
* date - Date when the original book was published
* publisher - The person or organisation who published this book
* publishingPlace - The place where this book was published
* ordering - Position of the book within the current collection
* relations - Semantic relations for this Source
-->
<xs:complexType name="bookType">
<xs:complexContent>
<xs:extension base="sourceType">
<xs:sequence>
<xs:element name="copyrightNote" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="date" type="taliaDate" default="0001-01-01"/>
<xs:element name="collocation" type="xs:string"/>
<xs:element name="publisher" type="xs:string"/>
<xs:element name="publishingPlace" type="xs:string"/>
<xs:element name="ordering" type="xs:int"/>
<xs:element name="relations" type="relationsType" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
The author of an element in the database. The author will have a siglum like all
sources, and in addition some business card data. The 'from_date' and 'to_date'
contain the dates between which the author was a member of the current site
(or institution)
-->
<xs:complexType name="authorType">
<xs:sequence>
<xs:element name="siglum" type="xs:string"></xs:element>
<xs:element name="name" type="xs:string"></xs:element>
<xs:element name="surname" type="xs:string"></xs:element>
<xs:element name="status" type="xs:string"></xs:element>
<xs:element name="institution" type="xs:string"></xs:element>
<xs:element name="position" type="xs:string"></xs:element>
<xs:element name="street" type="xs:string"></xs:element>
<xs:element name="zip" type="xs:string"></xs:element>
<xs:element name="city" type="xs:string"></xs:element>
<xs:element name="country" type="xs:string"></xs:element>
<xs:element name="telephone"></xs:element>
<xs:element name="fax" type="xs:string"></xs:element>
<xs:element name="email" type="xs:string"></xs:element>
<xs:element name="webpage" type="xs:string"></xs:element>
<xs:element name="from_date" type="taliaDate" default="0001-01-01"></xs:element>
<xs:element name="to_date" type="taliaDate" default="0001-01-01"></xs:element>
</xs:sequence>
</xs:complexType>
<!--
Type for assigning an author
-->
<xs:complexType name="authorsType">
<xs:sequence>
<xs:element name="author" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!--
A secondary source that was contributed to the current site.
'publishing_date' - The date on which the resource was published online
'publisher' - The person or institution responsible for the publication
'language' - language code for the language of this publication
'alreadyPublished' - Indicates if this element has already been published somewhere eles
'copyrightNote' - The conditions for using this Source
'dimensionsX, dimensionY' - Physical dimensions of the contribution (if applicabele)
'file_size, file_name, ...' - Points to the file contaiining the data
'authors' - List of authors of this resource
-->
<xs:complexType name="contributionType">
<xs:complexContent>
<xs:extension base="sourceType">
<xs:sequence>
<xs:element name="publishing_date" type="taliaDate" default="0001"/>
<xs:element name="publisher" type="xs:string"/>
<xs:element name="language" type="xs:language" />
<xs:element name="alreadyPublished" type="xs:string"/>
<xs:element name="relations" type="relationsType"/>
<xs:element name="copyrightNote" type="xs:string"/>
<xs:element name="subtype" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="dimensionX" type="xs:int" default="0" minOccurs="0"/>
<xs:element name="dimensionY" type="xs:int" default="0" minOccurs="0"/>
<xs:element name="file_size" type="xs:int" default="0"/>
<xs:element name="file_name" type="xs:string"/>
<xs:element name="file_url" type="xs:string"/>
<xs:element name="file_content_type" type="xs:string"/>
<xs:element name="authors" type="authorsType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
A note is a single, coherent, piece of text that appears on a page.
- 'page' - Page on which the note appears
- 'position' - Gives the order in which the positions are sorted
- 'coordinates' - A list of coordinates that describe a polygon on the
site that is the outline of the current not
-->
<xs:complexType name="notesType">
<xs:sequence>
<xs:element name="note" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="page" type="xs:string"/>
<xs:element name="position" type="xs:int"/>
<xs:element name="coordinates" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="notePosition">
<xs:selector xpath="note/position"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<!--
A paragraph is a paragraph of text, that may stretch over several notes
(especially if the paragraph strethes over more than one page. The
pargraph referes all the notes that are part of it.
-->
<xs:complexType name="paragraphType">
<xs:complexContent>
<xs:extension base="sourceType">
<xs:sequence>
<xs:element name="notes" type="notesType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
A page is a direct sub-part of a book. The page must declare the
'isSubPartOf' relation to associate it to a book.
'width, height' - physical dimensions of the page, if aplicable
'position' - Number that gives the page's number in the current book
'position_name' - String that describes the position of the page in the
current book/selection (used for presentation)
-->
<xs:complexType name="pageType">
<xs:complexContent>
<xs:extension base="sourceType">
<xs:sequence>
<xs:element name="width" type="xs:int"/>
<xs:element name="height" type="xs:int"/>
<xs:element name="position" type="xs:int"/>
<xs:element name="position_name" type="xs:string"/>
<xs:element name="relations" type="relationsType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
A chapter is a collection of pages in the same book (an auxialliare construct)
'first_page' - The 'position' of the first page in the book.
'position' - Number to order the existing chapters within the book
'name' - Name of the currrent chapter
'book' - Refers to the siglum of the book which is refereced
-->
<xs:complexType name="chapterType">
<xs:complexContent>
<xs:extension base="sourceType">
<xs:sequence>
<xs:element name="first_page" type="xs:string"/>
<xs:element name="position" type="xs:int"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="book" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
This defines the main list of sources, with each entry
refering to one Source that is imported.
-->
<xs:element name="sources">
<xs:complexType>
<xs:sequence>
<xs:element name="source" maxOccurs="unbounded">
<xs:complexType>
<xs:choice>
<xs:element name="book" type="bookType"/>
<xs:element name="paragraph" type="paragraphType"/>
<xs:element name="page" type="pageType"/>
<xs:element name="facsimile" type="contributionType"/>
<xs:element name="transcription" type="contributionType"/>
<xs:element name="text_reconstruction" type="contributionType"/>
<xs:element name="chapter" type="chapterType"/>
<xs:element name="author" type="authorType"></xs:element>
<xs:element name="catalog" type="catalogType"></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Guruantees that each source has an unique siglum -->
<xs:key name="sourceKey">
<xs:selector xpath="source/*/siglum"/>
<xs:field xpath="."/>
</xs:key>
<!--
WARNING: The keys and constraints defined here will not work in all
cases. This is due to the structure of the format, and how the
XSD Schema can be applied.
If you run into problems, you may want to ignore these constraints.
-->
<!--
Keyref to source siglum.
This needs to be disabled if the data is in multiple files,
since then the references cannot be checked.
(This has been disabled since it doesn't work in all cases, due
to limitations of XSD on the current layout of the schema)
-->
<xs:keyref refer="sourceKey" name="relationTarget">
<xs:selector xpath="source/*/relations/relation/object"></xs:selector>
<xs:field xpath="."></xs:field>
</xs:keyref>
<!-- Ordering of the books -->
<xs:unique name="bookOrder">
<xs:selector xpath="source/book/ordering"/>
<xs:field xpath="."/>
</xs:unique>
<!-- Ordering of the pages -->
<xs:unique name="pageOrder">
<xs:selector xpath="source/page"/>
<xs:field xpath="position"/>
<xs:field xpath="relations/relation/object"></xs:field>
</xs:unique>
<!-- Ordering of the chapters -->
<xs:unique name="chapterOrder">
<xs:selector xpath="source/chapter"/>
<xs:field xpath="position"/>
<xs:field xpath="book"/>
</xs:unique>
</xs:element>
</xs:schema>