/
jmeng-WCDB2.xsd.xml
359 lines (314 loc) · 14.2 KB
/
jmeng-WCDB2.xsd.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- Root Element -->
<xsd:element name="WorldCrises">
<!-- Unlimited number of sub-elements in the sequence of Crisis, Organization, Person,
CrisisKind, OrganizationKind and PersonKind. To enforce integrity, one must define
first CrisisKind/OrganizationKind/PersonKind in separate elements, then refer to
them in Crisis/Organization/Person via key/keyref. -->
<!-- Although not enfored, here is a guideline for IDs:
personIdent: first and middle initials and full last name (ex: George Walker Bush => GWBush)
crisisIdent: first letter abbreviation followed by year (ex: 2011 Tornado Outbreak => TO2011)
organizationIdent: Initials or entire name if only one word. (ex: CIA, NATO, AFRICARE)
-->
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Crisis" type="CrisisType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="Organization" type="OrganizationType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="Person" type="PersonType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="CrisisKind" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Description" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="crisisKindIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="OrganizationKind" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Description" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="organizationKindIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="PersonKind" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Description" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="personKindIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- Crisis key and keyref-->
<xsd:key name="CrisisKey">
<xsd:selector xpath="Crisis" />
<xsd:field xpath="@crisisIdent" />
</xsd:key>
<xsd:keyref name="CrisisKeyRef" refer="CrisisKey">
<xsd:selector xpath="Person/RelatedCrises/RelatedCrisis | Organization/RelatedCrises/RelatedCrisis" />
<xsd:field xpath="@crisisIdent" />
</xsd:keyref>
<!-- Organization key and keyref -->
<xsd:key name="OrganizationKey">
<xsd:selector xpath="Organization" />
<xsd:field xpath="@organizationIdent" />
</xsd:key>
<xsd:keyref name="OrganizationKeyRef" refer="OrganizationKey">
<xsd:selector xpath="Crisis/RelatedOrganizations/RelatedOrganization | Person/RelatedOrganizations/RelatedOrganization" />
<xsd:field xpath="@organizationIdent" />
</xsd:keyref>
<!-- Person key and keyref -->
<xsd:key name="PersonKey">
<xsd:selector xpath="Person" />
<xsd:field xpath="@personIdent" />
</xsd:key>
<xsd:keyref name="PersonKeyRef" refer="PersonKey">
<xsd:selector xpath="Crisis/RelatedPersons/RelatedPerson | Organization/RelatedPersons/RelatedPerson" />
<xsd:field xpath="@personIdent" />
</xsd:keyref>
<!-- CrisisKind key and keyref -->
<xsd:key name="CrisisKindKey">
<xsd:selector xpath="CrisisKind" />
<xsd:field xpath="@crisisKindIdent" />
</xsd:key>
<xsd:keyref name="CrisisKindKeyRef" refer="CrisisKindKey">
<xsd:selector xpath="Crisis/Kind" />
<xsd:field xpath="@crisisKindIdent" />
</xsd:keyref>
<!-- OrganizationKind key and keyref -->
<xsd:key name="OrganizationKindKey">
<xsd:selector xpath="OrganizationKind" />
<xsd:field xpath="@organizationKindIdent" />
</xsd:key>
<xsd:keyref name="OrganizationKindKeyRef" refer="OrganizationKindKey">
<xsd:selector xpath="Organization/Kind" />
<xsd:field xpath="@organizationKindIdent" />
</xsd:keyref>
<!-- PersonKind key and keyref -->
<xsd:key name="PersonKindKey">
<xsd:selector xpath="PersonKind" />
<xsd:field xpath="@personKindIdent" />
</xsd:key>
<xsd:keyref name="PersonKindKeyRef" refer="PersonKindKey">
<xsd:selector xpath="Person/Kind" />
<xsd:field xpath="@personKindIdent" />
</xsd:keyref>
</xsd:element>
<!-- Crisis, Organization, and Person Types -->
<!-- Crisis Type -->
<!-- Every Crisis have a Name, a Kind, one or more Location, a StartDateTime, an optional
EndDateTime, zero or more HumanImpact consisting of number and type, an EconomicImpact
measured in USD, zero or more ResourceNeeded, zero or more WaysToHelp, an ExternalResources
consisting all URL and citations, zero or more RelatedPerson and zero or more
RelatedOrganization. All of these must be in sequence. It also has an attribute for its
key. -->
<xsd:complexType name="CrisisType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Kind">
<xsd:complexType>
<xsd:attribute name="crisisKindIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Location" type="LocationType" maxOccurs="unbounded" />
<xsd:element name="StartDateTime" type="DateTime" />
<xsd:element name="EndDateTime" type="DateTime" minOccurs="0"/>
<xsd:element name="HumanImpact" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Type" type="xsd:string" />
<xsd:element name="Number" type="xsd:integer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EconomicImpact" type="xsd:string" />
<xsd:element name="ResourceNeeded" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="WaysToHelp" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="ExternalResources" type="ExternalResources" />
<xsd:element name="RelatedPersons" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RelatedPerson" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="personIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RelatedOrganizations" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RelatedOrganization" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="organizationIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="crisisIdent" type="xsd:string" use="required" />
</xsd:complexType>
<!-- Every Organization have a Name, a Kind, one or more Location, a History, a ContactInfo
consisting of a Telephone number, a Fax number, an Email address and a PostalAddress,
an ExternalResources consisting all URL and citations, zero or more RelatedCrisis and
zero or more RelatedPerson. All of these must be in sequence. It also has an attribute
for its key. -->
<xsd:complexType name="OrganizationType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Kind">
<xsd:complexType>
<xsd:attribute name="organizationKindIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Location" type="LocationType" maxOccurs="unbounded" />
<xsd:element name="History" type="xsd:string" />
<xsd:element name="ContactInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Telephone" type="PhoneNumber" />
<xsd:element name="Fax" type="PhoneNumber" />
<xsd:element name="Email" type="Email" />
<xsd:element name="PostalAddress">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="StreetAddress" type="xsd:string" />
<xsd:element name="Locality" type="xsd:string" /> <!--e.g. city or county-->
<xsd:element name="Region" type="xsd:string" /> <!--e.g. state or province-->
<xsd:element name="PostalCode" type="xsd:string" />
<xsd:element name="Country" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ExternalResources" type="ExternalResources" />
<xsd:element name="RelatedCrises" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RelatedCrisis" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="crisisIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RelatedPersons" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RelatedPerson" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="personIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="organizationIdent" type="xsd:string" use="required" />
</xsd:complexType>
<!-- Person Type -->
<!-- Every Person have a Name consisting of FirstName, MiddleName, LastName and Suffix, a Kind,
one or more Location, an ExternalResources consisting all URL and citations, zero or more
RelatedCrisis and zero or more RelatedOrganization. All of these must be in sequence. It also
has an attribute for its key. -->
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="Name">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FirstName" type="xsd:string" />
<xsd:element name="MiddleName" type="xsd:string" minOccurs="0" />
<xsd:element name="LastName" type="xsd:string" />
<xsd:element name="Suffix" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Kind">
<xsd:complexType>
<xsd:attribute name="personKindIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Location" type="LocationType" maxOccurs="unbounded"/>
<xsd:element name="ExternalResources" type="ExternalResources" />
<xsd:element name="RelatedCrises" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RelatedCrisis" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="crisisIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RelatedOrganizations" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RelatedOrganization" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="organizationIdent" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="personIdent" type="xsd:string" use="required" />
</xsd:complexType>
<!-- Other Types -->
<!-- Location Type -->
<xsd:complexType name="LocationType">
<xsd:sequence>
<xsd:element name="Locality" type="xsd:string" minOccurs="0" /> <!--e.g. city or county-->
<xsd:element name="Region" type="xsd:string" minOccurs="0" /> <!--e.g. state or province-->
<xsd:element name="Country" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
<!-- URL type -->
<xsd:simpleType name="URL">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(http|https)://.*"/>
</xsd:restriction>
</xsd:simpleType>
<!-- Email Type -->
<xsd:simpleType name="Email">
<xsd:restriction base="xsd:string">
<xsd:pattern value="([^@]+@[^@]+)?"/>
</xsd:restriction>
</xsd:simpleType>
<!-- PhoneNumber Type -->
<xsd:simpleType name="PhoneNumber">
<xsd:restriction base="xsd:string">
<xsd:pattern value="([0-9x+ ]+)?"/>
</xsd:restriction>
</xsd:simpleType>
<!-- DateTime Type -->
<xsd:complexType name="DateTime">
<xsd:sequence>
<xsd:element name="Date" type="xsd:date" />
<xsd:element name="Time" type="xsd:time" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
<!-- ExternalResources Type -->
<xsd:complexType name="ExternalResources">
<xsd:sequence>
<xsd:element name="ImageURL" type="URL" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="VideoURL" type="URL" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="MapURL" type="URL" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="SocialNetworkURL" type="URL" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="Citation" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="ExternalLinkURL" type="URL" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>