]> Wikimedia Canada | Git repositories - eccc_to_commons.git/blob - commons_rules.xsd
Rewrite almanach merge logic
[eccc_to_commons.git] / commons_rules.xsd
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- This schema is required to validate Environment and Climate Change Canada
3 historical data prior of its import into Wikidata.
4
5 All tests done in ECCC's bulkschema.xsd aren't replicated here as we're
6 focusing into pure Wikimedia Commons data quality.
7
8 Schema is restrictive on purpose: up to date extreme values are hard coded
9 just like current year. It WILL break starting 2021 so we can make sure
10 someone has checked potential upstream structure change before running
11 Commons data update. -->
12 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
13 <!-- Define elements -->
14 <xsd:element name="climatedata">
15 <xsd:complexType>
16 <xsd:sequence>
17 <xsd:element ref="lang" minOccurs="1" maxOccurs="1" />
18 <xsd:element ref="stationinformation" minOccurs="1" maxOccurs="1" />
19 <xsd:element ref="legend" minOccurs="1" maxOccurs="1" />
20 <xsd:choice>
21 <xsd:element ref="stationdata" minOccurs="1" maxOccurs="unbounded" />
22 <xsd:element ref="month" minOccurs="1" maxOccurs="unbounded" />
23 </xsd:choice>
24 </xsd:sequence>
25 </xsd:complexType>
26 </xsd:element>
27
28 <xsd:element name="lang">
29 <xsd:simpleType>
30 <xsd:restriction base="xsd:string">
31 <xsd:annotation>
32 <xsd:documentation xml:lang="en">For consistency reasons in names and numeric formats, we enforce import of English files in Commons.
33 </xsd:documentation>
34 </xsd:annotation>
35 <xsd:enumeration value="ENG" />
36 </xsd:restriction>
37 </xsd:simpleType>
38 </xsd:element>
39
40 <xsd:element name="stationinformation">
41 <xsd:complexType>
42 <xsd:sequence>
43 <xsd:element ref="name" minOccurs="1" maxOccurs="1" />
44 <xsd:element ref="province" minOccurs="1" maxOccurs="1" />
45 <xsd:element ref="stationoperator" minOccurs="0" maxOccurs="1" />
46 <xsd:element ref="latitude" minOccurs="1" maxOccurs="1" />
47 <xsd:element ref="longitude" minOccurs="1" maxOccurs="1" />
48 <xsd:element ref="elevation" minOccurs="1" maxOccurs="1" />
49 <xsd:element ref="climate_identifier" minOccurs="1" maxOccurs="1" />
50 <xsd:element ref="wmo_identifier" minOccurs="1" maxOccurs="1" />
51 <xsd:element ref="tc_identifier" minOccurs="1" maxOccurs="1" />
52 </xsd:sequence>
53 </xsd:complexType>
54 </xsd:element>
55
56 <xsd:element name="name">
57 <xsd:simpleType>
58 <xsd:restriction base="xsd:string">
59 <xsd:pattern value="[0-9A-Z '().#,\-/&amp;]+" />
60 </xsd:restriction>
61 </xsd:simpleType>
62 </xsd:element>
63
64 <xsd:element name="province">
65 <xsd:simpleType>
66 <xsd:restriction base="xsd:string">
67 <xsd:enumeration value="ALBERTA" />
68 <xsd:enumeration value="BRITISH COLUMBIA" />
69 <xsd:enumeration value="QUEBEC" />
70 <xsd:enumeration value="MANITOBA" />
71 <xsd:enumeration value="NEW BRUNSWICK" />
72 <xsd:enumeration value="NEWFOUNDLAND" />
73 <xsd:enumeration value="NORTHWEST TERRITORIES" />
74 <xsd:enumeration value="NOVA SCOTIA" />
75 <xsd:enumeration value="NUNAVUT" />
76 <xsd:enumeration value="ONTARIO" />
77 <xsd:enumeration value="PRINCE EDWARD ISLAND" />
78 <xsd:enumeration value="SASKATCHEWAN" />
79 <xsd:enumeration value="YUKON TERRITORY" />
80 </xsd:restriction>
81 </xsd:simpleType>
82 </xsd:element>
83
84 <xsd:element name="stationoperator">
85 <xsd:simpleType>
86 <xsd:restriction base="xsd:string">
87 <xsd:pattern value="[A-Za-z -]+" />
88 </xsd:restriction>
89 </xsd:simpleType>
90 </xsd:element>
91
92 <xsd:element name="latitude">
93 <xsd:simpleType>
94 <xsd:union memberTypes="zero">
95 <xsd:annotation>
96 <xsd:documentation xml:lang="en">WARNING: latitude can be zero
97 </xsd:documentation>
98 </xsd:annotation>
99 <xsd:simpleType>
100 <xsd:restriction base="xsd:float">
101 <xsd:minInclusive value="41.6" />
102 <xsd:maxInclusive value="83.2" />
103 </xsd:restriction>
104 </xsd:simpleType>
105 <xsd:simpleType>
106 <xsd:annotation>
107 <xsd:documentation xml:lang="en">WARNING: en_climate_monthly_NB_8104200_1872-1952_P1M.xml is in Russia
108 </xsd:documentation>
109 </xsd:annotation>
110 <xsd:restriction base="xsd:float">
111 <xsd:enumeration value="45.07" />
112 </xsd:restriction>
113 </xsd:simpleType>
114 </xsd:union>
115 </xsd:simpleType>
116 </xsd:element>
117
118 <xsd:element name="longitude">
119 <xsd:simpleType>
120 <xsd:union memberTypes="zero">
121 <xsd:annotation>
122 <xsd:documentation xml:lang="en">WARNING: longitude can be zero
123 </xsd:documentation>
124 </xsd:annotation>
125 <xsd:simpleType>
126 <xsd:restriction base="xsd:float">
127 <xsd:minInclusive value="-141.0" />
128 <xsd:maxInclusive value="-52.0" />
129 </xsd:restriction>
130 </xsd:simpleType>
131 <xsd:simpleType>
132 <xsd:annotation>
133 <xsd:documentation xml:lang="en">WARNING: en_climate_monthly_NB_8104200_1872-1952_P1M.xml is in Russia
134 </xsd:documentation>
135 </xsd:annotation>
136 <xsd:restriction base="xsd:float">
137 <xsd:enumeration value="66.47" />
138 </xsd:restriction>
139 </xsd:simpleType>
140 </xsd:union>
141 </xsd:simpleType>
142 </xsd:element>
143
144 <xsd:element name="elevation">
145 <xsd:simpleType>
146 <xsd:union memberTypes="empty">
147 <xsd:simpleType>
148 <xsd:restriction base="xsd:float">
149 <xsd:minInclusive value="0.0" />
150 <xsd:maxInclusive value="2926.1" />
151 </xsd:restriction>
152 </xsd:simpleType>
153 </xsd:union>
154 </xsd:simpleType>
155 </xsd:element>
156
157 <xsd:element name="climate_identifier">
158 <xsd:simpleType>
159 <xsd:restriction base="xsd:string">
160 <xsd:pattern value="[0-9A-Z]+" />
161 </xsd:restriction>
162 </xsd:simpleType>
163 </xsd:element>
164
165 <xsd:element name="wmo_identifier">
166 <xsd:simpleType>
167 <xsd:union memberTypes="empty">
168 <xsd:simpleType>
169 <xsd:restriction base="xsd:nonNegativeInteger" />
170 </xsd:simpleType>
171 </xsd:union>
172 </xsd:simpleType>
173 </xsd:element>
174
175 <xsd:element name="tc_identifier">
176 <xsd:simpleType>
177 <xsd:union memberTypes="empty">
178 <xsd:simpleType>
179 <xsd:restriction base="xsd:string">
180 <xsd:pattern value="[A-Z0-9]{3}" />
181 </xsd:restriction>
182 </xsd:simpleType>
183 </xsd:union>
184 </xsd:simpleType>
185 </xsd:element>
186
187 <xsd:element name="legend">
188 <xsd:complexType>
189 <xsd:sequence>
190 <xsd:element ref="flag" minOccurs="1" maxOccurs="unbounded" />
191 </xsd:sequence>
192 </xsd:complexType>
193 </xsd:element>
194
195 <xsd:element name="flag">
196 <xsd:complexType>
197 <xsd:sequence>
198 <xsd:element ref="symbol" minOccurs="1" maxOccurs="1" />
199 <xsd:element ref="description" minOccurs="1" maxOccurs="1" />
200 </xsd:sequence>
201 </xsd:complexType>
202 </xsd:element>
203
204 <xsd:element name="symbol">
205 <xsd:simpleType>
206 <xsd:union>
207 <xsd:simpleType>
208 <xsd:restriction base="xsd:string">
209 <xsd:length value="1" />
210 </xsd:restriction>
211 </xsd:simpleType>
212 <xsd:simpleType>
213 <xsd:restriction base="xsd:string">
214 <xsd:enumeration value="[empty]">
215 <xsd:annotation>
216 <xsd:documentation xml:lang="en">[empty] is an allowed value
217 </xsd:documentation>
218 </xsd:annotation>
219 </xsd:enumeration>
220 </xsd:restriction>
221 </xsd:simpleType>
222 </xsd:union>
223 </xsd:simpleType>
224 </xsd:element>
225
226 <xsd:element name="description" type="xsd:anyType" />
227
228 <xsd:element name="stationdata">
229 <xsd:complexType>
230 <xsd:sequence>
231 <xsd:element ref="meanmaxtemp" minOccurs="1" maxOccurs="1" />
232 <xsd:element ref="meanmintemp" minOccurs="1" maxOccurs="1" />
233 <xsd:element ref="meanmonthtemp" minOccurs="1" maxOccurs="1" />
234 <xsd:element ref="extrmaxtemp" minOccurs="1" maxOccurs="1" />
235 <xsd:element ref="extrmintemp" minOccurs="1" maxOccurs="1" />
236 <xsd:element ref="totrain" minOccurs="1" maxOccurs="1" />
237 <xsd:element ref="totsnow" minOccurs="1" maxOccurs="1" />
238 <xsd:element ref="totprecip" minOccurs="1" maxOccurs="1" />
239 <xsd:element ref="grndsnowlastday" minOccurs="1" maxOccurs="1" />
240 <xsd:element ref="dirmaxgust" minOccurs="1" maxOccurs="1" />
241 <xsd:element ref="speedmaxgust" minOccurs="1" maxOccurs="1" />
242 </xsd:sequence>
243 <xsd:attributeGroup ref="attrgroup-stationdata" />
244 </xsd:complexType>
245 </xsd:element>
246
247 <xsd:element name="meanmaxtemp">
248 <xsd:complexType>
249 <xsd:simpleContent>
250 <xsd:extension base="meanmaxtemp-values">
251 <xsd:attributeGroup ref="attrgroup-meanmaxtemp" />
252 </xsd:extension>
253 </xsd:simpleContent>
254 </xsd:complexType>
255 </xsd:element>
256
257 <xsd:element name="meanmintemp">
258 <xsd:complexType>
259 <xsd:simpleContent>
260 <xsd:extension base="meanmintemp-values">
261 <xsd:attributeGroup ref="attrgroup-meanmintemp" />
262 </xsd:extension>
263 </xsd:simpleContent>
264 </xsd:complexType>
265 </xsd:element>
266
267 <xsd:element name="meanmonthtemp">
268 <xsd:complexType>
269 <xsd:simpleContent>
270 <xsd:extension base="meanmonthtemp-values">
271 <xsd:attributeGroup ref="attrgroup-meanmonthtemp" />
272 </xsd:extension>
273 </xsd:simpleContent>
274 </xsd:complexType>
275 </xsd:element>
276
277 <xsd:element name="extrmaxtemp">
278 <xsd:complexType>
279 <xsd:simpleContent>
280 <xsd:extension base="extrmaxtemp-values">
281 <xsd:attributeGroup ref="attrgroup-extrmaxtemp" />
282 </xsd:extension>
283 </xsd:simpleContent>
284 </xsd:complexType>
285 </xsd:element>
286
287 <xsd:element name="extrmintemp">
288 <xsd:complexType>
289 <xsd:simpleContent>
290 <xsd:extension base="extrmintemp-values">
291 <xsd:attributeGroup ref="attrgroup-extrmintemp" />
292 </xsd:extension>
293 </xsd:simpleContent>
294 </xsd:complexType>
295 </xsd:element>
296
297 <xsd:element name="totrain">
298 <xsd:complexType>
299 <xsd:simpleContent>
300 <xsd:extension base="total-rain-values">
301 <xsd:attributeGroup ref="attrgroup-totrain" />
302 </xsd:extension>
303 </xsd:simpleContent>
304 </xsd:complexType>
305 </xsd:element>
306
307 <xsd:element name="totsnow">
308 <xsd:complexType>
309 <xsd:simpleContent>
310 <xsd:extension base="total-snow-values">
311 <xsd:attributeGroup ref="attrgroup-totsnow" />
312 </xsd:extension>
313 </xsd:simpleContent>
314 </xsd:complexType>
315 </xsd:element>
316
317 <xsd:element name="totprecip">
318 <xsd:complexType>
319 <xsd:simpleContent>
320 <xsd:extension base="total-precipitation-values">
321 <xsd:attributeGroup ref="attrgroup-totprecipitation" />
322 </xsd:extension>
323 </xsd:simpleContent>
324 </xsd:complexType>
325 </xsd:element>
326
327 <xsd:element name="grndsnowlastday">
328 <xsd:complexType>
329 <xsd:simpleContent>
330 <xsd:extension base="total-grndsnowlastday">
331 <xsd:attributeGroup ref="attrgroup-grndsnowlastday" />
332 </xsd:extension>
333 </xsd:simpleContent>
334 </xsd:complexType>
335 </xsd:element>
336
337 <xsd:element name="dirmaxgust">
338 <xsd:complexType>
339 <xsd:simpleContent>
340 <xsd:extension base="total-dirmaxgust">
341 <xsd:attributeGroup ref="attrgroup-dirmaxgust" />
342 </xsd:extension>
343 </xsd:simpleContent>
344 </xsd:complexType>
345 </xsd:element>
346
347 <xsd:element name="speedmaxgust">
348 <xsd:complexType>
349 <xsd:simpleContent>
350 <xsd:extension base="total-speedmaxgust">
351 <xsd:attributeGroup ref="attrgroup-speedmaxgust" />
352 </xsd:extension>
353 </xsd:simpleContent>
354 </xsd:complexType>
355 </xsd:element>
356
357 <xsd:element name="month">
358 <xsd:complexType>
359 <xsd:sequence>
360 <xsd:element ref="day" minOccurs="0" maxOccurs="31" />
361 </xsd:sequence>
362 <xsd:attributeGroup ref="attrgroup-month" />
363 </xsd:complexType>
364 </xsd:element>
365
366 <xsd:element name="day">
367 <xsd:complexType>
368 <xsd:sequence>
369 <xsd:element ref="temperature" minOccurs="5" maxOccurs="5" />
370 <xsd:element ref="precipitation" minOccurs="4" maxOccurs="4" />
371 <xsd:element ref="pop" minOccurs="1" maxOccurs="1" />
372 </xsd:sequence>
373 <xsd:attributeGroup ref="attrgroup-day" />
374 </xsd:complexType>
375 </xsd:element>
376
377 <xsd:element name="temperature">
378 <xsd:complexType>
379 <xsd:simpleContent>
380 <xsd:extension base="temperature-values">
381 <xsd:attributeGroup ref="attrgroup-temperature" />
382 </xsd:extension>
383 </xsd:simpleContent>
384 </xsd:complexType>
385 </xsd:element>
386
387 <xsd:element name="precipitation">
388 <xsd:complexType>
389 <xsd:simpleContent>
390 <xsd:extension base="precipitation-values">
391 <xsd:attributeGroup ref="attrgroup-precipitation" />
392 </xsd:extension>
393 </xsd:simpleContent>
394 </xsd:complexType>
395 </xsd:element>
396
397 <xsd:element name="pop">
398 <xsd:complexType>
399 <xsd:simpleContent>
400 <xsd:extension base="pop-values">
401 <xsd:attributeGroup ref="attrgroup-pop" />
402 </xsd:extension>
403 </xsd:simpleContent>
404 </xsd:complexType>
405 </xsd:element>
406
407 <!-- Define attributes -->
408 <xsd:attribute name="flag">
409 <xsd:annotation>
410 <xsd:documentation xml:lang="en">flag attribute has only one value
411 </xsd:documentation>
412 </xsd:annotation>
413 <xsd:simpleType>
414 <xsd:restriction base="xsd:string">
415 <xsd:length value="1" />
416 </xsd:restriction>
417 </xsd:simpleType>
418 </xsd:attribute>
419
420 <!-- Define groups -->
421
422 <!-- Define attributes groups -->
423 <xsd:attributeGroup name="attrgroup-stationdata">
424 <xsd:attribute name="month" use="required">
425 <xsd:simpleType>
426 <xsd:restriction base="xsd:integer">
427 <xsd:minInclusive value="1" />
428 <xsd:maxInclusive value="12" />
429 </xsd:restriction>
430 </xsd:simpleType>
431 </xsd:attribute>
432 <xsd:attribute name="year" use="required">
433 <xsd:simpleType>
434 <xsd:restriction base="xsd:integer">
435 <xsd:minInclusive value="1840" />
436 <xsd:maxInclusive value="2020" />
437 </xsd:restriction>
438 </xsd:simpleType>
439 </xsd:attribute>
440 </xsd:attributeGroup>
441
442 <xsd:attributeGroup name="attrgroup-meanmaxtemp">
443 <xsd:attribute name="units" use="required">
444 <xsd:simpleType>
445 <xsd:restriction base="xsd:string">
446 <xsd:annotation>
447 <xsd:documentation xml:lang="en">meanmaxtemp must be provided in °C.
448 </xsd:documentation>
449 </xsd:annotation>
450 <xsd:enumeration value="°C" />
451 </xsd:restriction>
452 </xsd:simpleType>
453 </xsd:attribute>
454 <xsd:attribute name="description" use="optional" />
455 <xsd:attribute name="flag">
456 <xsd:simpleType>
457 <xsd:restriction base="xsd:string">
458 <xsd:annotation>
459 <xsd:documentation xml:lang="en">meanmaxtemp flag can be E I or M only.
460 </xsd:documentation>
461 </xsd:annotation>
462 <xsd:enumeration value="E" />
463 <xsd:enumeration value="I" />
464 <xsd:enumeration value="M" />
465 </xsd:restriction>
466 </xsd:simpleType>
467 </xsd:attribute>
468 </xsd:attributeGroup>
469
470 <xsd:attributeGroup name="attrgroup-meanmintemp">
471 <xsd:attribute name="units" use="required">
472 <xsd:simpleType>
473 <xsd:restriction base="xsd:string">
474 <xsd:annotation>
475 <xsd:documentation xml:lang="en">meanmintemp must be provided in °C.
476 </xsd:documentation>
477 </xsd:annotation>
478 <xsd:enumeration value="°C" />
479 </xsd:restriction>
480 </xsd:simpleType>
481 </xsd:attribute>
482 <xsd:attribute name="description" use="optional" />
483 <xsd:attribute name="flag">
484 <xsd:simpleType>
485 <xsd:restriction base="xsd:string">
486 <xsd:annotation>
487 <xsd:documentation xml:lang="en">meanmintemp flag can be E I or M only.
488 </xsd:documentation>
489 </xsd:annotation>
490 <xsd:enumeration value="E" />
491 <xsd:enumeration value="I" />
492 <xsd:enumeration value="M" />
493 </xsd:restriction>
494 </xsd:simpleType>
495 </xsd:attribute>
496 </xsd:attributeGroup>
497
498 <xsd:attributeGroup name="attrgroup-meanmonthtemp">
499 <xsd:attribute name="units" use="required">
500 <xsd:simpleType>
501 <xsd:restriction base="xsd:string">
502 <xsd:annotation>
503 <xsd:documentation xml:lang="en">meanmonthtemp must be provided in °C.
504 </xsd:documentation>
505 </xsd:annotation>
506 <xsd:enumeration value="°C" />
507 </xsd:restriction>
508 </xsd:simpleType>
509 </xsd:attribute>
510 <xsd:attribute name="description" use="optional" />
511 <xsd:attribute name="flag">
512 <xsd:simpleType>
513 <xsd:restriction base="xsd:string">
514 <xsd:annotation>
515 <xsd:documentation xml:lang="en">meanmonthtemp flag can be E I or M only.
516 </xsd:documentation>
517 </xsd:annotation>
518 <xsd:enumeration value="E" />
519 <xsd:enumeration value="I" />
520 <xsd:enumeration value="M" />
521 </xsd:restriction>
522 </xsd:simpleType>
523 </xsd:attribute>
524 </xsd:attributeGroup>
525
526 <xsd:attributeGroup name="attrgroup-extrmaxtemp">
527 <xsd:attribute name="units" use="required">
528 <xsd:simpleType>
529 <xsd:restriction base="xsd:string">
530 <xsd:annotation>
531 <xsd:documentation xml:lang="en">extrmaxtemp must be provided in °C.
532 </xsd:documentation>
533 </xsd:annotation>
534 <xsd:enumeration value="°C" />
535 </xsd:restriction>
536 </xsd:simpleType>
537 </xsd:attribute>
538 <xsd:attribute name="description" use="optional" />
539 <xsd:attribute name="flag">
540 <xsd:simpleType>
541 <xsd:restriction base="xsd:string">
542 <xsd:annotation>
543 <xsd:documentation xml:lang="en">extrmaxtemp flag can be B E I M or S only.
544 </xsd:documentation>
545 </xsd:annotation>
546 <xsd:enumeration value="B" />
547 <xsd:enumeration value="E" />
548 <xsd:enumeration value="I" />
549 <xsd:enumeration value="M" />
550 <xsd:enumeration value="S" />
551 </xsd:restriction>
552 </xsd:simpleType>
553 </xsd:attribute>
554 </xsd:attributeGroup>
555
556 <xsd:attributeGroup name="attrgroup-extrmintemp">
557 <xsd:attribute name="units" use="required">
558 <xsd:simpleType>
559 <xsd:restriction base="xsd:string">
560 <xsd:annotation>
561 <xsd:documentation xml:lang="en">extrmintemp must be provided in °C.
562 </xsd:documentation>
563 </xsd:annotation>
564 <xsd:enumeration value="°C" />
565 </xsd:restriction>
566 </xsd:simpleType>
567 </xsd:attribute>
568 <xsd:attribute name="description" use="optional" />
569 <xsd:attribute name="flag">
570 <xsd:simpleType>
571 <xsd:restriction base="xsd:string">
572 <xsd:annotation>
573 <xsd:documentation xml:lang="en">extrmintemp flag can be B E I M or S only.
574 </xsd:documentation>
575 </xsd:annotation>
576 <xsd:enumeration value="B" />
577 <xsd:enumeration value="E" />
578 <xsd:enumeration value="I" />
579 <xsd:enumeration value="M" />
580 <xsd:enumeration value="S" />
581 </xsd:restriction>
582 </xsd:simpleType>
583 </xsd:attribute>
584 </xsd:attributeGroup>
585
586 <xsd:attributeGroup name="attrgroup-totrain">
587 <xsd:attribute name="units" use="required">
588 <xsd:simpleType>
589 <xsd:restriction base="xsd:string">
590 <xsd:annotation>
591 <xsd:documentation xml:lang="en">totrain unit must be provided in mm.
592 </xsd:documentation>
593 </xsd:annotation>
594 <xsd:enumeration value="mm" />
595 </xsd:restriction>
596 </xsd:simpleType>
597 </xsd:attribute>
598 <xsd:attribute name="description" use="optional" />
599 <xsd:attribute name="flag">
600 <xsd:simpleType>
601 <xsd:restriction base="xsd:string">
602 <xsd:annotation>
603 <xsd:documentation xml:lang="en">totrain flag can be E I M or T only.
604 </xsd:documentation>
605 </xsd:annotation>
606 <xsd:enumeration value="E" />
607 <xsd:enumeration value="I" />
608 <xsd:enumeration value="M" />
609 <xsd:enumeration value="T" />
610 </xsd:restriction>
611 </xsd:simpleType>
612 </xsd:attribute>
613 </xsd:attributeGroup>
614
615 <xsd:attributeGroup name="attrgroup-totsnow">
616 <xsd:attribute name="units" use="required">
617 <xsd:simpleType>
618 <xsd:restriction base="xsd:string">
619 <xsd:annotation>
620 <xsd:documentation xml:lang="en">totsnow unit must be provided in cm.
621 </xsd:documentation>
622 </xsd:annotation>
623 <xsd:enumeration value="cm" />
624 </xsd:restriction>
625 </xsd:simpleType>
626 </xsd:attribute>
627 <xsd:attribute name="description" use="optional" />
628 <xsd:attribute name="flag">
629 <xsd:simpleType>
630 <xsd:restriction base="xsd:string">
631 <xsd:annotation>
632 <xsd:documentation xml:lang="en">totrain flag can be E I M or T only.
633 </xsd:documentation>
634 </xsd:annotation>
635 <xsd:enumeration value="E" />
636 <xsd:enumeration value="I" />
637 <xsd:enumeration value="M" />
638 <xsd:enumeration value="T" />
639 </xsd:restriction>
640 </xsd:simpleType>
641 </xsd:attribute>
642 </xsd:attributeGroup>
643
644 <xsd:attributeGroup name="attrgroup-totprecipitation">
645 <xsd:attribute name="units" use="required">
646 <xsd:simpleType>
647 <xsd:restriction base="xsd:string">
648 <xsd:annotation>
649 <xsd:documentation xml:lang="en">totprecip unit must be provided in mm.
650 </xsd:documentation>
651 </xsd:annotation>
652 <xsd:enumeration value="mm" />
653 </xsd:restriction>
654 </xsd:simpleType>
655 </xsd:attribute>
656 <xsd:attribute name="description" use="optional" />
657 <xsd:attribute name="flag">
658 <xsd:simpleType>
659 <xsd:restriction base="xsd:string">
660 <xsd:annotation>
661 <xsd:documentation xml:lang="en">totprecip flag can be E I M or T only.
662 </xsd:documentation>
663 </xsd:annotation>
664 <xsd:enumeration value="E" />
665 <xsd:enumeration value="I" />
666 <xsd:enumeration value="M" />
667 <xsd:enumeration value="T" />
668 </xsd:restriction>
669 </xsd:simpleType>
670 </xsd:attribute>
671 </xsd:attributeGroup>
672
673 <xsd:attributeGroup name="attrgroup-grndsnowlastday">
674 <xsd:attribute name="units" use="required">
675 <xsd:simpleType>
676 <xsd:restriction base="xsd:string">
677 <xsd:annotation>
678 <xsd:documentation xml:lang="en">grndsnowlastday unit must be provided in cm.
679 </xsd:documentation>
680 </xsd:annotation>
681 <xsd:enumeration value="cm" />
682 </xsd:restriction>
683 </xsd:simpleType>
684 </xsd:attribute>
685 <xsd:attribute name="description" use="optional" />
686 <xsd:attribute name="flag">
687 <xsd:simpleType>
688 <xsd:restriction base="xsd:string">
689 <xsd:annotation>
690 <xsd:documentation xml:lang="en">grndsnowlastday flag can be E M or T only.
691 </xsd:documentation>
692 </xsd:annotation>
693 <xsd:enumeration value="E" />
694 <xsd:enumeration value="M" />
695 <xsd:enumeration value="T" />
696 </xsd:restriction>
697 </xsd:simpleType>
698 </xsd:attribute>
699 </xsd:attributeGroup>
700
701 <xsd:attributeGroup name="attrgroup-dirmaxgust">
702 <xsd:attribute name="units" use="required">
703 <xsd:simpleType>
704 <xsd:restriction base="xsd:string">
705 <xsd:annotation>
706 <xsd:documentation xml:lang="en">dirmaxgust unit must be provided in 10's Deg.
707 </xsd:documentation>
708 </xsd:annotation>
709 <xsd:enumeration value="10's Deg" />
710 </xsd:restriction>
711 </xsd:simpleType>
712 </xsd:attribute>
713 <xsd:attribute name="description" use="optional" />
714 <xsd:attribute name="flag">
715 <xsd:simpleType>
716 <xsd:restriction base="xsd:string">
717 <xsd:annotation>
718 <xsd:documentation xml:lang="en">dirmaxgust flag can be B E I M or S only.
719 </xsd:documentation>
720 </xsd:annotation>
721 <xsd:enumeration value="B" />
722 <xsd:enumeration value="E" />
723 <xsd:enumeration value="I" />
724 <xsd:enumeration value="M" />
725 <xsd:enumeration value="S" />
726 </xsd:restriction>
727 </xsd:simpleType>
728 </xsd:attribute>
729 </xsd:attributeGroup>
730
731 <xsd:attributeGroup name="attrgroup-speedmaxgust">
732 <xsd:attribute name="units" use="required">
733 <xsd:simpleType>
734 <xsd:restriction base="xsd:string">
735 <xsd:annotation>
736 <xsd:documentation xml:lang="en">speedmaxgust unit must be provided in km/h.
737 </xsd:documentation>
738 </xsd:annotation>
739 <xsd:enumeration value="km/h"/>
740 </xsd:restriction>
741 </xsd:simpleType>
742 </xsd:attribute>
743 <xsd:attribute name="description" use="optional" />
744 <xsd:attribute name="flag">
745 <xsd:simpleType>
746 <xsd:restriction base="xsd:string">
747 <xsd:annotation>
748 <xsd:documentation xml:lang="en">speedmaxgust flag can be B E I M or S only.
749 </xsd:documentation>
750 </xsd:annotation>
751 <xsd:enumeration value="B" />
752 <xsd:enumeration value="E" />
753 <xsd:enumeration value="I" />
754 <xsd:enumeration value="M" />
755 <xsd:enumeration value="S" />
756 </xsd:restriction>
757 </xsd:simpleType>
758 </xsd:attribute>
759 </xsd:attributeGroup>
760
761 <xsd:attributeGroup name="attrgroup-month">
762 <xsd:attribute name="index" use="required">
763 <xsd:simpleType>
764 <xsd:restriction base="xsd:integer">
765 <xsd:minInclusive value="1" />
766 <xsd:maxInclusive value="12" />
767 </xsd:restriction>
768 </xsd:simpleType>
769 </xsd:attribute>
770 </xsd:attributeGroup>
771
772 <xsd:attributeGroup name="attrgroup-day">
773 <xsd:attribute name="index" use="required">
774 <xsd:simpleType>
775 <xsd:restriction base="xsd:integer">
776 <xsd:minInclusive value="1" />
777 <xsd:maxInclusive value="31" />
778 </xsd:restriction>
779 </xsd:simpleType>
780 </xsd:attribute>
781 </xsd:attributeGroup>
782
783 <xsd:attributeGroup name="attrgroup-temperature">
784 <xsd:attribute name="class" use="required">
785 <xsd:simpleType>
786 <xsd:restriction base="xsd:string">
787 <xsd:enumeration value="extremeMax" />
788 <xsd:enumeration value="extremeMin" />
789 <xsd:enumeration value="normalMax" />
790 <xsd:enumeration value="normalMin" />
791 <xsd:enumeration value="normalMean" />
792 </xsd:restriction>
793 </xsd:simpleType>
794 </xsd:attribute>
795 <xsd:attribute name="units" use="required">
796 <xsd:simpleType>
797 <xsd:restriction base="xsd:string">
798 <xsd:annotation>
799 <xsd:documentation xml:lang="en">temperature must be provided in °C.
800 </xsd:documentation>
801 </xsd:annotation>
802 <xsd:enumeration value="°C" />
803 </xsd:restriction>
804 </xsd:simpleType>
805 </xsd:attribute>
806 <xsd:attribute name="unitType" use="required">
807 <xsd:simpleType>
808 <xsd:restriction base="xsd:string">
809 <xsd:annotation>
810 <xsd:documentation xml:lang="en">unitType must be provided metric.
811 </xsd:documentation>
812 </xsd:annotation>
813 <xsd:enumeration value="metric" />
814 </xsd:restriction>
815 </xsd:simpleType>
816 </xsd:attribute>
817 <xsd:attribute name="period" use="optional" />
818 <xsd:attribute name="year" use="optional">
819 <xsd:simpleType>
820 <xsd:restriction base="xsd:integer">
821 <xsd:minInclusive value="1840" />
822 <xsd:maxInclusive value="2020" />
823 </xsd:restriction>
824 </xsd:simpleType>
825 </xsd:attribute>
826 <xsd:attribute name="quality" use="optional">
827 <xsd:simpleType>
828 <xsd:restriction base="xsd:string">
829 <xsd:enumeration value="†" />
830 </xsd:restriction>
831 </xsd:simpleType>
832 </xsd:attribute>
833 </xsd:attributeGroup>
834
835 <xsd:attributeGroup name="attrgroup-precipitation">
836 <xsd:attribute name="class" use="required">
837 <xsd:simpleType>
838 <xsd:restriction base="xsd:string">
839 <xsd:enumeration value="extremeRainfall" />
840 <xsd:enumeration value="extremeSnowfall" />
841 <xsd:enumeration value="extremePrecipitation" />
842 <xsd:enumeration value="extremeSnowOnGround" />
843 </xsd:restriction>
844 </xsd:simpleType>
845 </xsd:attribute>
846 <xsd:attribute name="units" use="required">
847 <xsd:simpleType>
848 <xsd:restriction base="xsd:string">
849 <xsd:annotation>
850 <xsd:documentation xml:lang="en">precipitation must be provided in mm or cm.
851 </xsd:documentation>
852 </xsd:annotation>
853 <xsd:enumeration value="mm" />
854 <xsd:enumeration value="cm" />
855 </xsd:restriction>
856 </xsd:simpleType>
857 </xsd:attribute>
858 <xsd:attribute name="unitType" use="required">
859 <xsd:simpleType>
860 <xsd:restriction base="xsd:string">
861 <xsd:annotation>
862 <xsd:documentation xml:lang="en">unitType must be provided metric.
863 </xsd:documentation>
864 </xsd:annotation>
865 <xsd:enumeration value="metric" />
866 </xsd:restriction>
867 </xsd:simpleType>
868 </xsd:attribute>
869 <xsd:attribute name="period" use="required" />
870 <xsd:attribute name="year" use="optional">
871 <xsd:simpleType>
872 <xsd:restriction base="xsd:integer">
873 <xsd:minInclusive value="1840" />
874 <xsd:maxInclusive value="2020" />
875 </xsd:restriction>
876 </xsd:simpleType>
877 </xsd:attribute>
878 <xsd:attribute name="quality" use="optional">
879 <xsd:simpleType>
880 <xsd:restriction base="xsd:string">
881 <xsd:enumeration value="†" />
882 </xsd:restriction>
883 </xsd:simpleType>
884 </xsd:attribute>
885 </xsd:attributeGroup>
886
887 <xsd:attributeGroup name="attrgroup-pop">
888 <xsd:attribute name="units" use="required">
889 <xsd:simpleType>
890 <xsd:restriction base="xsd:string">
891 <xsd:enumeration value="%" />
892 </xsd:restriction>
893 </xsd:simpleType>
894 </xsd:attribute>
895 </xsd:attributeGroup>
896
897 <!-- Define types -->
898 <xsd:simpleType name="meanmaxtemp-values">
899 <xsd:union memberTypes="empty">
900 <xsd:simpleType>
901 <xsd:restriction base="xsd:float">
902 <xsd:minInclusive value="-45.6" />
903 <xsd:maxInclusive value="35.8">
904 <xsd:annotation>
905 <xsd:documentation xml:lang="en">Max value is currently 19.3.
906 </xsd:documentation>
907 </xsd:annotation>
908 </xsd:maxInclusive>
909 </xsd:restriction>
910 </xsd:simpleType>
911 </xsd:union>
912 </xsd:simpleType>
913
914 <xsd:simpleType name="meanmintemp-values">
915 <xsd:union memberTypes="empty">
916 <xsd:simpleType>
917 <xsd:restriction base="xsd:float">
918 <xsd:minInclusive value="-50.1" />
919 <xsd:maxInclusive value="22.3">
920 <xsd:annotation>
921 <xsd:documentation xml:lang="en">Max value is currently 22.3.
922 </xsd:documentation>
923 </xsd:annotation>
924 </xsd:maxInclusive>
925 </xsd:restriction>
926 </xsd:simpleType>
927 </xsd:union>
928 </xsd:simpleType>
929
930 <xsd:simpleType name="meanmonthtemp-values">
931 <xsd:union memberTypes="empty">
932 <xsd:simpleType>
933 <xsd:restriction base="xsd:float">
934 <xsd:minInclusive value="-47.9" />
935 <xsd:maxInclusive value="27.2">
936 <xsd:annotation>
937 <xsd:documentation xml:lang="en">Max value is currently 27.2.
938 </xsd:documentation>
939 </xsd:annotation>
940 </xsd:maxInclusive>
941 </xsd:restriction>
942 </xsd:simpleType>
943 </xsd:union>
944 </xsd:simpleType>
945
946 <xsd:simpleType name="extrmaxtemp-values">
947 <xsd:union memberTypes="empty">
948 <xsd:simpleType>
949 <xsd:restriction base="xsd:float">
950 <xsd:minInclusive value="-40.0" />
951 <xsd:maxInclusive value="45.0">
952 <xsd:annotation>
953 <xsd:documentation xml:lang="en">Max value is currently 45.0.
954 </xsd:documentation>
955 </xsd:annotation>
956 </xsd:maxInclusive>
957 </xsd:restriction>
958 </xsd:simpleType>
959 </xsd:union>
960 </xsd:simpleType>
961
962 <xsd:simpleType name="extrmintemp-values">
963 <xsd:union memberTypes="empty">
964 <xsd:simpleType>
965 <xsd:restriction base="xsd:float">
966 <xsd:minInclusive value="-63" />
967 <xsd:maxInclusive value="37.3">
968 <xsd:annotation>
969 <xsd:documentation xml:lang="en">Max value is currently 37.3.
970 </xsd:documentation>
971 </xsd:annotation>
972 </xsd:maxInclusive>
973 </xsd:restriction>
974 </xsd:simpleType>
975 </xsd:union>
976 </xsd:simpleType>
977
978 <xsd:simpleType name="total-rain-values">
979 <xsd:union memberTypes="sharps empty">
980 <xsd:annotation>
981 <xsd:documentation xml:lang="en">WARNING:
982 17/monthly/en_climate_monthly_BC_1010720_1910-1971_P1M.xml:32:616122
983 Contains only sharps instead of a float or empty content
984 </xsd:documentation>
985 </xsd:annotation>
986 <xsd:simpleType>
987 <xsd:restriction base="xsd:float">
988 <xsd:minInclusive value="0" />
989 <xsd:maxInclusive value="999.5">
990 <xsd:annotation>
991 <xsd:documentation xml:lang="en">TBD: Max value is currently 999.2.
992 Is it expected? Looks high and arbitrary cut at 1000.
993 </xsd:documentation>
994 </xsd:annotation>
995 </xsd:maxInclusive>
996 </xsd:restriction>
997 </xsd:simpleType>
998 </xsd:union>
999 </xsd:simpleType>
1000
1001 <xsd:simpleType name="total-snow-values">
1002 <xsd:union memberTypes="empty">
1003 <xsd:annotation>
1004 <xsd:documentation xml:lang="en">No value is allowed
1005 </xsd:documentation>
1006 </xsd:annotation>
1007 <xsd:simpleType>
1008 <xsd:restriction base="xsd:float">
1009 <xsd:minInclusive value="-15.1">
1010 <xsd:annotation>
1011 <xsd:documentation xml:lang="en">WARNING:
1012 monthly/3953/en_climate_monthly_ON_6032119_1970-2004_P1M.xml:32:261659
1013 Has negative totsnow value (-15.1)
1014 </xsd:documentation>
1015 </xsd:annotation>
1016 </xsd:minInclusive>
1017 <xsd:maxInclusive value="726">
1018 <xsd:annotation>
1019 <xsd:documentation xml:lang="en">Max value is currently 725.9.
1020 </xsd:documentation>
1021 </xsd:annotation>
1022 </xsd:maxInclusive>
1023 </xsd:restriction>
1024 </xsd:simpleType>
1025 </xsd:union>
1026 </xsd:simpleType>
1027
1028 <xsd:simpleType name="total-precipitation-values">
1029 <xsd:union memberTypes="sharps empty">
1030 <xsd:annotation>
1031 <xsd:documentation xml:lang="en">WARNING:
1032 17/monthly/en_climate_monthly_BC_1010720_1910-1971_P1M.xml:32:73731
1033 Contains only sharps instead of a float or empty content
1034 </xsd:documentation>
1035 </xsd:annotation>
1036 <xsd:simpleType>
1037 <xsd:restriction base="xsd:float">
1038 <xsd:minInclusive value="0">
1039 <xsd:annotation>
1040 <xsd:documentation xml:lang="en">No negative precipitation value allowed.
1041 </xsd:documentation>
1042 </xsd:annotation>
1043 </xsd:minInclusive>
1044 <xsd:maxInclusive value="999.5">
1045 <xsd:annotation>
1046 <xsd:documentation xml:lang="en">Max value is currently 999.2.
1047 Is it expected? Looks high and arbitrary cut at 1000.
1048 </xsd:documentation>
1049 </xsd:annotation>
1050 </xsd:maxInclusive>
1051 </xsd:restriction>
1052 </xsd:simpleType>
1053 </xsd:union>
1054 </xsd:simpleType>
1055
1056 <xsd:simpleType name="total-grndsnowlastday">
1057 <xsd:union memberTypes="empty">
1058 <xsd:annotation>
1059 <xsd:documentation xml:lang="en">No value is allowed
1060 </xsd:documentation>
1061 </xsd:annotation>
1062 <xsd:simpleType>
1063 <xsd:restriction base="xsd:integer">
1064 <xsd:minInclusive value="0">
1065 <xsd:annotation>
1066 <xsd:documentation xml:lang="en">No negative precipitation value allowed.
1067 </xsd:documentation>
1068 </xsd:annotation>
1069 </xsd:minInclusive>
1070 <xsd:maxInclusive value="955">
1071 <xsd:annotation>
1072 <xsd:documentation xml:lang="en">Max value is currently 955.
1073 Is it expected? Looks high and arbitrary cut at 1000.
1074 </xsd:documentation>
1075 </xsd:annotation>
1076 </xsd:maxInclusive>
1077 </xsd:restriction>
1078 </xsd:simpleType>
1079 </xsd:union>
1080 </xsd:simpleType>
1081
1082 <xsd:simpleType name="total-dirmaxgust">
1083 <xsd:union memberTypes="empty">
1084 <xsd:annotation>
1085 <xsd:documentation xml:lang="en">No value is allowed
1086 </xsd:documentation>
1087 </xsd:annotation>
1088 <xsd:simpleType>
1089 <xsd:restriction base="xsd:integer">
1090 <xsd:minInclusive value="0">
1091 <xsd:annotation>
1092 <xsd:documentation xml:lang="en">No negative orientation value allowed. Value of 0 is allowed
1093 </xsd:documentation>
1094 </xsd:annotation>
1095 </xsd:minInclusive>
1096 <xsd:maxInclusive value="36">
1097 <xsd:annotation>
1098 <xsd:documentation xml:lang="en">WARNING: Value of 36 is allowed.
1099 </xsd:documentation>
1100 </xsd:annotation>
1101 </xsd:maxInclusive>
1102 </xsd:restriction>
1103 </xsd:simpleType>
1104 </xsd:union>
1105 </xsd:simpleType>
1106
1107 <xsd:simpleType name="total-speedmaxgust">
1108 <xsd:union memberTypes="lt31 empty">
1109 <xsd:annotation>
1110 <xsd:documentation xml:lang="en">No value is allowed
1111 </xsd:documentation>
1112 </xsd:annotation>
1113 <xsd:simpleType>
1114 <xsd:restriction base="xsd:integer">
1115 <xsd:minInclusive value="0">
1116 <xsd:annotation>
1117 <xsd:documentation xml:lang="en">No negative speed allowed.
1118 </xsd:documentation>
1119 </xsd:annotation>
1120 </xsd:minInclusive>
1121 <xsd:maxInclusive value="467">
1122 <xsd:annotation>
1123 <xsd:documentation xml:lang="en">WARNING: Max value is currently 467.
1124 Probably an error
1125 </xsd:documentation>
1126 </xsd:annotation>
1127 </xsd:maxInclusive>
1128 </xsd:restriction>
1129 </xsd:simpleType>
1130 </xsd:union>
1131 </xsd:simpleType>
1132
1133 <xsd:simpleType name="temperature-values">
1134 <xsd:union memberTypes="empty">
1135 <xsd:simpleType>
1136 <xsd:restriction base="xsd:float">
1137 <xsd:minInclusive value="-63.0" />
1138 <xsd:maxInclusive value="50.0">
1139 <xsd:annotation>
1140 <xsd:documentation xml:lang="en">Value is currently between -63.0 and 50.0.
1141 </xsd:documentation>
1142 </xsd:annotation>
1143 </xsd:maxInclusive>
1144 </xsd:restriction>
1145 </xsd:simpleType>
1146 </xsd:union>
1147 </xsd:simpleType>
1148
1149 <xsd:simpleType name="precipitation-values">
1150 <xsd:union memberTypes="sharps empty">
1151 <xsd:simpleType>
1152 <xsd:restriction base="xsd:float">
1153 <xsd:minInclusive value="0.0" />
1154 <xsd:maxInclusive value="999">
1155 <xsd:annotation>
1156 <xsd:documentation xml:lang="en">Max value is currently 999.
1157 </xsd:documentation>
1158 </xsd:annotation>
1159 </xsd:maxInclusive>
1160 </xsd:restriction>
1161 </xsd:simpleType>
1162 </xsd:union>
1163 </xsd:simpleType>
1164
1165 <xsd:simpleType name="pop-values">
1166 <xsd:union memberTypes="empty">
1167 <xsd:simpleType>
1168 <xsd:restriction base="xsd:float">
1169 <xsd:minInclusive value="0.0" />
1170 <xsd:maxInclusive value="100.0">
1171 <xsd:annotation>
1172 <xsd:documentation xml:lang="en">Percentage.</xsd:documentation>
1173 </xsd:annotation>
1174 </xsd:maxInclusive>
1175 </xsd:restriction>
1176 </xsd:simpleType>
1177 </xsd:union>
1178 </xsd:simpleType>
1179
1180 <xsd:simpleType name="empty">
1181 <xsd:restriction base="xsd:string">
1182 <xsd:length value="0" />
1183 </xsd:restriction>
1184 </xsd:simpleType>
1185
1186 <xsd:simpleType name="zero">
1187 <xsd:restriction base="xsd:float">
1188 <xsd:enumeration value="0.0" />
1189 </xsd:restriction>
1190 </xsd:simpleType>
1191
1192 <xsd:simpleType name="sharps">
1193 <xsd:restriction base="xsd:string">
1194 <xsd:pattern value="#+" />
1195 </xsd:restriction>
1196 </xsd:simpleType>
1197
1198 <xsd:simpleType name="lt31">
1199 <xsd:restriction base="xsd:string">
1200 <xsd:pattern value="&lt;31" />
1201 </xsd:restriction>
1202 </xsd:simpleType>
1203 </xsd:schema>