/
metadata.xsd
753 lines (753 loc) · 32.6 KB
/
metadata.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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
<?xml version="1.0" encoding="utf-8"?>
<!-- ===================================================================
XML schema for meta data of the SIARD Format 2.2
Application: Software-Independent Archival of Relational Databases
Platform : XML 1.0, XML Schema 2001
Description: This XML schema definition defines the structure of the meta data in the SIARD format 2.2.
==============================================================================================
Copyright : 2007, 2014, 2018, Swiss Federal Archives, Berne, Switzerland, 2021 DILCIS and SFA
============================================================================================== -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.bar.admin.ch/xmlns/siard/2/metadata.xsd" targetNamespace="http://www.bar.admin.ch/xmlns/siard/2/metadata.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.2.1.7" id="metadata">
<!-- root element of an XML file conforming to this XML schema -->
<xs:element name="siardArchive">
<xs:complexType>
<xs:annotation>
<xs:documentation>Root element of meta data of the SIARD archive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- name of the archived database -->
<xs:element name="dbname" type="mandatoryString"/>
<!-- short free form description of the database content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
<!-- name of person responsible for archiving the database -->
<xs:element name="archiver" type="xs:string" minOccurs="0"/>
<!-- contact data (telephone number or email address) of archiver -->
<xs:element name="archiverContact" type="xs:string" minOccurs="0"/>
<!-- name of data owner (section and institution responsible for data)
of database when it was archived -->
<xs:element name="dataOwner" type="mandatoryString"/>
<!-- time span during which data where entered into the database -->
<xs:element name="dataOriginTimespan" type="mandatoryString"/>
<!-- root folder for external files -->
<xs:element name="lobFolder" type="xs:anyURI" minOccurs="0"/>
<!-- name and version of program that generated the metadata file -->
<xs:element name="producerApplication" type="xs:string" minOccurs="0"/>
<!-- date of creation of archive (automatically generated by SIARD) -->
<xs:element name="archivalDate" type="xs:date"/>
<!-- message digest codes over all primary data in folder "content" -->
<xs:element name="messageDigest" type="messageDigestType" minOccurs="0" maxOccurs="unbounded"/>
<!-- DNS name of client machine from which connection to the database was established for archiving -->
<xs:element name="clientMachine" type="xs:string" minOccurs="0"/>
<!-- name of database product and version from which database originates -->
<xs:element name="databaseProduct" type="xs:string" minOccurs="0"/>
<!-- connection string (JDBC URL) used for archiving -->
<xs:element name="connection" type="xs:string" minOccurs="0"/>
<!-- database user used for archiving -->
<xs:element name="databaseUser" type="xs:string" minOccurs="0"/>
<!-- list of schemas in database -->
<xs:element name="schemas" type="schemasType"/>
<!-- list of users in the archived database -->
<xs:element name="users" type="usersType"/>
<!-- list of roles in the archived database -->
<xs:element name="roles" type="rolesType" minOccurs="0"/>
<!-- list of privileges in the archived database -->
<xs:element name="privileges" type="privilegesType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="version" type="versionType" use="required"/>
<!-- constraint: version number with release -->
</xs:complexType>
</xs:element>
<!-- complex type schemas -->
<xs:complexType name="schemasType">
<xs:annotation>
<xs:documentation>List of schemas</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="schema" type="schemaType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type schema -->
<xs:complexType name="schemaType">
<xs:annotation>
<xs:documentation>Schema element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the schema -->
<xs:element name="name" type="xs:string"/>
<!-- archive name of the schema folder -->
<xs:element name="folder" type="fsName"/>
<!-- description of the schema's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
<!-- list of advanced and structured types in the schema -->
<xs:element name="types" type="typesType" minOccurs="0"/>
<!-- list of tables in the schema -->
<xs:element name="tables" type="tablesType" minOccurs="0"/>
<!-- list of views in the schema -->
<xs:element name="views" type="viewsType" minOccurs="0"/>
<!-- list of routines in the schema -->
<xs:element name="routines" type="routinesType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type types -->
<xs:complexType name="typesType">
<xs:annotation>
<xs:documentation>List of advanced or structured data types types</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="type" type="typeType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type type -->
<xs:complexType name="typeType">
<xs:annotation>
<xs:documentation>Advanced or structured data tape type</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- name of data type -->
<xs:element name="name" type="xs:string"/>
<!-- category of data type -->
<xs:element name="category" type="categoryType"/>
<!-- schema of supertype -->
<xs:element name="underSchema" type="xs:string" minOccurs="0"/>
<!-- name of supertype -->
<xs:element name="underType" type="xs:string" minOccurs="0"/>
<!-- instantiability if data type (never true for DISTINCT) -->
<xs:element name="instantiable" type="xs:boolean"/>
<!-- finality (always true for DISTINCT, never true for structured UDTs) -->
<xs:element name="final" type="xs:boolean"/>
<!-- predefined base SQL:2008 type of (DISTINCT) type -->
<xs:element name="base" type="predefinedTypeType" minOccurs="0"/>
<!-- alternatively list of attributes (UDT) -->
<xs:element name="attributes" type="attributesType" minOccurs="0"/>
<!-- description of the parameter's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type attributes -->
<xs:complexType name="attributesType">
<xs:annotation>
<xs:documentation>List of attributes of a type</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="attribute" type="attributeType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type attribute -->
<xs:complexType name="attributeType">
<xs:annotation>
<xs:documentation>Attribute of a type</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the attribute -->
<xs:element name="name" type="xs:string"/>
<xs:choice>
<!-- either predefined or structured -->
<xs:sequence>
<!-- SQL:2008 data type of the column -->
<xs:element name="type" type="predefinedTypeType"/>
</xs:sequence>
<xs:sequence>
<!-- SQL:2008 schema of advanced or structured data type of the attribute -->
<xs:element name="typeSchema" type="xs:string" minOccurs="0"/>
<!-- SQL:2008 name of advanced or structured data type of the attribute -->
<xs:element name="typeName" type="xs:string"/>
</xs:sequence>
</xs:choice>
<!-- original data type of the column -->
<xs:element name="typeOriginal" type="xs:string" minOccurs="0"/>
<!-- nullability (default: true) -->
<xs:element name="nullable" type="xs:boolean" minOccurs="0"/>
<!-- default value -->
<xs:element name="defaultValue" type="xs:string" minOccurs="0"/>
<!-- SQL_1999 cardinality for ARRAY type -->
<xs:element name="cardinality" type="xs:integer" minOccurs="0"/>
<!-- description of the attributes's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type tables -->
<xs:complexType name="tablesType">
<xs:annotation>
<xs:documentation>List of tables</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="table" type="tableType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type table -->
<xs:complexType name="tableType">
<xs:annotation>
<xs:documentation>Table element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the table -->
<xs:element name="name" type="xs:string"/>
<!-- archive name of the table folder -->
<xs:element name="folder" type="fsName"/>
<!-- description of the table's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
<!-- list of columns of the table -->
<xs:element name="columns" type="columnsType"/>
<!-- primary key -->
<xs:element name="primaryKey" type="uniqueKeyType" minOccurs="0"/>
<!-- foreign keys -->
<xs:element name="foreignKeys" type="foreignKeysType" minOccurs="0"/>
<!-- candidate keys (unique constraints) -->
<xs:element name="candidateKeys" type="candidateKeysType" minOccurs="0"/>
<!-- list of (check) constraints -->
<xs:element name="checkConstraints" type="checkConstraintsType" minOccurs="0"/>
<!-- list of triggers -->
<xs:element name="triggers" type="triggersType" minOccurs="0"/>
<!-- number of rows in the table -->
<xs:element name="rows" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<!-- complex type views -->
<xs:complexType name="viewsType">
<xs:annotation>
<xs:documentation>List of views</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="view" type="viewType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type view -->
<xs:complexType name="viewType">
<xs:annotation>
<xs:documentation>View element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the view -->
<xs:element name="name" type="xs:string"/>
<!-- SQL query string defining the view -->
<xs:element name="query" type="xs:string" minOccurs="0"/>
<!-- original query string defining the view -->
<xs:element name="queryOriginal" type="xs:string" minOccurs="0"/>
<!-- description of the view's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
<!-- list of columns of the view -->
<xs:element name="columns" type="columnsType"/>
<!-- number of rows in the view - added in 2014! -->
<xs:element name="rows" type="xs:integer" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type columns -->
<xs:complexType name="columnsType">
<xs:annotation>
<xs:documentation>List of columns</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="column" type="columnType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type column -->
<xs:complexType name="columnType">
<xs:annotation>
<xs:documentation>Column element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the column -->
<xs:element name="name" type="xs:string"/>
<!-- folder for LOBs relative to lobFolder of nearest containing
element for internally or externally stored LOBs -->
<xs:element name="lobFolder" type="xs:anyURI" minOccurs="0"/>
<xs:choice>
<!-- either predefined or structured -->
<xs:sequence>
<!-- SQL:2008 predefined data type of the column -->
<xs:element name="type" type="predefinedTypeType"/>
<!-- mimeType makes sense only for LOBs and is only informatory -->
<xs:element name="mimeType" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:sequence>
<!-- SQL:2008 schema of UDT name of the column -->
<xs:element name="typeSchema" type="xs:string" minOccurs="0"/>
<!-- SQL:2008 name of UDT of the column -->
<xs:element name="typeName" type="xs:string"/>
</xs:sequence>
</xs:choice>
<!-- original data type of the column -->
<xs:element name="typeOriginal" type="xs:string" minOccurs="0"/>
<!-- SQL:2008 attribute list of the column -->
<xs:element name="fields" type="fieldsType" minOccurs="0"/>
<!-- nullability (default: true) -->
<xs:element name="nullable" type="xs:boolean" minOccurs="0"/>
<!-- default value -->
<xs:element name="defaultValue" type="xs:string" minOccurs="0"/>
<!-- SQL_1999 cardinality for ARRAY type -->
<xs:element name="cardinality" type="xs:integer" minOccurs="0"/>
<!-- unique, references, check column constraints
are stored as table constraints -->
<!-- description of the column's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type fields -->
<xs:complexType name="fieldsType">
<xs:annotation>
<xs:documentation>List of fields of a column or field</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="field" type="fieldType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type for type of a column or a field -->
<xs:complexType name="fieldType">
<xs:annotation>
<xs:documentation>Field element describing the type of a field</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- attribute name or array element position (1-based) -->
<xs:element name="name" type="xs:string"/>
<!-- folder for LOBs relative to lobFolder of nearest containing
element for internally or externally stored LOBs -->
<xs:element name="lobFolder" type="xs:anyURI" minOccurs="0"/>
<!-- SQL:2008 sub field list of the field -->
<xs:element name="fields" type="fieldsType" minOccurs="0"/>
<!-- mimeType makes sense only for LOBs and is only informatory-->
<xs:element name="mimeType" type="xs:string" minOccurs="0"/>
<!-- description of the field's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type foreignKeys -->
<xs:complexType name="foreignKeysType">
<xs:annotation>
<xs:documentation>List of foreign key constraints</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="foreignKey" type="foreignKeyType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type foreignKey -->
<xs:complexType name="foreignKeyType">
<xs:annotation>
<xs:documentation>foreignKey element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the foreign key -->
<xs:element name="name" type="xs:string"/>
<!-- referenced schema -->
<xs:element name="referencedSchema" type="xs:string"/>
<!-- referenced table -->
<xs:element name="referencedTable" type="xs:string"/>
<!-- references -->
<xs:element name="reference" type="referenceType" maxOccurs="unbounded"/>
<!-- match type (FULL, PARTIAL, SIMPLE) -->
<xs:element name="matchType" type="matchTypeType" minOccurs="0"/>
<!-- ON DELETE action e.g. ON DELETE CASCADE -->
<xs:element name="deleteAction" type="referentialActionType" minOccurs="0"/>
<!-- ON UPDATE action e.g. ON UPDATE SET DEFAULT -->
<xs:element name="updateAction" type="referentialActionType" minOccurs="0"/>
<!-- description of the foreign key's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type reference -->
<xs:complexType name="referenceType">
<xs:annotation>
<xs:documentation>reference element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- referencing column -->
<xs:element name="column" type="xs:string"/>
<!-- referenced column (table.column) -->
<xs:element name="referenced" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<!-- complex type candidateKeys -->
<xs:complexType name="candidateKeysType">
<xs:annotation>
<xs:documentation>List of candidate key (unique) constraints</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="candidateKey" type="uniqueKeyType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type uniqueKey -->
<xs:complexType name="uniqueKeyType">
<xs:annotation>
<xs:documentation>unique (primary or candidate) key element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the unique key -->
<xs:element name="name" type="xs:string"/>
<!-- description of the unique key's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
<!-- columns belonging to the unique key -->
<xs:element name="column" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type check constraints -->
<xs:complexType name="checkConstraintsType">
<xs:annotation>
<xs:documentation>List of check constraints</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="checkConstraint" type="checkConstraintType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type check constraint -->
<xs:complexType name="checkConstraintType">
<xs:annotation>
<xs:documentation>Check constraint element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the constraint -->
<xs:element name="name" type="xs:string"/>
<!-- check condition -->
<xs:element name="condition" type="xs:string"/>
<!-- description of the constraint's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type triggers -->
<xs:complexType name="triggersType">
<xs:annotation>
<xs:documentation>List of triggers</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="trigger" type="triggerType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type trigger -->
<xs:complexType name="triggerType">
<xs:annotation>
<xs:documentation>Trigger element in siardArchive</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- database name of the trigger -->
<xs:element name="name" type="xs:string"/>
<!-- action time BEFORE, AFTER or INSTEAD OF -->
<xs:element name="actionTime" type="actionTimeType"/>
<!-- trigger event INSERT, DELETE, UPDATE [OF <trigger column list>] -->
<xs:element name="triggerEvent" type="xs:string"/>
<!-- alias list <old or new values alias> -->
<xs:element name="aliasList" type="xs:string" minOccurs="0"/>
<!-- triggered action -->
<xs:element name="triggeredAction" type="xs:string"/>
<!-- description of the trigger's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type routines -->
<xs:complexType name="routinesType">
<xs:annotation>
<xs:documentation>List of routines</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="routine" type="routineType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type routine -->
<xs:complexType name="routineType">
<xs:annotation>
<xs:documentation>Routine</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- specific (unique) name of routine in schema -->
<xs:element name="specificName" type="xs:string"/>
<!-- database (possible overloaded) name of routine in schema -->
<xs:element name="name" type="xs:string"/>
<!-- description of the routines's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
<!-- original source code (VBA, PL/SQL, ...) defining the routine -->
<xs:element name="source" type="xs:string" minOccurs="0"/>
<!-- SQL:2008 body of routine -->
<xs:element name="body" type="xs:string" minOccurs="0"/>
<!-- routine characteristic -->
<xs:element name="characteristic" type="xs:string" minOccurs="0"/>
<!-- SQL:2008 data type of the return value (for functions) -->
<xs:element name="returnType" type="xs:string" minOccurs="0"/>
<!-- list of parameters -->
<xs:element name="parameters" type="parametersType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type parameters -->
<xs:complexType name="parametersType">
<xs:annotation>
<xs:documentation>List of parameters of a routine</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="parameter" type="parameterType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type parameter -->
<xs:complexType name="parameterType">
<xs:annotation>
<xs:documentation>Parameter of a routine</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- name of parameter -->
<xs:element name="name" type="xs:string"/>
<!-- mode of parameter (IN, OUT, INOUT) -->
<xs:element name="mode" type="xs:string"/>
<xs:choice>
<!-- either predefined or structured -->
<xs:sequence>
<!-- SQL:2008 data type of the column -->
<xs:element name="type" type="predefinedTypeType"/>
</xs:sequence>
<xs:sequence>
<!-- SQL:2008 schema of UDT name of the column -->
<xs:element name="typeSchema" type="xs:string" minOccurs="0"/>
<!-- SQL:2008 name of UDT of the column -->
<xs:element name="typeName" type="xs:string"/>
</xs:sequence>
</xs:choice>
<!-- original data type of the column -->
<xs:element name="typeOriginal" type="xs:string" minOccurs="0"/>
<!-- SQL_1999 cardinality for ARRAY type -->
<xs:element name="cardinality" type="xs:integer" minOccurs="0"/>
<!-- description of the parameter's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type users -->
<xs:complexType name="usersType">
<xs:annotation>
<xs:documentation>List of users</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="user" type="userType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type user -->
<xs:complexType name="userType">
<xs:annotation>
<xs:documentation>User</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- user name -->
<xs:element name="name" type="xs:string"/>
<!-- description of the user's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type roles -->
<xs:complexType name="rolesType">
<xs:annotation>
<xs:documentation>List of roles</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="role" type="roleType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type role -->
<xs:complexType name="roleType">
<xs:annotation>
<xs:documentation>Role</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- role name -->
<xs:element name="name" type="xs:string"/>
<!-- role ADMIN (user or role) -->
<xs:element name="admin" type="xs:string"/>
<!-- description of the role's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type privileges -->
<xs:complexType name="privilegesType">
<xs:annotation>
<xs:documentation>List of grants</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="privilege" type="privilegeType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- complex type privilege -->
<xs:complexType name="privilegeType">
<xs:annotation>
<xs:documentation>Grant (incl. grant of role)</xs:documentation>
</xs:annotation>
<xs:sequence>
<!-- privilege type (incl. ROLE privilege or "ALL PRIVILEGES" -->
<xs:element name="type" type="xs:string"/>
<!-- privilege object (may be omitted for ROLE privilege) -->
<xs:element name="object" type="xs:string" minOccurs="0"/>
<!-- GRANTED BY -->
<xs:element name="grantor" type="xs:string"/>
<!-- user list of users or roles or single value "PUBLIC" -->
<xs:element name="grantee" type="xs:string"/>
<!-- optional option "GRANT" or "ADMIN" -->
<xs:element name="option" type="privOptionType" minOccurs="0"/>
<!-- description of the grant's meaning and content -->
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- complex type for messageDigest with separate algorithm field -->
<xs:complexType name="messageDigestType">
<xs:annotation>
<xs:documentation>Message digests with algorithm ("MD5", "SHA-1" or "SHA-256") and hexadecimal or - for the SHA variants - Base64 code.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="digestType" type="digestTypeType"/>
<xs:element name="digest" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<!-- simple type fpr predefined SQL:2008 types -->
<xs:simpleType name="predefinedTypeType">
<xs:annotation>
<xs:documentation>predefinedTypeType is constrained to valid SQL:2008 data type values</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="INTEGER|INT|SMALLINT|BIGINT"/>
<xs:pattern value="(NUMERIC|DECIMAL|DEC)(\s*\(\s*[1-9]\d*\s*(,\s*\d+\s*)?\))?"/>
<xs:pattern value="REAL|DOUBLE PRECISION"/>
<xs:pattern value="FLOAT(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(CHARACTER|CHAR)(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(CHARACTER\s+VARYING|CHAR\s+VARYING|VARCHAR)(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(CHARACTER\s+LARGE\s+OBJECT|CLOB)(\s*\(\s*[1-9]\d*(\s*(K|M|G))?\s*\))?"/>
<xs:pattern value="(NATIONAL\s+CHARACTER|NATIONAL\s+CHAR|NCHAR)(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(NATIONAL\s+CHARACTER\s+VARYING|NATIONAL\s+CHAR\s+VARYING|NCHAR VARYING)(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(NATIONAL\s+CHARACTER\s+LARGE\s+OBJECT|NCHAR\s+LARGE\s+OBJECT|NCLOB)(\s*\(\s*[1-9]\d*(\s*(K|M|G))?\s*\))?"/>
<xs:pattern value="XML"/>
<xs:pattern value="BINARY(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(BINARY\s+VARYING|VARBINARY)(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(BINARY\s+LARGE\s+OBJECT|BLOB)(\s*\(\s*[1-9]\d*(\s*(K|M|G))?\s*\))?"/>
<xs:pattern value="DATE"/>
<xs:pattern value="(TIME|TIME\s+WITH\s+TIME\s+ZONE)(\s*\(\s*[1-9]\d*\s*\))?"/>
<xs:pattern value="(TIMESTAMP|TIMESTAMP\s+WITH\s+TIME\s+ZONE)(\s*\(\s*(0|([1-9]\d*))\s*\))?"/>
<xs:pattern value="INTERVAL\s+(((YEAR|MONTH|DAY|HOUR|MINUTE)(\s*\(\s*[1-9]\d*\s*\))?(\s+TO\s+(MONTH|DAY|HOUR|MINUTE|SECOND)(\s*\(\s*[1-9]\d*\s*\))?)?)|(SECOND(\s*\(\s*[1-9]\d*\s*(,\s*\d+\s*)?\))?))"/>
<xs:pattern value="BOOLEAN"/>
<xs:pattern value="DATALINK"/>
<!-- exact numerics (BIGINT from SQL:2008) -->
<!-- approximate numerics -->
<!-- character strings -->
<!-- BINARY strings from SQL:2008 -->
<!-- datetimes -->
<!-- BOOLEAN -->
<!-- DATALINK - from SQL:2008, part 9, SQL/MED -->
</xs:restriction>
</xs:simpleType>
<!-- type for message digest type -->
<xs:simpleType name="digestTypeType">
<xs:restriction base="xs:string">
<xs:whiteSpace value="collapse"/>
<xs:enumeration value="MD5"/>
<xs:enumeration value="SHA-1"/>
<xs:enumeration value="SHA-256"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for version number -->
<xs:simpleType name="versionType">
<xs:annotation>
<xs:documentation>versionType is constrained to "2.2" for conformity with this XML schema</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:whiteSpace value="collapse"/>
<xs:enumeration value="2.2"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for privilege option -->
<xs:simpleType name="privOptionType">
<xs:annotation>
<xs:documentation>privOptionType must be "ADMIN" or "GRANT"</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:whiteSpace value="collapse"/>
<xs:enumeration value="ADMIN"/>
<xs:enumeration value="GRANT"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for mandatory string
which must contain at least 1 character -->
<xs:simpleType name="mandatoryString">
<xs:annotation>
<xs:documentation>mandatoryString must contain at least 1 character</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type of a filesystem (file or folder) name -->
<xs:simpleType name="fsName">
<xs:annotation>
<xs:documentation>fsNames may only consist of ASCII characters and digits and must start with a non-digit</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:pattern value="([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]).*"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for action time of a trigger -->
<xs:simpleType name="actionTimeType">
<xs:annotation>
<xs:documentation>actionTime is BEFORE or AFTER</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="BEFORE"/>
<xs:enumeration value="INSTEAD OF"/>
<xs:enumeration value="AFTER"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for match type of a foreign key -->
<xs:simpleType name="matchTypeType">
<xs:annotation>
<xs:documentation>matchType is FULL, PARTIAL or SIMPLE</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="FULL"/>
<xs:enumeration value="PARTIAL"/>
<xs:enumeration value="SIMPLE"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for referential action of a foreign key -->
<xs:simpleType name="referentialActionType">
<xs:annotation>
<xs:documentation>referential action is CASCADE, SET NULL, SET DEFAULT, RESTRICT, or NO ACTION</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="CASCADE"/>
<xs:enumeration value="SET NULL"/>
<xs:enumeration value="SET DEFAULT"/>
<xs:enumeration value="RESTRICT"/>
<xs:enumeration value="NO ACTION"/>
</xs:restriction>
</xs:simpleType>
<!-- simple type for the category of a column or a parameter -->
<xs:simpleType name="categoryType">
<xs:annotation>
<xs:documentation>category of advanced or structured data types is "distinct" or "udt" for conformity with this XML schema</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:whiteSpace value="collapse"/>
<xs:enumeration value="distinct"/>
<xs:enumeration value="udt"/>
</xs:restriction>
</xs:simpleType>
<!-- complex type for the character large object - to be used in table[n].xsd - T_6.2-1 -->
<xs:complexType name="clobType">
<xs:annotation>
<xs:documentation source="T_6.2-1" xml:lang="en">a character large object can either be stored inline or as a file internally or externally.
The length is in characters, not in bytes.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="file" type="xs:anyURI"/>
<xs:attribute name="length" type="xs:integer"/>
<xs:attribute name="digestType" type="digestTypeType"/>
<xs:attribute name="digest" type="xs:string"/>
<xs:attribute name="dlurlpathonly" type="xs:anyURI" /> <!-- applies only to external LOBs -->
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- complex type for the binary large object - to be used in table[n].xsd -->
<xs:complexType name="blobType">
<xs:annotation>
<xs:documentation source="T_6.2-1" xml:lang="en">a binary large object can either be stored inline or as a file internally or externally.
The length is in bytes.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:hexBinary">
<xs:attribute name="file" type="xs:anyURI"/>
<xs:attribute name="length" type="xs:integer"/>
<xs:attribute name="digestType" type="digestTypeType"/>
<xs:attribute name="digest" type="xs:string"/>
<xs:attribute name="dlurlpathonly" type="xs:anyURI"/> <!-- applies only to external LOBs -->
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>