1 <?xml version=
"1.0" encoding=
"utf-8"?>
3 Schemas required to validate WDEF compatible XML content.
4 Copyright (C) 2020, 2021 Pierre Choffet
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
19 <xsd:schema xml:
lang=
"en" xmlns:
wdef=
"https://purl.choffet.net/wdef"
20 xmlns:
xsd=
"http://www.w3.org/2001/XMLSchema"
21 targetNamespace=
"https://purl.choffet.net/wdef" attributeFormDefault=
"qualified"
22 elementFormDefault=
"qualified">
23 <xsd:import namespace=
"http://www.w3.org/XML/1998/namespace" schemaLocation=
"xml.xsd" />
25 <xsd:element name=
"knowledge">
28 The root of a WDEF content. It can contain one or more element only.
33 <xsd:element ref=
"wdef:element" minOccurs=
"0" maxOccurs=
"unbounded" />
37 <xsd:key name=
"key-element">
38 <xsd:selector xpath=
"wdef:element" />
39 <xsd:field xpath=
"@wdef:id" />
43 <xsd:element name=
"element">
50 <xsd:choice maxOccurs=
"unbounded">
51 <xsd:element ref=
"wdef:label" />
52 <xsd:element ref=
"wdef:description" />
53 <xsd:element ref=
"wdef:alias" />
54 <xsd:element ref=
"wdef:property" />
56 <xsd:attribute name=
"id" type=
"wdef:element-id" use=
"required" />
57 <xsd:anyAttribute processContents=
"skip" />
60 <xsd:key name=
"key-property">
61 <xsd:selector xpath=
"wdef:property" />
62 <xsd:field xpath=
"@wdef:id" />
65 <xsd:key name=
"key-value">
66 <xsd:selector xpath=
"wdef:value" />
67 <xsd:field xpath=
"@wdef:id" />
70 <xsd:unique name=
"unique-label-lang">
71 <xsd:selector xpath=
"wdef:label" />
72 <xsd:field xpath=
"@xml:lang" />
75 <xsd:unique name=
"unique-description-lang">
76 <xsd:selector xpath=
"wdef:description" />
77 <xsd:field xpath=
"@xml:lang" />
81 <xsd:element name=
"label" type=
"wdef:translation" />
82 <xsd:element name=
"description" type=
"wdef:translation" />
83 <xsd:element name=
"alias" type=
"wdef:translation" />
85 <xsd:element name=
"property">
92 <xsd:choice maxOccurs=
"unbounded">
93 <xsd:element ref=
"wdef:value" />
94 <xsd:element ref=
"wdef:novalue" maxOccurs=
"1" />
95 <xsd:element ref=
"wdef:somevalue" maxOccurs=
"1" />
97 <xsd:attribute name=
"id" type=
"wdef:property-id2" use=
"required" />
98 <xsd:attribute name=
"pid" type=
"wdef:property-id" use=
"required" />
99 <xsd:anyAttribute processContents=
"skip" />
103 <xsd:element name=
"value">
110 <xsd:choice maxOccurs=
"unbounded">
111 <xsd:element ref=
"wdef:literal" maxOccurs=
"1" />
112 <xsd:element ref=
"wdef:ref-element" maxOccurs=
"1" />
113 <xsd:element ref=
"wdef:translation" maxOccurs=
"1" />
114 <xsd:element ref=
"wdef:quantity" maxOccurs=
"1" />
115 <xsd:element ref=
"wdef:time" maxOccurs=
"1" />
116 <xsd:element ref=
"wdef:coordinate" maxOccurs=
"1" />
117 <xsd:element ref=
"wdef:qualifier" />
119 <xsd:attribute name=
"id" type=
"wdef:value-id" use=
"required" />
123 <xsd:element name=
"literal" type=
"xsd:normalizedString" />
125 <xsd:element name=
"ref-element" type=
"wdef:element-id" />
127 <xsd:element name=
"translation" type=
"wdef:translation" />
129 <xsd:element name=
"quantity">
132 <xsd:extension base=
"xsd:decimal">
133 <xsd:attribute name=
"unit" type=
"wdef:element-id" use=
"required" />
139 <xsd:element name=
"time">
142 <xsd:extension base=
"wdef:date-time">
143 <xsd:attribute name=
"precision" use=
"required">
145 <xsd:restriction base=
"xsd:positiveInteger">
146 <xsd:maxInclusive value=
"14" />
150 <xsd:attribute name=
"calendar" use=
"required">
152 <xsd:restriction base=
"xsd:normalizedString">
153 <xsd:enumeration value=
"julian" />
154 <xsd:enumeration value=
"gregorian" />
163 <xsd:element name=
"coordinate">
166 <xsd:extension base=
"wdef:date-time">
167 <xsd:attribute name=
"latitude" use=
"required">
169 <xsd:restriction base=
"xsd:float">
170 <xsd:minInclusive value=
"-90" />
171 <xsd:maxInclusive value=
"90" />
175 <xsd:attribute name=
"longitude" use=
"required">
177 <xsd:restriction base=
"xsd:float">
178 <xsd:minInclusive value=
"-180" />
179 <xsd:maxInclusive value=
"180" />
188 <xsd:element name=
"novalue">
190 <xsd:choice maxOccurs=
"unbounded">
191 <xsd:element ref=
"wdef:qualifier" />
193 <xsd:attribute name=
"id" type=
"wdef:value-id" use=
"required" />
197 <xsd:element name=
"somevalue">
201 <xsd:element name=
"qualifier">
204 <xsd:element ref=
"wdef:property" />
206 <xsd:anyAttribute processContents=
"skip" />
210 <!-- Attributes groups -->
213 <xsd:complexType name=
"translation">
215 <xsd:extension base=
"wdef:non-empty-normalized-string">
216 <xsd:attribute ref=
"xml:lang" use=
"required" />
221 <xsd:simpleType name=
"element-id">
222 <xsd:restriction base=
"xsd:normalizedString">
223 <xsd:pattern value=
"(\?E|Q)[0-9]+" />
227 <xsd:simpleType name=
"property-id">
228 <xsd:restriction base=
"xsd:normalizedString">
229 <xsd:pattern value=
"P[0-9]+" />
233 <xsd:simpleType name=
"property-id2">
234 <xsd:restriction base=
"xsd:normalizedString">
235 <xsd:pattern value=
"\?P[0-9\?\-EP]+" />
239 <xsd:simpleType name=
"value-id">
240 <xsd:restriction base=
"xsd:normalizedString">
241 <xsd:pattern value=
"\?V.+" />
245 <xsd:simpleType name=
"non-empty-normalized-string">
246 <xsd:restriction base=
"xsd:normalizedString">
247 <xsd:minLength value=
"1" />
251 <xsd:simpleType name=
"date-time">
252 <xsd:restriction base=
"xsd:normalizedString">
253 <xsd:pattern value=
"(-|\+)[0-9]+-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z" />