1 |
9238
|
tao
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
|
|
<schema targetNamespace="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1.2">
|
3 |
|
|
<annotation>
|
4 |
|
|
<appinfo source="urn:opengis:specification:gml:schema-xsd:gmlBase:3.1.1">
|
5 |
|
|
<sch:title>Schematron validation</sch:title>
|
6 |
|
|
<sch:ns prefix="gml" uri="http://www.opengis.net/gml"/>
|
7 |
|
|
<sch:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
|
8 |
|
|
<sch:pattern name="Check either href or content not both">
|
9 |
|
|
<sch:rule abstract="true" id="hrefOrContent">
|
10 |
|
|
<sch:report test="@xlink:href and (*|text())">Property element may not carry both a reference to an object and contain an object.</sch:report>
|
11 |
|
|
<sch:assert test="@xlink:href | (*|text())">Property element must either carry a reference to an object or contain an object.</sch:assert>
|
12 |
|
|
</sch:rule>
|
13 |
|
|
</sch:pattern>
|
14 |
|
|
</appinfo>
|
15 |
|
|
<documentation>GML base schema for GML 3
|
16 |
|
|
Components to support the GML encoding model.
|
17 |
|
|
The abstract Schematron rules can be used by any schema that includes gmlBase.
|
18 |
|
|
|
19 |
|
|
GML is an OGC Standard.
|
20 |
|
|
Copyright (c) 2001,2005,2010 Open Geospatial Consortium.
|
21 |
|
|
To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ .
|
22 |
|
|
</documentation>
|
23 |
|
|
</annotation>
|
24 |
|
|
<!-- ==============================================================
|
25 |
|
|
includes and imports
|
26 |
|
|
============================================================== -->
|
27 |
|
|
<include schemaLocation="gml.xsd"/>
|
28 |
|
|
<include schemaLocation="basicTypes.xsd"/>
|
29 |
|
|
<import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.w3.org/1999/xlink.xsd"/>
|
30 |
|
|
<!-- =========================================================== -->
|
31 |
|
|
<!-- ==================== Objects ================================ -->
|
32 |
|
|
<!-- =========================================================== -->
|
33 |
|
|
<!-- =========== Abstract "Object" is "anyType" ============= -->
|
34 |
|
|
<!-- ===== Global element at the head of the "Object" substitution group ======== -->
|
35 |
|
|
<element name="_Object" abstract="true">
|
36 |
|
|
<annotation>
|
37 |
|
|
<documentation>This abstract element is the head of a substitutionGroup hierararchy which may contain either simpleContent or complexContent elements. It is used to assert the model position of "class" elements declared in other GML schemas.</documentation>
|
38 |
|
|
</annotation>
|
39 |
|
|
</element>
|
40 |
|
|
<!-- ============================================================= -->
|
41 |
|
|
<!-- =========== Abstract "GMLobject" supertype ========================= -->
|
42 |
|
|
<element name="_GML" type="gml:AbstractGMLType" abstract="true" substitutionGroup="gml:_Object">
|
43 |
|
|
<annotation>
|
44 |
|
|
<documentation>Global element which acts as the head of a substitution group that may include any element which is a GML feature, object, geometry or complex value</documentation>
|
45 |
|
|
</annotation>
|
46 |
|
|
</element>
|
47 |
|
|
<!-- =========================================================== -->
|
48 |
|
|
<group name="StandardObjectProperties">
|
49 |
|
|
<annotation>
|
50 |
|
|
<documentation>This content model group makes it easier to construct types that
|
51 |
|
|
derive from AbstractGMLType and its descendents "by restriction".
|
52 |
|
|
A reference to the group saves having to enumerate the standard object properties.</documentation>
|
53 |
|
|
</annotation>
|
54 |
|
|
<sequence>
|
55 |
|
|
<element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
|
56 |
|
|
<element ref="gml:description" minOccurs="0"/>
|
57 |
|
|
<element ref="gml:name" minOccurs="0" maxOccurs="unbounded">
|
58 |
|
|
<annotation>
|
59 |
|
|
<documentation>Multiple names may be provided. These will often be distinguished by being assigned by different authorities, as indicated by the value of the codeSpace attribute. In an instance document there will usually only be one name per authority.</documentation>
|
60 |
|
|
</annotation>
|
61 |
|
|
</element>
|
62 |
|
|
</sequence>
|
63 |
|
|
</group>
|
64 |
|
|
<!-- =========================================================== -->
|
65 |
|
|
<complexType name="AbstractGMLType" abstract="true">
|
66 |
|
|
<annotation>
|
67 |
|
|
<documentation>All complexContent GML elements are directly or indirectly derived from this abstract supertype
|
68 |
|
|
to establish a hierarchy of GML types that may be distinguished from other XML types by their ancestry.
|
69 |
|
|
Elements in this hierarchy may have an ID and are thus referenceable.</documentation>
|
70 |
|
|
</annotation>
|
71 |
|
|
<sequence>
|
72 |
|
|
<group ref="gml:StandardObjectProperties"/>
|
73 |
|
|
</sequence>
|
74 |
|
|
<attribute ref="gml:id" use="optional"/>
|
75 |
|
|
</complexType>
|
76 |
|
|
<!-- =========================================================== -->
|
77 |
|
|
<!-- =========== Concrete "Collection" supertype ========================= -->
|
78 |
|
|
<element name="Bag" type="gml:BagType" substitutionGroup="gml:_GML">
|
79 |
|
|
<annotation>
|
80 |
|
|
<documentation>Generic GML element to contain a heterogeneous collection of GML _Objects</documentation>
|
81 |
|
|
</annotation>
|
82 |
|
|
</element>
|
83 |
|
|
<!-- =========================================================== -->
|
84 |
|
|
<complexType name="BagType">
|
85 |
|
|
<annotation>
|
86 |
|
|
<documentation>A non-abstract generic collection type that can be used as a document element for a collection of any GML types - Geometries, Topologies, Features ...
|
87 |
|
|
|
88 |
|
|
FeatureCollections may only contain Features. GeometryCollections may only contain Geometrys. Bags are less constrained they must contain objects that are substitutable for gml:_Object. This may mix several levels, including Features, Definitions, Dictionaries, Geometries etc.
|
89 |
|
|
|
90 |
|
|
The content model would ideally be
|
91 |
|
|
member 0..*
|
92 |
|
|
members 0..1
|
93 |
|
|
member 0..*
|
94 |
|
|
for maximum flexibility in building a collection from both homogeneous and distinct components:
|
95 |
|
|
included "member" elements each contain a single Object
|
96 |
|
|
an included "members" element contains a set of Objects
|
97 |
|
|
|
98 |
|
|
However, this is non-deterministic, thus prohibited by XSD.</documentation>
|
99 |
|
|
</annotation>
|
100 |
|
|
<complexContent>
|
101 |
|
|
<extension base="gml:AbstractGMLType">
|
102 |
|
|
<sequence>
|
103 |
|
|
<element ref="gml:member" minOccurs="0" maxOccurs="unbounded"/>
|
104 |
|
|
<element ref="gml:members" minOccurs="0"/>
|
105 |
|
|
</sequence>
|
106 |
|
|
</extension>
|
107 |
|
|
</complexContent>
|
108 |
|
|
</complexType>
|
109 |
|
|
<!-- =========================================================== -->
|
110 |
|
|
<!-- =========== Concrete "Array" supertype ========================= -->
|
111 |
|
|
<element name="Array" type="gml:ArrayType" substitutionGroup="gml:_GML">
|
112 |
|
|
<annotation>
|
113 |
|
|
<documentation>Generic GML element to contain a homogeneous array of GML _Objects</documentation>
|
114 |
|
|
</annotation>
|
115 |
|
|
</element>
|
116 |
|
|
<!-- ======================================================================= -->
|
117 |
|
|
<complexType name="ArrayType">
|
118 |
|
|
<annotation>
|
119 |
|
|
<documentation>A non-abstract generic collection type that can be used as a document element for a homogeneous collection of any GML types - Geometries, Topologies, Features ...</documentation>
|
120 |
|
|
</annotation>
|
121 |
|
|
<complexContent>
|
122 |
|
|
<extension base="gml:AbstractGMLType">
|
123 |
|
|
<sequence>
|
124 |
|
|
<element ref="gml:members" minOccurs="0"/>
|
125 |
|
|
</sequence>
|
126 |
|
|
</extension>
|
127 |
|
|
</complexContent>
|
128 |
|
|
</complexType>
|
129 |
|
|
<!-- =========================================================== -->
|
130 |
|
|
<!-- =========== Abstract Metadata supertype ========================= -->
|
131 |
|
|
<element name="_MetaData" type="gml:AbstractMetaDataType" abstract="true" substitutionGroup="gml:_Object">
|
132 |
|
|
<annotation>
|
133 |
|
|
<documentation>Abstract element which acts as the head of a substitution group for packages of MetaData properties.</documentation>
|
134 |
|
|
</annotation>
|
135 |
|
|
</element>
|
136 |
|
|
<!-- =========================================================== -->
|
137 |
|
|
<complexType name="AbstractMetaDataType" abstract="true" mixed="true">
|
138 |
|
|
<annotation>
|
139 |
|
|
<documentation>An abstract base type for complex metadata types.</documentation>
|
140 |
|
|
</annotation>
|
141 |
|
|
<attribute ref="gml:id" use="optional"/>
|
142 |
|
|
</complexType>
|
143 |
|
|
<!-- =========================================================== -->
|
144 |
|
|
<!-- =========== Container for Generic Metadata ========================= -->
|
145 |
|
|
<element name="GenericMetaData" type="gml:GenericMetaDataType" substitutionGroup="gml:_MetaData">
|
146 |
|
|
<annotation>
|
147 |
|
|
<documentation>Concrete element in the _MetaData substitution group, which permits any well-formed XML content. Intended to act as a container for metadata defined in external schemas, for which it is not possible to add the concrete components to the GML _MetaData substitution group directly. Deprecated with GML version 3.1.0.</documentation>
|
148 |
|
|
</annotation>
|
149 |
|
|
</element>
|
150 |
|
|
<!-- =========================================================== -->
|
151 |
|
|
<complexType name="GenericMetaDataType" mixed="true">
|
152 |
|
|
<annotation>
|
153 |
|
|
<documentation>Deprecated with GML version 3.1.0.</documentation>
|
154 |
|
|
</annotation>
|
155 |
|
|
<complexContent mixed="true">
|
156 |
|
|
<extension base="gml:AbstractMetaDataType">
|
157 |
|
|
<sequence>
|
158 |
|
|
<any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
|
159 |
|
|
</sequence>
|
160 |
|
|
</extension>
|
161 |
|
|
</complexContent>
|
162 |
|
|
</complexType>
|
163 |
|
|
<!-- ================================================================== -->
|
164 |
|
|
<!-- ================== Base Property Types ============================== -->
|
165 |
|
|
<!-- ================================================================== -->
|
166 |
|
|
<!-- ==== property types for unspecified association - by Value or by Reference ==== -->
|
167 |
|
|
<!-- ====== single Objects - by Value or by Reference ======== -->
|
168 |
|
|
<element name="_association" type="gml:AssociationType" abstract="true"/>
|
169 |
|
|
<!-- =========================================================== -->
|
170 |
|
|
<element name="_strictAssociation" type="gml:AssociationType" abstract="true">
|
171 |
|
|
<annotation>
|
172 |
|
|
<appinfo>
|
173 |
|
|
<sch:pattern name="refAndContent co-occurence prohibited">
|
174 |
|
|
<sch:rule context="gml:_strictAssociation">
|
175 |
|
|
<sch:extends rule="hrefOrContent"/>
|
176 |
|
|
</sch:rule>
|
177 |
|
|
</sch:pattern>
|
178 |
|
|
</appinfo>
|
179 |
|
|
<documentation>must carry a reference to an object or contain an object but not both</documentation>
|
180 |
|
|
</annotation>
|
181 |
|
|
</element>
|
182 |
|
|
<!-- =========================================================== -->
|
183 |
|
|
<element name="member" type="gml:AssociationType"/>
|
184 |
|
|
<!-- =========================================================== -->
|
185 |
|
|
<complexType name="AssociationType">
|
186 |
|
|
<annotation>
|
187 |
|
|
<documentation>A pattern or base for derived types used to specify complex types corresponding to an unspecified UML association - either composition or aggregation. Restricts the cardinality of Objects contained in the association to a maximum of one. An instance of this type can contain an element representing an Object, or serve as a pointer to a remote Object.
|
188 |
|
|
|
189 |
|
|
Descendents of this type can be restricted in an application schema to
|
190 |
|
|
* allow only specified classes as valid participants in the aggregation
|
191 |
|
|
* allow only association by reference (i.e. empty the content model) or by value (i.e. remove the xlinks).
|
192 |
|
|
|
193 |
|
|
When used for association by reference, the value of the gml:remoteSchema attribute can be used to locate a schema fragment that constrains the target instance.
|
194 |
|
|
|
195 |
|
|
In many cases it is desirable to impose the constraint prohibiting the occurence of both reference and value in the same instance, as that would be ambiguous. This is accomplished by adding a directive in the annotation element of the element declaration. This directive can be in the form of normative prose, or can use a Schematron pattern to automatically constrain co-occurrence - see the declaration for _strictAssociation below.
|
196 |
|
|
|
197 |
|
|
If co-occurence is not prohibited, then both a link and content may be present. If this occurs in an instance, then the rule for interpretation is that the instance found by traversing the href provides the normative value of the property, and should be used when possible. The value(s) included as content may be used if the remote instance cannot be resolved. This may be considered to be a "cached" version of the value(s).</documentation>
|
198 |
|
|
</annotation>
|
199 |
|
|
<sequence minOccurs="0">
|
200 |
|
|
<element ref="gml:_Object"/>
|
201 |
|
|
</sequence>
|
202 |
|
|
<attributeGroup ref="gml:AssociationAttributeGroup"/>
|
203 |
|
|
</complexType>
|
204 |
|
|
<!-- =========================================================== -->
|
205 |
|
|
<element name="_reference" type="gml:ReferenceType" abstract="true"/>
|
206 |
|
|
<!-- =========================================================== -->
|
207 |
|
|
<complexType name="ReferenceType">
|
208 |
|
|
<annotation>
|
209 |
|
|
<documentation>A pattern or base for derived types used to specify complex types corresponding to a UML aggregation association. An instance of this type serves as a pointer to a remote Object.</documentation>
|
210 |
|
|
</annotation>
|
211 |
|
|
<sequence/>
|
212 |
|
|
<attributeGroup ref="gml:AssociationAttributeGroup"/>
|
213 |
|
|
</complexType>
|
214 |
|
|
<!-- =========================================================== -->
|
215 |
|
|
<!-- ========= multiple objects - by Value or by Reference ================== -->
|
216 |
|
|
<element name="members" type="gml:ArrayAssociationType"/>
|
217 |
|
|
<!-- =========================================================== -->
|
218 |
|
|
<complexType name="ArrayAssociationType">
|
219 |
|
|
<annotation>
|
220 |
|
|
<documentation>A base for derived types used to specify complex types containing an array of objects, by unspecified UML association - either composition or aggregation. An instance of this type contains elements representing Objects.
|
221 |
|
|
|
222 |
|
|
Ideally this type would be derived by extension of AssociationType.
|
223 |
|
|
However, this leads to a non-deterministic content model, since both the base and the extension have minOccurs="0", and is thus prohibited in XML Schema.</documentation>
|
224 |
|
|
</annotation>
|
225 |
|
|
<sequence>
|
226 |
|
|
<element ref="gml:_Object" minOccurs="0" maxOccurs="unbounded"/>
|
227 |
|
|
</sequence>
|
228 |
|
|
</complexType>
|
229 |
|
|
<!-- =========================================================== -->
|
230 |
|
|
<!-- =========== Abstract "property" supertype ========================= -->
|
231 |
|
|
<element name="metaDataProperty" type="gml:MetaDataPropertyType">
|
232 |
|
|
<annotation>
|
233 |
|
|
<documentation>Contains or refers to a metadata package that contains metadata properties.</documentation>
|
234 |
|
|
</annotation>
|
235 |
|
|
</element>
|
236 |
|
|
<!-- =========================================================== -->
|
237 |
|
|
<complexType name="MetaDataPropertyType">
|
238 |
|
|
<annotation>
|
239 |
|
|
<documentation>Base type for complex metadata property types.</documentation>
|
240 |
|
|
</annotation>
|
241 |
|
|
<sequence minOccurs="0">
|
242 |
|
|
<any processContents="lax"/>
|
243 |
|
|
<!-- <element ref="gml:_MetaData"/> -->
|
244 |
|
|
</sequence>
|
245 |
|
|
<attributeGroup ref="gml:AssociationAttributeGroup"/>
|
246 |
|
|
<attribute name="about" type="anyURI" use="optional"/>
|
247 |
|
|
</complexType>
|
248 |
|
|
<!-- =========================================================== -->
|
249 |
|
|
<!-- ==========================================================
|
250 |
|
|
global attribute, attribute group and element declarations
|
251 |
|
|
============================================================ -->
|
252 |
|
|
<attribute name="id" type="ID">
|
253 |
|
|
<annotation>
|
254 |
|
|
<documentation>Database handle for the object. It is of XML type ID, so is constrained to be unique in the XML document within which it occurs. An external identifier for the object in the form of a URI may be constructed using standard XML and XPointer methods. This is done by concatenating the URI for the document, a fragment separator, and the value of the id attribute.</documentation>
|
255 |
|
|
</annotation>
|
256 |
|
|
</attribute>
|
257 |
|
|
<!-- =========================================================== -->
|
258 |
|
|
<attribute name="remoteSchema" type="anyURI">
|
259 |
|
|
<annotation>
|
260 |
|
|
<documentation>Reference to an XML Schema fragment that specifies the content model of the propertys value. This is in conformance with the XML Schema Section 4.14 Referencing Schemas from Elsewhere.</documentation>
|
261 |
|
|
</annotation>
|
262 |
|
|
</attribute>
|
263 |
|
|
<!-- =========================================================== -->
|
264 |
|
|
<attributeGroup name="AssociationAttributeGroup">
|
265 |
|
|
<annotation>
|
266 |
|
|
<documentation>Attribute group used to enable property elements to refer to their value remotely. It contains the simple link components from xlinks.xsd, with all members optional, and the remoteSchema attribute, which is also optional. These attributes can be attached to any element, thus allowing it to act as a pointer. The 'remoteSchema' attribute allows an element that carries link attributes to indicate that the element is declared in a remote schema rather than by the schema that constrains the current document instance.</documentation>
|
267 |
|
|
</annotation>
|
268 |
|
|
<attributeGroup ref="xlink:simpleAttrs"/>
|
269 |
|
|
<attribute ref="gml:remoteSchema" use="optional"/>
|
270 |
|
|
</attributeGroup>
|
271 |
|
|
<!-- =========================================================== -->
|
272 |
|
|
<element name="name" type="gml:CodeType">
|
273 |
|
|
<annotation>
|
274 |
|
|
<documentation>Label for the object, normally a descriptive name. An object may have several names, typically assigned by different authorities. The authority for a name is indicated by the value of its (optional) codeSpace attribute. The name may or may not be unique, as determined by the rules of the organization responsible for the codeSpace.</documentation>
|
275 |
|
|
</annotation>
|
276 |
|
|
</element>
|
277 |
|
|
<!-- =========================================================== -->
|
278 |
|
|
<element name="description" type="gml:StringOrRefType">
|
279 |
|
|
<annotation>
|
280 |
|
|
<documentation>Contains a simple text description of the object, or refers to an external description.</documentation>
|
281 |
|
|
</annotation>
|
282 |
|
|
</element>
|
283 |
|
|
<!-- ===================================================== -->
|
284 |
|
|
<complexType name="StringOrRefType">
|
285 |
|
|
<annotation>
|
286 |
|
|
<documentation>This type is available wherever there is a need for a "text" type property. It is of string type, so the text can be included inline, but the value can also be referenced remotely via xlinks from the AssociationAttributeGroup. If the remote reference is present, then the value obtained by traversing the link should be used, and the string content of the element can be used for an annotation.</documentation>
|
287 |
|
|
</annotation>
|
288 |
|
|
<simpleContent>
|
289 |
|
|
<extension base="string">
|
290 |
|
|
<attributeGroup ref="gml:AssociationAttributeGroup"/>
|
291 |
|
|
</extension>
|
292 |
|
|
</simpleContent>
|
293 |
|
|
</complexType>
|
294 |
|
|
<!-- ===================================================== -->
|
295 |
|
|
</schema>
|