-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathWCDB3.xsd.xml
212 lines (192 loc) · 9.66 KB
/
WCDB3.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
<?xml version="1.0" ?>
<!-- XSD for World Crises database -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="WorldCrises">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Crisis" type="CrisisType" minOccurs="1" maxOccurs="unbounded" />
<xsd:element name="Person" type="PersonType" minOccurs="1" maxOccurs="unbounded" />
<xsd:element name="Organization" type="OrgType" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<!-- All keys and keyrefs go here -->
<xsd:key name="CrisisKey">
<xsd:selector xpath="Crisis" />
<xsd:field xpath="@ID" />
</xsd:key>
<xsd:keyref name="CrisisKeyRef_Person" refer="CrisisKey">
<xsd:selector xpath="Person/Crises/Crisis" />
<xsd:field xpath="@ID" />
</xsd:keyref>
<xsd:keyref name="CrisisKeyRef_Org" refer="CrisisKey">
<xsd:selector xpath="Organization/Crises/Crisis" />
<xsd:field xpath="@ID" />
</xsd:keyref>
<xsd:key name="PersonKey">
<xsd:selector xpath="Person" />
<xsd:field xpath="@ID" />
</xsd:key>
<xsd:keyref name="PersonKeyRef_Crisis" refer="PersonKey">
<xsd:selector xpath="Crisis/People/Person" />
<xsd:field xpath="@ID" />
</xsd:keyref>
<xsd:keyref name="PersonKeyRef_Org" refer="PersonKey">
<xsd:selector xpath="Organization/People/Person" />
<xsd:field xpath="@ID" />
</xsd:keyref>
<xsd:key name="OrgKey">
<xsd:selector xpath="Organization" />
<xsd:field xpath="@ID" />
</xsd:key>
<xsd:keyref name="OrgKeyRef_Crisis" refer="OrgKey">
<xsd:selector xpath="Crisis/Organizations/Org" />
<xsd:field xpath="@ID" />
</xsd:keyref>
<xsd:keyref name="OrgKeyRef_Person" refer="OrgKey">
<xsd:selector xpath="Person/Organizations/Org" />
<xsd:field xpath="@ID" />
</xsd:keyref>
</xsd:element>
<!-- Crisis Data Type -->
<!-- Required: Name, ID (attributes), People, Orgs (each with ID attributes)-->
<xsd:complexType name="CrisisType">
<xsd:sequence>
<xsd:element name="People" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Person" type="PersonWithID" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Organizations" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Org" type="OrgWithID" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Kind" type="xsd:token" minOccurs="0" maxOccurs="1" />
<xsd:element name="Date" type="xsd:date" minOccurs="0" maxOccurs="1" />
<xsd:element name="Time" type="xsd:time" minOccurs="0" maxOccurs="1" />
<xsd:element name="Locations" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="HumanImpact" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="EconomicImpact" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="ResourcesNeeded" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="WaysToHelp" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Common" type="CommonType" minOccurs="0" maxOccurs="1" />
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="ID" type="CrisisIDType" use="required" />
<xsd:attribute name="Name" type="xsd:token" use="required" />
</xsd:complexType>
<!-- Person Data Type -->
<!-- Required: Name, ID (attributes), Crises, Orgs (each with ID attributes) -->
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="Crises" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Crisis" type="CrisisWithID" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Organizations" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Org" type="OrgWithID" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Kind" type="xsd:token" minOccurs="0" maxOccurs="1" />
<xsd:element name="Location" type="xsd:token" minOccurs="0" maxOccurs="1" />
<xsd:element name="Common" type="CommonType" minOccurs="0" maxOccurs="1" />
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="ID" type="PersonIDType" use="required" />
<xsd:attribute name="Name" type="xsd:token" use="required" />
</xsd:complexType>
<!-- Person Data Type -->
<!-- Required: Name, ID (attributes), Crises, People (each with ID attributes) -->
<xsd:complexType name="OrgType">
<xsd:sequence>
<xsd:element name="Crises" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Crisis" type="CrisisWithID" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="People" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Person" type="PersonWithID" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Kind" type="xsd:token" minOccurs="0" maxOccurs="1" />
<xsd:element name="Location" type="xsd:token" minOccurs="0" maxOccurs="1" />
<xsd:element name="History" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="ContactInfo" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Common" type="CommonType" minOccurs="0" maxOccurs="1" />
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="ID" type="OrgIDType" use="required"/>
<xsd:attribute name="Name" type="xsd:token" use="required" />
</xsd:complexType>
<!-- CommonType contains elements common to crises, people and organizations. Each of these elements is a list. -->
<xsd:complexType name="CommonType">
<xsd:sequence>
<xsd:element name="Citations" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="ExternalLinks" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Images" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Videos" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Maps" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Feeds" type="ListType" minOccurs="0" maxOccurs="1" />
<xsd:element name="Summary" type="xsd:token" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<!-- ListType is a list of tokens. Each token can have an optional hyperlink (href attribute) and/or link for embedded object (embed attribute).
This is a generic type that can accomodate all types of lists (images, videos, citations, text, etc.) See example XML for usage -->
<xsd:complexType name="ListType">
<xsd:sequence>
<xsd:element name="li" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType mixed="true">
<xsd:attribute name="href" type="xsd:token" />
<xsd:attribute name="embed" type="xsd:token" />
<xsd:attribute name="text" type="xsd:token" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- Use these when making references to crises, people or orgs -->
<xsd:complexType name="CrisisWithID">
<xsd:attribute name="ID" type="CrisisIDType" use="required" />
</xsd:complexType>
<xsd:complexType name="PersonWithID">
<xsd:attribute name="ID" type="PersonIDType" use="required" />
</xsd:complexType>
<xsd:complexType name="OrgWithID">
<xsd:attribute name="ID" type="OrgIDType" use="required" />
</xsd:complexType>
<!-- All ID Types go here -->
<xsd:simpleType name="CrisisIDType">
<xsd:restriction base="IDType">
<xsd:pattern value="CRI_[A-Z]{6}" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="PersonIDType">
<xsd:restriction base="IDType">
<xsd:pattern value="PER_[A-Z]{6}" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="OrgIDType">
<xsd:restriction base="IDType">
<xsd:pattern value="ORG_[A-Z]{6}" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="IDType">
<xsd:restriction base="xsd:token">
<xsd:length value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>