Approved

OGC Standard

Geography Markup Language (GML) simple features profile (with Corrigendum)
Linda van den Brink Editor Clemens Portele Editor Panagiotis (Peter) A. Vretanos Editor
Version: 2.0
OGC Standard

Approved

Document number:10-100r3
Document type:OGC Standard
Document subtype:Profile
Document stage:Approved
Document language:English

License Agreement

Permission is hereby granted by the Open Geospatial Consortium, (“Licensor”), free of charge and subject to the terms set forth below, to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual Property is furnished agrees to the terms of this Agreement.

If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR.

THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTS THAT MAY BE IN FORCE ANYWHERE IN THE WORLD. THE INTELLECTUAL PROPERTY IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OF INTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY.

This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except as provided in the following sentence, no such termination of this license shall require the termination of any third party end-user sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent, copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy or cause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party.

Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any LICENSOR standards or specifications. This Agreement is governed by the laws of the Commonwealth of Massachusetts. The application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it.

None of the Intellectual Property or underlying information or technology may be downloaded or otherwise exported or reexported in violation of U.S. export laws and regulations. In addition, you are responsible for complying with any local laws in your jurisdiction which may impact your right to import, export or use the Intellectual Property, and you represent that you have complied with any regulations or registration procedures required by applicable law to make this license enforceable.

Suggested additions, changes and comments on this document are welcome and encouraged. Such suggestions may be submitted using the online change request form on OGC web site: http://portal.opengeospatial.org/public_ogc/change_request.php



I.  Preface

This approved OGC Implementation Standard defines a Simple Features profile of the Geography Markup Language version 3.2. This Simple Features Profile has been aligned with the OGC Simple Features standard for SQL version 1.2. Simple Features include: Point, Curve (LineString), Surface (Polygon), Geometry, MultiPoint, MultiCurve, MultiSurface, and MultiGeometry. The detailed abstract model for OGC features and geometry can be found in the OGC Abstract Specification, Topic Volume 1: Features (which is equivalent to ISO 19107).

This Simple Features profile of GML began as a product of OGC’s Interoperability Program: a global, collaborative, hands-on engineering and testing program designed to deliver prototype technologies and proven candidate standards into the OGC’s Specification Development Program. In OGC Interoperability Initiatives, international teams of technology providers work together to solve specific geo-processing interoperability problems posed by Initiative.

The Open Geospatial Consortium (OGC) is an international industry consortium of more than 435 companies, government agencies, and universities participating in a consensus process to develop publicly available geo-processing standards.

II.  Security considerations

No security considerations have been made for this document.

III.  Submitting Organizations

The following organizations submitted this Document to the Open Geospatial Consortium (OGC):

IV.  Document terms and definitions

This document uses the specification terms defined in sub-clause 5.3 of [OGC 06-021r3], which is based on the ISO/IEC Directives, Part 2: Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to comply with this standard.

V.  Document contributor contact points

All questions regarding this submission should be directed to the editor or the submitters:

Linda van den Brink
Geonovum

Clemens Portele
Interactive Instruments

Panagiotis (Peter) A. Vretanos
CubeWerx Inc.

Contributors:

Contact Company
Arctur, David formerly of ESRI
Bruce, Craig CubeWerx Inc.
Burggraf, David Galdos Inc.
Cox, Simon CSIRO
van den Brink, Linda Geonovum NL.
Daisey, Paul U.S. Census Bureau
Daly, Martin Cadcorp Ltd.
Danko, David ESRI
Herring, John Oracle
Keens, Stephen PCI Ltd.
Keighan, Edric CubeWerx Inc.
Kyle, Martin Galdos Inc.
May, Brian formerly of Cubewerx Inc.
Milanovic, Aleksander formerly of Galdos Inc.
Lake, Ron Galdos Inc.
Lemieux, Sylvain PCI Ltd.
Pomakis, Keith CubeWerx Inc.
Portele, Clemens Interactive Instrument GmbH
Ramsey, Paul Refractions Research Inc.
Scarponcini, Paul Bentley Systems Inc.
Sonnet, Jerome IONIC
Whiteside, Arliss BAE Systems E&IS

VI.  Changes to the OpenGIS® Abstract Specification

None.

VII.  Changes to existing Implementation Standards

None.

VIII.  Future work

This revision is a straightforward update of the previous version to another version of GML.

There are a number of open issues that need to be addressed in a future revision. This work needs to be undertaken in a new SWG to be initiated after adoption of this document. The scope of the SWG will include:

A particular item of discussion is the use of the term “simple feature profile” in conjunction with the levels SF-0 and SF-1 as they include restrictions on non-geometric feature properties that are not part of the Simple Feature Common Architecture standard.

IX.  Foreword

This version of the Geography Markup Language (GML) simple features profile supersedes the previous version 1.0 [OGC 06-049r1]. The primary technical change was to update the previous document to use GML 3.2.1 [OGC 07-036].

This document version is processed under the new fast track process of OGC as it is a straightforward update to support the use of GML 3.2 in a GML-SF context. There are known issues to be addressed in the next revision, see section “Future work”.

Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The OGC shall not be held responsible for identifying any or all such patent rights.

Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the standard set forth in this document, and to provide supporting documentation.

X.  Introduction

The GML standard declares a large number of XML elements and attributes meant to support a wide variety of capabilities. For example, the GML standard can be used to encode dynamic features, spatial and temporal topology, complex geometric property types and coverages. With such a wide scope, interoperability can only be achieved by defining profiles of GML that deal with a restricted subset of GML capabilities. Such profiles limit the number of GML object types that can appear in compliant schemas and consequently are easier to process.

The generation and parsing of Geographic Markup Language (GML) [OGC 07-036] and XML Schema [W3C XML-1, W3C XML-2] code are required in the implementation of many components that deal with GML encoded content. This profile defines a restricted but useful subset of XML-Schema and GML to lower the “implementation bar” of time and resources required for an organization to commit for developing software that supports GML. It is hoped that by lowering the effort required to manipulate XML encoded feature data, organizations will be encouraged to invest more time and effort to take greater advantage of GML’s rich functionality.

Development of this profile does not reduce the need for distinct communities of users to develop application schemas (data models) for information sharing. However, to the extent that users’ application schemas fit within the scope of GML-SF capabilities, this profile facilitates the ability to use WFS for interoperable feature data exchange with much less software development investment.

Geography Markup Language (GML) simple features profile (with Corrigendum)

1.  Scope

This OpenGIS® standard defines a simplified profile of GML 3.2 that supports GML features and a limited set of geometric types. A set of application schema encoding rules is defined that allow features to be encoded using GML application schemas. This version of the standard includes a technical note. There is an associated OGC document that details all of the necessary document changes related to the technical note. Further, this document has change tracking “on” so that all changes for the technical note can be more easily viewed.

This OGC® document defines:

  1. Rigid coding patterns for the use of a subset of XML Schema constructs (XML Schema profile)

  2. Rigid coding patterns for the use of a subset of GML constructs (GML profile).

This document prescribes the encoding of GML application schemas in sufficient detail that client applications do not need to deal with the entire scope of XML-Schema and GML but only need to understand a restricted subset of both standards in order to be able interpret schema documents referenced by data encoded in GML. It is expected that making it easier to interpret GML application schemas will enhance interoperability between clients and servers and make the task of implementing client applications less onerous.

This document specifies three compliance levels for this profile. Level 0 compliance is the simplest and easiest to understand, but does not support the entire set of GML features. Level 1 compliance is somewhat more complex and difficult to understand, but includes more feature encoding abilities sometimes needed. The “full” (level 2) compliance is the most complex, and is intended to include all the feature encoding abilities provided by the OpenGIS® Simple Features access — Part 1: Common architecture.

This document is applicable to any client wishing to interpret GML application schema documents in an ad hoc manner in order to interact with data encoded in GML. That is, this document is not meant to address the case where a community of interest has defined a standard GML application schema or set of schemas for exchanging geographic data, but rather the case where a client interacts with a previously unknown server offering data encoded in GML using a previously unknown GML application schema.

This profile does not address the semantic issues associated with interpreting a previously unknown GML application schema. Instead this document tries to simplify the processing required to determine which feature types a service offers, as well as the structure of those feature types (in terms of property names and data types).

2.  Conformance

2.1.  Intruduction

This document defines three compliance levels called SF-0, SF-1, and SF-2.

Compliance level SF-0 limits the property types of both spatial and non-spatial properties. Non-spatial properties are limited to being of type: integer, measurement, date, boolean, binary, URI, character or real; and cardinality of non-spatial properties is limited to at most one. Spatial properties are limited to being of type: point, curve with linear and/or circular arc interpolation, planar surface, or aggregates thereof. In GML instance documents compliant with level SF-0, values for a particular property may be encoded inline or by-reference but not both. By-reference property values are only supported through the use of the type gml:ReferenceType. The more generalized GML property-type pattern allowing mixed inline and by-reference encoded property values within the same instance document is disallowed in this level. Compliance level SF-1 supports everything in compliance level SF-0 but removes the restriction on value cardinality and allows user defined non-spatial property types to be used. As with compliance level SF-0, in GML instance documents compliant with level SF-1, values for a particular property may be encoded inline or by-reference but not both. By-reference property values are only supported through the use of the type gml:ReferenceType. The more generalized GML property-type pattern allowing mixed inline and by-reference encoded property values within the same instance document is disallowed in this level.

Finally, compliance level SF-2 essentially corresponds to the OGC Simple Features specification [1]. There are no restrictions placed on non-spatial properties. Spatial properties, however, are limited to the set of geometric types supported by compliance levels SF-0 and SF-1. In instance documents, the restriction on remote or referenced geometric property values, found in compliance levels SF-0 and SF-1, is removed.

The rationale for these specific compliance levels and associated restrictions is based on practical experience by implementers gained since 2003. Level SF-0 is the most restrictive, but much existing geospatial data can be represented within its stated restrictions. Building servers and clients to compliance level SF-0 will create greater opportunity for interoperable data exchange, because of the reduced number of optional aspects permitted and the corresponding reduction in vendor-specific functionality likely to occur. Compliance level SF-1 has been found to be useful in projects requiring multivalued (non-spatial) properties of features. And compliance level SF-2 allows servers to host sophisticated information models without complicating the spatial properties beyond those allowed in levels SF-0 and SF-1. This level allows all Simple Features for SQL (SF-SQL) databases to represent any data they may have. The benefit of restricting the geometry model to the types included here, is to foster maximum interoperability of the geospatial location data. Table 2 summarizes the capabilities of each compliance level.

Table 2 — Compliance level capabilities matrix

Level SF-0Level SF-1Level SF-2
restricted set of built-in nonspatial property typesYesaYesaNo
restricted set of spatial property typesYesbYesbYesb
user-defined property typesNoYesYes
use of nillable and xsi:nilNoYesYes
cardinality of properties0 or 10…​unbounded0…​unbounded
non-spatial property values referencesYescYescYes
spatial property values referencesYescYescYes

a  string, integer, measurement, date, real, binary, boolean, URI

b  Point, Curve (LineString), Surface (Polygon), Geometry, MultiPoint, MultiCurve, MultiSurface, MultiGeometry

c  In levels 0 and 1, remote values for properties are supported only through the use of the type gml:ReferenceType. The more generalized GML property-type pattern allowing mixed inline and byreference encoded property values within the same instance document is disallowed.

2.2.  Compliance levels

Table 3 lists the compliance levels defined in this document. The table specifies a numeric identifier for each compliance level, the relevant sub-clauses in Clause 7 and Clause 8 and Clause 10 that apply to the compliance level, and the compliance tests in Annex A that shall be satisfied by each level.

Table 3 — Compliance levels

Compliance level IdentifierRelevant sub-clausesCompliance tests
SF-0Clause 7, Clause 8Annex A.1, Annex A.2, Annex A.3, Annex A.4, Annex A.5, Annex A.6, Annex A.7, Annex A.8, Annex A.9, Annex A.10.1, Annex A.10.2, Annex A.10.3, Annex A.10.4, Annex A.10.5, Annex A.10.6, Annex A.10.7, Annex A.10.8, Annex A.10.9, Annex A.10.10, Annex A.10.11, Annex A.10.12, Annex A.10.13
SF-1Clause 7, Clause 9All compliance tests defined in Annex A.
SF-2Clause 7, Clause 10Annex A.1, Annex A.2, Annex A.3, Annex A.4, Annex A.5, Annex A.6, Annex A.7, Annex A.9, Annex A.10.8

NOTE  Some sub-clauses and compliance tests listed above contain provisions that depend on the compliance level.

Compliance with this profile shall be checked using all the relevant tests in Annex A, as specified in Table 3 for each compliance level.

3.  Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

Clemens Portele: OGC 07-036, OpenGIS Geography Markup Language (GML) Encoding Standard. Open Geospatial Consortium (2007). https://portal.ogc.org/files/?artifact id=20509.

John Herring: OGC 06-103r3, OpenGIS Implementation Specification for Geographic information — Simple feature access — Part 1: Common architecture. Open Geospatial Consortium (2007). https://portal.ogc.org/files/?artifact id=18241.

W3C REC-xml, Extensible Markup Language (XML) 1.0 (Third Edition). https://www.w3.org/TR/REC-xml/.

W3C xmlschema-1, XML Schema Part 1: Structures Second Edition. https://www.w3.org/TR/xmlschema-1/.

W3C xmlschema-2, XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema-2/.

W3C REC-xml-names, Namespaces in XML. https://www.w3.org/TR/REC-xml-names/.

4.  Terms and definitions

No terms and definitions are listed in this document.

For the purposes of this profile, the definitions specified in Clause 4 of the OGC Geography Markup Language (GML) Encoding Standard [OGC 07-036] and the OpenGIS® Implementation Specification for Geographic information — Simple feature access — Part 1: Common architecture [OGC 06-103r3] shall apply.

5.  Conventions

5.1.  Abbreviated terms

Most of the abbreviated terms listed in sub-clause 5.1 of the Geography Markup Language (GML) Encoding Standard [OGC 07-036] and the OpenGIS® Implementation Specification for Geographic information — Simple feature access — Part 1: Common architecture [OGC 06-103r3] apply to this document.

5.2.  Notations used in XML Schema fragments

The following notations are used in XML Schema fragment presented in this document:

  1. Brackets ([]) are used to denote constructs that can be optionally specified. In the following example:

<xsd:element name=”MyElement” minOccurs=”0” [maxOccurs=”1”]>

the brackets around maxOccurs=”1” mean that this construct is optional and can be omitted.

  1. The vertical bar (|) notation is used to separate alternatives. In the following example:

<xsd:element name=”MyElement” minOccurs=”0” maxOccurs=”0|1|unbounded”>

the value of maxOccurs can be one of 0, 1 or unbounded.

  1. Italics are used in XML Schema fragments to denote values that must be specified by the process or person creating the application schema. In the following example:

http://…schema repository URL…/schemas/mySchema.xsd

the italic string “…​schema repository URL…​” indicates the actual schema repository URL would be substituted by the person or process creating the application schema.

5.3.  Document terms and definitions

The following terms and definitions are used in this document:

  1. shall — verb form used to indicate a requirement to be strictly followed to comply to this standard, from which no deviation is permitted

  2. should — verb form used to indicate desirable ability or use, without mentioning or excluding other possibilities

  3. may — verb form used to indicate an action permissible within the limits of this standard

  4. can — verb form used for statements of possibility

  5. informative — a part of a document that is provided for explanation, but is not required

  6. normative — a part of a standards document that is required

  7. annex — an auxiliary part of a document

  8. clause — a major part of a document

  9. sub-clause — a secondary part of a clause or annex

6.  Usage scenarios

6.1.  Simple desktop or browser based map viewer

Allow users to select a collection of features for access and subsequent visualization by a client application.

6.2.  Get a collection of features using spatial and non-spatial constraints

A client application is able to process a schema description of the features that a WFS serves sufficiently to be able to generate a valid WFS query that uses spatial and nonspatial constraints, to obtain one or more feature instances.

6.3.  “Value-add” editor (edit geometry and other attribute values)

Users are able to augment geo-spatial information supplied by a data producer with data of their own, creating new feature instances or modifying existing feature instances.

6.4.  Create feature instances of specified type or id

A client application is able to process a schema description of the features that a WFS serves sufficiently to be able to generate a valid, new feature instances that can then be inserted into the feature store using a WFS Transaction request.

6.5.  Update features with modified geometry and/or property values

A client application is able to process a schema description of the features that a WFS serves sufficiently to understand the type of each property of a feature and be able to generate a valid Transaction request that updates the values of one or more properties of a feature. The properties may be spatial or non-spatial.

6.6.  Create GML application schema corresponding to known spatial data format

An application schema designer is able create a GML application schema that corresponds to data stored in a file with a well know spatial data format. This application schema can then be used to validate GML instance documents generated from the data in source file.

6.7.  Create GML application schemas based on a simple UML class diagram

An application schema designer creates a GML application schema based on a UML simple class diagram. A simple UML model is one that defines classes that would correspond to geographic features whose attributes could be mapped to the property types supported by one of the compliance levels defined in this profile.

7.  Schema coding patterns common to all compliance levels

7.1.  Introduction

This clause contains discussion and schema coding patterns that apply to all compliance levels defined in this profile.

7.2.  Schema processing

Compliance to this profile can be viewed from two perspectives: from the perspective of application schema generators and the perspective of application schema consumers.

An application schema generator is any process that generates GML application schemas that comply with this profile. These schemas may be static documents or generated on the fly. In general, schema generators only need to support that subset of this profile that allows them to encode their data and may ignore the rest. For example, a web feature service that only serves point data will never need to output a schema (in response to a DescribeFeatureType request) that includes curves, surfaces or any of the other supported geometric types. Similarly, a system that does not support value cardinality greater than one will never generate a schema where maxOccurs is greater than one.

A schema consumer, on the other hand, is any system that reads and interprets GML application schemas that comply with this profile. Schema consumers shall be prepared to deal with all aspects of one or more compliance levels defined in this profile, even if it is to report that the system cannot process a particular aspect of this profile. For example, a web feature service client may not be able to use heterogeneous geometry collections, but it shall be able to recognize this structure in the schema and possibly raise an exception.

7.3.  Metadata handling

This profile prohibits use of gml:metaDataProperty elements for referencing metadata in instance documents. Instead, application schema designers may declare metadata feature property elements in a GML application schema, for recording metadata associated with features. If the metadata used to describe features is based on an external schema that does not comply with this profile, then such metadata shall be referenced from a complaint application schema. Otherwise, the metadata can be encoded inline in a complaint application schema.

7.4.  Identifying the compliance level

This profile defines three compliance levels as described in Clause 2. In order for a client to be able to properly interpret a schema, it shall be able to identify the compliance level of the schema. An XML annotation shall be used for this purpose. The annotation shall be placed at the top most nesting level of the schema such that the XPath expression:

/xsd:schema/xsd:annotation/xsd:appinfo/gmlsf:ComplianceLevel

can be used to determine the compliance level of the application schema.

The following schema fragment shows how this annotation shall be declared in an application schema:

1 <xsd:annotation>
2   <xsd:appinfo source=”http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd”>
3       <gmlsf:ComplianceLevel>0|1|2</gmlsf:ComplianceLevel>
4   </xsd:appinfo>
5 </xsd:annotation>

In line 2, the appinfo element is used to contain the compliance level declaration for the application schema. The source attribute shall point to the gmlsfLevels.xsd schema, where the ComplianceLevel element is declared.

Line 3 uses the gmlsf:ComplianceLevel element to declare the compliance level of an application schema. The contents of the ComplianceLevel element shall be 0 for schemas that comply with level SF-0, 1 for schemas that comply with level SF-1 and 2 for schemas that comply with level SF-2.

8.  Schema coding patterns for compliance level SF-0

8.1.  Introduction

This clause describes a rigid coding pattern for GML application schemas that comply with level SF-0 of this profile. The main motivation behind this pattern is to limit the set of XML-Schema and GML capabilities that can be used to code a GML application schema. This in turn simplifies the task of building clients that can ingest schema documents that comply with this coding pattern and understand the structure of the feature types defined within.

The schema fragments defined in the following sub-clauses shall be combined to create a complete GML application schema that complies to level SF-0 of this profile. The schema fragments shall be structurally encoded exactly as presented in the document. This means that all mandatory elements and attributes presented in the fragment shall be included as shown even if they are optional in XML-Schema. Furthermore, no other optional elements, attributes or facets that might be defined in XML-Schema or GML may be used unless specified in this document.

Please note that these requirements have absolutely nothing to do with the formatting of the XML fragments or the order in which elements or type definitions are declared. They are structural and syntactic requirements, not formatting requirements. White spaces can be used freely to format the generated schema documents in any way.

8.2.  Root element encoding

The following XML fragment shows how to encode the GML application schema document’s root element:

1 <xsd:schema
2   targetNamespace="target_name_space"
3   xmlns:prefix="target_name_space"
4   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5   xmlns:gml="http://www.opengis.net/gml/3.2"
6   xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
7   elementFormDefault="qualified"
8   version="99.99.99">

The attributes shown for the schema element can be specified in any order.

Line 2 declares the target namespace for the elements defined in the application schema document. The value target_name_space is a placeholder for the actual namespace identifier. As a GML application schema is revised, all first and second level revision changes shall require a new namespace identifier and thus a new value for the target_name_space placeholder.

Example

To illustrate this requirement, consider a GML application schema which declares that its initial version is 2.3.0, and that the elements in the schema belong to a namespace with the identifier http://www.someserver.com/…​some path…​/2.3.0. If the next revision of the schema changes the version from 2.3.0 to 2.3.1 then the namespace identifier can remain the same. If, however, the next revision of the schema changes the version from 2.3.0 to 2.4.0 then a new namespace identifier must be used for the new revision of the schema (e.g. http://www.someserver.com/…​some path…​/2.4.0 for this example).

Line 3 defines a prefix for the target namespace. The value prefix is a placeholder for an actual prefix value. A compliant schema may also declare the target namespace to be the default namespace in which case no prefix is defined.

Line 4 declares the prefix for the XML-Schema namespace, which contains all the elements used to define a schema. In this document, the prefix xsd is used to represent the namespace for the XML-Schema elements. However, a schema document that complies with this profile may set the prefix to have any desired value as long as it is correctly bound to the XML-Schema namespace (http://www.w3.org/2001/XMLSchema). A compliant schema may also declare the XML-Schema namespace as the default namespace as long as the default namespace has not been previously bound.

NOTE  Like GML, the application schema examples in Annex D use no prefix for the XML-Schema namespace (http://www.w3.org/2001/XMLSchema).

Line 5 declares the prefix gml for the GML namespace. Although this profile recommends that this prefix be named gml, a compliant schema may use any name that conforms to XML-Schema for this prefix as long at it is correctly bound to the GML namespace for prefixes (http://www.opengis.net/gml/3.2).

Line 6 declares the mandatory prefix gmlsf for the namespace of the ComplianceLevel element declared in gmlsfLevels.xsd. As described in Clause 7.4, the ComplianceLevel element shall be used inside an appinfo element to declare the compliance level of an application schema. Although this profile recommends that this prefix be named gmlsf, a compliant schema may use any name that conforms to XMLSchema for this prefix as long at it is correctly bound to the namespace http://www.opengis.net/gmlsf/2.0.

Line 7 sets the default value for the elementFormDefault attribute for elements to qualified. This indicates that locally defined elements are added to the target namespace.

Finally, the version attribute should be set to reflect the version of the application schema document being generated. The value “99.99.99” is a placeholder for any version value, in any format, that has meaning to the entity or organization creating the schema document.

8.3.  Importing and including schemas

8.3.1.  Importing the GML schema

The following XML fragment imports the GML schema:

1 <xsd:import namespace="http://www.opengis.net/gml/3.2"
2 schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>

The value of the namespace attribute shall match the GML namespace declaration in the root element.

The schema to be imported shall be the complete GML schema, denoted above using the file name gml.xsd.

The value of the schemaLocation attribute shall be a URL (absolute or relative) that resolves to the contents of the GML Schema. The schema fragment above shows a URL that points to the physical file, schemas.opengis.net/gml/3.2.1/gml.xsd, but any URL may be used (e.g. an HTTP GET request that resolves to the appropriate schema). It should be noted that the schemaLocation attribute is a hint for schema aware parsers and may not necessarily be resolved or used. However, application schemas that comply with this profile shall still specify the schemaLocation attribute.

8.3.2.  Importing the compliance levels schema

The following XML fragment imports the schema that declares the ComplianceLevel element used to declare the compliance level of an application schema:

1 <xsd:import namespace="http://www.opengis.net/gmlsf/2.0"
2       schemaLocation="http://...schema repository path.../gmlsfLevels.xsd"/>

The value of the namespace attribute shall match the gmlsf namespace declaration in the root element.

The value of the schemaLocation attribute shall be a URL (absolute or relative) that resolves to the contents of the schema file gmlsfLevels.xsd. The schema fragment above shows a URL that points to the physical file, gmlsfLevels.xsd, but any URL may be used (e.g. an HTTP GET request that resolves to a schema). It should be noted that the schemaLocation attribute is a hint for schema aware parsers and may not necessarily be resolved or used. However, application schemas that comply with this profile shall specify the schemaLocation attribute.

8.3.3.  Importing and including other application schemas

An application schema compliant with this profile may import or include other application schemas based on this profile as long as the imported schemas have compliance level declaration that is less than or equal to the importing schema’s compliance level and are also compliant with this profile. The only exceptions are those imported schemas required for compliance by this standard (i.e. gml.xsd). The coding pattern for importing is the same as that used in Clause 8.3 except that the namespace and schemaLocation attributes shall be correct for the schema being imported.

8.4.  Coding pattern for feature types

8.4.1.  Introduction

In GML, a feature is encoded as an XML element with the name of the feature-type. A property of a feature is also encoded as an XML element, whose name is the name of the property. This clause defines the XML-Schema and GML data types that may be used to declare elements that represent features and properties of features.

Following the GML lexical convention, this profile uses UpperCamelCase for the XML element names representing Objects or Feature Types, and lowerCamelCase for the XML element names representing properties. This provides a visual clue distinguishing the two “layers” within long XML documents with nested elements, and thus assists checking of the Object/property pattern by developers and users.

8.4.2.  Defining feature collections

The following XML-Schema fragment shows how to define a feature collection in a GML application schema that complies with level SF-0 of this profile:

1 <element name="FeatureCollectionName"
2               type="[prefix:]FeatureCollectionNameType"
3               substitutionGroup="gml:AbstractGML"/>
4 <complexType name="FeatureCollectionNameType">
5   <complexContent>
6       <extension base="gml:AbstractFeatureType">
7               <sequence minOccurs="0" maxOccurs="unbounded">
8                   <element name="featureMember">
9                       <complexType>
10                          <complexContent>
11                              <extension base="gml:AbstractFeatureMemberType">
12                                  <sequence>
13                                      <element ref="gml:AbstractFeature"/>
14                                  </sequence>
15                              </extension>
16                          </complexContent>
17                      </complexType>
18                  </element>
19              </sequence>
20          </extension>
21      </complexContent>
22 </complexType>

The global element of the feature collection is declared in line 1. The value FeatureCollectionName is a placeholder for the actual name of the feature collection. The root element of the collection shall be defined to be of type FeatureCollectionNameType, and shall be substitutable for the substitution group head gml:AbstractGML.

NOTE 1  This FeatureCollectionName element is NOT defined in the gml:AbstractFeature substitutionGroup, so that this feature collection element cannot be included in another feature collection.

Line 4 begins the definition of the XML complex type that defines the feature collection. This complex type shall be an extension of the GML abstract feature type (line 6), and shall contain zero or more featureMember elements. Each of these featureMember elements shall contain one concrete feature element of any feature type that is defined in the gml:AbstractFeature substitutionGroup. This feature collection shall not include any feature property element declarations.

NOTE 2  This FeatureCollectionNameType does NOT extend gml:AbstractFeatureCollectionType because that type has been deprecated in GML 3.2. This extension of gml:AbstractFeatureType does not use gml:featureMember because a feature collection using this profile must directly include (not reference) each of the features included. In addition, the gml:featureMember element has been deprecated in GML 3.2. The only feature member container supported by this profile, for compliance level SF-0, shall be [prefix:]featureMember. Use of a feature container corresponding to gml:featureMembers, which was also deprecated in GML 3.2, is not allowed by this standard.

No more than one feature collection shall be defined in each Application Schema. When used, that feature collection shall be the root element in a XML document.

8.4.3.  Defining feature types

The following XML-Schema fragment shows how to define a feature type in a GML application schema that complies with level SF-0 of this profile:

1 <xsd:element name="FeatureTypeName"
2               type="[prefix:]FeatureTypeNameType"
3               substitutionGroup="gml:AbstractFeature"/>
4
5 <xsd:complexType name="FeatureTypeNameType">
6   <xsd:complexContent>
7       <xsd:extension base="gml:AbstractFeatureType">
8           <xsd:sequence>
9
10      <!-- ... zero or more element declarations as described in 8.4.4 ... -->
11
12          </xsd:sequence>
13      </xsd:extension>
14  </xsd:complexContent>
15 </xsd:complexType>

The global element of the feature type is defined in line 1. The value FeatureTypeName is a placeholder for the actual name of the feature type. The global element shall be defined to be of type FeatureTypeNameType and shall be substitutable for the substitution group head gml:AbstractFeature.

Line 5 begins the definition of the XML type that defines the complex type of the feature type. The complex type shall be an extension of the GML abstract feature type (line 7) and shall contain zero or more element declarations that represent the properties of the feature type. The use of the sequence construct in lines 8-12 means that the order in which elements appear in an instance document shall match the order in which they are declared in a compliant application schema document. Clause 8.4.4 describes how to code elements of the various supported content types.

8.4.4.  Feature property encoding

8.4.4.1.  Basic data types

XML-Schema defines a rich set of basic data types that can be used to define XML documents. However, since data can originate from any number of sources (many having a different set of supported basic types), this document limits the set of available basic types for compliance level 0 to a smaller subset. The reasoning is that a smaller common set of supported basic data types is likely to be more interoperable.

In addition to the GML geometric property types defined in Table 6, this profile supports the following list of basic data types:

  1. Integers (with optional specified value range and number of digits)

  2. Measurements, that include a reference to units of measurement

  3. Character strings (with optional specified maximum length or fixed length)

  4. Date

  5. Boolean

  6. Binary data

  7. URI references to local or remote resources

  8. References to other resources

  9. Character strings whose values are from a code list

  10. Reals (with optional specified number of digits, decimal precision and value range)

The following sub-clauses specify XML templates for defining elements whose content type corresponds to one of the basic types supported by this profile. Unless otherwise specified, all elements and attributes presented in the templates, and only those elements and attributes, shall be included in an application schema that complies with this profile.

8.4.4.2.  Common facets

Table 4 summarizes the common facets that may be used when declaring elements that encode properties in application schemas that comply with level SF-0 of this profile.

Table 4 — Allowed element facets

XML schema element facet nameApplicable data typesEncoding pattern
minInclusiveinteger, measurement, date, dateTime, real<xsd:minInclusive value="min value"/>
minExclusiveinteger, measurement, date, dateTime, real<xsd:minExclusive value="min value"/>
maxInclusiveinteger, measurement, date, dateTime, real<xsd:maxInclusive value="max value"/>
maxExclusiveinteger, measurement, date, dateTime, real<xsd:maxExclusive value="max value"/>
enumerationinteger, measurement, date, dateTime, real, string, URI, reference<xsd:enumeration value="value"/>

8.4.4.3.  Multiplicity

The attributes minOccurs and maxOccurs may be specified to indicate the minimum and maximum number of times that a property element shall appear in an instance document. If minOccurs and maxOccurs are omitted, then the default values defined in XML-Schema for these facets apply — one (1).

For compliance level SF-0, the attribute minOccurs can have the values 0 or 1 and maxOccurs can only have the value 1. This restriction is relaxed for compliance levels SF-1 (see Clause 9.2.3) and SF-2.

8.4.4.4.  Null values

In this profile, the term null is used to indicate the absence of a property value. Whether or not the value of a feature property is interpreted as being null depends on the definition of the XML element into which the property is mapped in a GML application schema and the contents of that element in a GML instance document.

The salient facets of an element’s declaration that affect whether a property’s value is interpreted as being null or not are the minOccurs and maxOccurs facets. If minOccurs=0 and the element does not appear in an instance document then the corresponding property value shall be considered to be null. Otherwise, the property value is assigned as specified in Table 5. For compliance level SF-0, Table 5 summarizes how the various combinations of minOccurs, maxOccurs and an element’s content are interpreted to set the value of a feature property.

The use of the attribute nillable is prohibited in compliance level SF-0 but is allowed for levels SF-1 (see Clause 9.2.4) and SF-2.

Although XML-Schema [W3C XML-1] allows minOccurs=maxOccurs=0, this profile prohibits this combination.

Table 5 — Interpretation of feature property value

Value of minOccurs facet on element declaration in GML application schemaValue of maxOccurs facet on element declaration in GML application schemaContent of element in GML instance documentInterpretation of feature property value
00EMPTYNot allowed by this profile.
00NOT EMPTYInvalid combination
01EMPTYProperty value is null
01NOT EMPTYProperty value is the content of the element
10EMPTYInvalid according to XML Schema
10NOT EMPTYInvalid according to XML Schema
11EMPTYInvalid combination
11NOT EMPTYProperty value is the content of the element.

8.4.4.5.  Declaring elements with integer content

The following XML-Schema fragments show how to declare a property element with integer content:

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:simpleType>
3       <xsd:restriction base="xsd:integer">
4           <xsd:totalDigits value="nDigits"/>
5           <!-- ... Optional facets described in sub-clause 8.4.4.2 ...-->
6       </xsd:restriction>
7   </xsd:simpleType>
8 </xsd:element>

SHORT FORM: <xsd:element name="propertyName" type="xsd:integer"
                            [minOccurs="0|1"] [maxOccurs="1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

An element with integer content (or an integer-valued property) shall be derived from the base XML-Schema type xsd:integer.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

The maximum number of digits in the integer may be specified using the value attribute on the totalDigits element. The value nDigits in the XML fragment is a placeholder for the value representing the maximum number digits in the integer.

The declaration of an element with integer content may also include one of more of the optional facets described in Clause 8.4.4.2. If no optional facets are specified in the element declaration, then the short form schema fragment may be used instead.

8.4.4.6.  Declaring elements with content that is a measurement

The following XML-Schema fragments show how to define property elements with content that is a measurement and includes a unit of measure in a GML application schema that complies with this profile:

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:complexType>
3       <xsd:simpleContent>
4           <xsd:restriction base="gml:MeasureType">
5               <!-- ... Optional facets described in sub-clause 8.4.4.2 ... -->
6           </xsd:restriction>
7       </xsd:simpleContent>
8   </xsd:complexType>
9 </xsd:element>

SHORT FORM: <xsd:element name="propertyName" type="gml:MeasureType"
                        [minOccurs="0|1"] [maxOccurs="1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

A measurement property shall be of type gml:MeasureType.

The declaration of an element with a measurement may also include one of more of the optional facets described in Clause 8.4.4.2. If no optional facets are specified in the element declaration, then the short form schema fragment may be used instead.

In an instance document, if the unit of measure is not known, then the value of the uom attribute may be set to unknown to indicate this. It should also be noted that if the value of a property is a ratio, then the unit type is scale with example values such as unity, percent and parts-per-million.

8.4.4.7.  Declaring elements with string content

8.4.4.7.1.  Basic string

The following XML-Schema fragments show how to declare a property element with character string content:

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:simpleType>
3       <xsd:restriction base="xsd:string">
4           <xsd:maxLength value="nCharacters"/>
5           <!-- - or - -->
6           <xsd:length value="nCharacters"/>
7           <!--... Optional facets described in sub-clause 8.4.4.2 ... -->
8       </xsd:restriction>
9   </xsd:simpleType>
10 </xsd:element>

SHORT FORM: <xsd:element name="propertyName" type="xsd:string"
                        [minOccurs="0|1"] [maxOccurs="1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

A character string valued property shall be derived, by restriction, from the base XMLSchema type xsd:string.

The nCharacters value of the value attribute of the maxLength element may be used to indicate the maximum number of characters that the string may contain. Similarly, the nCharacters value of the value attribute of the length element may be used to indicate the fixed number of characters that the string shall contain. Note that nCharacters value may not be the same as the length in bytes of the character string. The length of the string in bytes may be longer than the nCharacters value if a multi-byte character set is being used.

The declaration of an element with character string content may also include the optional “Enumeration” facet described in Clause 8.4.4.2. If no optional facets are specified in the element declaration, then the short form schema fragment may be used instead.

8.4.4.7.2.  Internationalized string

The following XML fragment defines a complex type that shall be included in a schema that requires the use of internationalized strings.

1 <xsd:complexType name=”LanguageStringType”>
2   <xsd:simpleContent>
3       <xsd:extension base=”string”>
4           <xsd:attribute ref=”xml:lang” use=”optional”/>
5           <!— … additional optional attributes … —!>
5       </xsd:extension>
6   </xsd:simpleContent>
7 </xsd:complexType>

The LanguageString type shall include the xml:lang attribute, as shown, but may include additional optional attributes that an application schema may require to further characterize an internationalized string.

Elements with internationalized string content can then be defined using the following template:

1 <xsd:element name=”propertyName” [minOccurs=”0|1”] [maxOccurs=”1”]>
2   <xsd:complexType>
3       <xsd:simpleContent>
3           <xsd:restriction base=”xxx:LanguageStringType”>
4               <xsd:maxLength value=”nCharacters”/>
5               <!— — or — —>
6               <xsd:length value=”nCharacters”/>
7               <!—… Optional facets described in sub-clause 8.4.4.2 … —>
8           </xsd:restriction>
9       </xsd:simpleContent>
9   </xsd:complexType>
10 </xsd:element>

SHORT FORM: <xsd:element name=”propertyName” type=”xxx:LanguageStringType”
                        [minOccurs=”0|1”] [maxOccurs=”1”]/>

which is similar to the fragment defined in Clause 8.4.4.6 except for the type xxx:LanguageString which is a placeholder for the LanguageStringType (see Clause 8.4.4.6) in the target namespace of the schema.

Application schemas that use internationalized strings shall include the following namespace declaration:

xmlns:xml=”http://www.w3.org/XML/1998/namespace”

and shall import the following schema:

<xsd:import namespace=”http://www.w3.org/XML/1998/namespace”
            schemaLocation=”http://www.w3.org/2001/xml.xsd”/>

in order to declare the namespace for the xml:lang attribute.

8.4.4.8.  Declaring elements with date content

The following XML-Schema fragments show how to encode a property element with date content:

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:simpleType>
3       <xsd:restriction base="xsd:date|xsd:dateTime">
4           <!-- ... Optional facets described in sub-clause 8.4.4.2 ... -->
5       </xsd:restriction>
6   </xsd:simpleType>
7 </xsd:element>

SHORT FORM: <xsd:element name="propertyName" type="xsd:date | xsd:dateTime"
                            [minOccurs="0|1"] [maxOccurs="1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

An element that contains date content can be of type xsd:date or xsd:dateTime depending on whether time is important or not. The actual instances of date values shall be encoded according to the XML Schema standard.

The declaration of an element with date content may also include one of more of the optional facets described in Clause 8.4.4.2. If no optional facets are specified in the element declaration, then the short form schema fragment may be used instead.

8.4.4.9.  Declaring elements with boolean content

The following XML-Schema fragment shows how to declare an element with Boolean content in a GML application schema that complies with this profile:

1 <xsd:element name="propertyName"
2               type="xsd:boolean"
3               [minOccurs="0|1"] [maxOccurs="1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2. The value space of boolean content is {true, 1, false, 0}.

8.4.4.10.  Declaring elements with binary content

The following XML-Schema fragment shows how to declare an element with binary content in a GML application schema that complies with this profile:

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:complexType>
3       <xsd:simpleContent>
4           <xsd:extension base="xsd:base64Binary|xsd:hexBinary">
5               <xsd:attribute name="url" type="xsd:anyURI" use="optional"/>
6               <xsd:attribute name="mimeType" type="xsd:string" use="required"/>
7               <xsd:attribute name="role" type="xsd:string" use="optional"/>
8               <xsd:attribute name="length" type="xsd:positiveInteger" use="optional"/>
8           </xsd:extension>
9       </xsd:simpleContent>
10  </xsd:complexType>
11 </xsd:element>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

Binary content can either be referenced from an external URI or encoded inline in base64 or hex format. When binary data is referenced from an external URI, the url attribute shall be used to point to the location of the data. The mimeType attribute shall also be specified to indicate the type or format of binary data that is being referenced. Finally, the optional role attribute can be used to assign a user-defined role to the data. The role attribute allows complex binary formats like HDF/EOS, which contains multiple independent binary components, to be supported.

When binary data is encoded inline, the mimeType attribute shall be specified to indicate the type or format of the binary data. The optional role attribute can also be specified to assign a user-defined role to the data. Binary data included inline is either encoded in base64 format (indicated by defining the type of the element as xsd:base64Binary) or hex (indicated by defining the type of the element as xsd:hexBinary). The optional length attribute may be used to specify the length of the content of the element in an instance document.

8.4.4.11.  Declaring elements with geometric content

8.4.4.11.1.  Encoding properties with geometric content

The following XML-Schema fragment shows how to declare a property element with geometric content:

1 <xsd:element name="propertyName"
2               type="gml_geometric_propertyType"
3               [minOccurs="0|1"] [maxOccurs="1"]>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

The value gml_geometric_propertyType for the type attribute is a placeholder for one of the geometric property types defined in Table 6 below.

8.4.4.11.2.  Supported geometric property types

Table 6 lists the GML geometry property types can be used in a GML application schema that complies with level SF-0:

Table 6 — Supported GML Geometric Property Types

GML geometric property typeDefined in GML schema documentRestrictions
gml:PointPropertyTypegeometryBasic0d1d.xsdNone
gml:CurvePropertyType

geometryBasic0d1d.xsd
geometryPrimitives.xsd

Supported property values are gml:LineString or gml:Curve with gml:LineStringSegment, gml:Arc, gml:Circle or gml:CircleByCenterPoint segmentsa.

gml:SurfacePropertyTypegeometryBasic2d.xsd

Supported property values are gml:Polygon or gml:Surface with gml:PolygonPatch patches. Surface boundaries may be described using gml:LinearRing or using gml:Ring with a single gml:Curve with gml:LineStringSegment, gml:Arc, gml:Circle or gml:CircleByCenterPoint segmentsa.

gml:GeometryPropertyTypegeometryBasic0d1d.xsd

Supported property values are
gml:Point,gml:LineString,
gml:Curve, gml:Polygon,
gml:Surface, gml:MultiPoint,
gml:MultiCurve,
gml:MultiSurface

gml:MultiPointPropertyTypegeometryAggregates.xsdNone
gml:MultiCurvePropertyTypegeometryAggregates.xsdSupported members are same as CurvePropertyType
gml:MultiSurfacePropertyTypegeometryAggregates.xsdSupported members are same as SurfacePropertyType

a  Non-linearly interpolated curves are not included in the OpenGIS® Implementation Specification for Geographic information — Simple feature access — Part 1: Common architecture [OGC 06-103r3] specification. However, this standard allows the use of gml:Arc, gml:Circle and gml:CircleByCenterPoint because of their general utility for the compact expression of circles and arcs which would otherwise be approximated using line strings and/or polygons.

Additional requirements for Geometry include:

  1. in all cases, geometry coordinates shall only be specified using the gml:pos element for gml:Point and gml:CircleByCenterPoint, or the gml:posList element for all other types

  2. features may have any number of geometric properties

  3. coordinate reference systems may have 1, 2 or 3 dimensions

The response feature collection may include the gml:boundedBy property with the appropriate srsName. In this case, all geometries in the feature collection shall be in the same srsName unless otherwise indicated within a particular feature or geometry instance.

For the aggregate geometric property types gml:MultiPointPropertyType, gml:MultiCurvePropertyType, gml:MultiSurfacePropertyType and gml:MultiGeometryPropertyType, the GML standard defines two containing elements for individual geometry members. The following table lists which geometry member containers are defined for each aggregate geometric type in this profile:

Table 7 — Geometry member containers

Aggregate geometry property typeGeometry member container element
gml:MultiPointPropertyTypegml:pointMember
gml:MultiCurvePropertyTypegml:curveMember
gml:MultiSurfacePropertyTypegml:surfaceMember
gml:MultiGeometryPropertyTypegml:geometryMember

That is, this profile restricts instance documents to using the property containers gml:pointMember, gml:curveMember, gml:surfaceMember and gml:geometryMember.

8.4.4.11.3.  CRS support

This sub-clause discusses topics related to CRS handling within GML instance documents that validate against application schemas that comply with compliance level SF-0.

A client application needs to be able to unambiguously determine the CRS of each geometry instance in a GML instance document that validates against a GML application schema that complies with this profile. GML defines the srsName attribute for this purpose.

In this profile, the srsName attribute can be specified at three different levels in an instance document:

  1. On the gml:boundedBy Envelope of a top level response container that is a feature collection. For example, the WFS response container, wfs:FeatureCollection defined in the Web Feature Service Implementation standard [OGC 04-094].

  2. On the gml:boundedBy Envelope of each feature instance. The “object” level element of each feature type is defined using the pattern described in Clause 8.4.

  3. On the geometry elements gml:Point, gml:LineString, gml:Curve, gml:Polygon, gml:Surface, gml:Geometry, gml:MultiPoint, gml:MultiCurve, gml:MultiSurface, gml:MultiGeometry.

The following example XML fragment shows the srsName attribute used at the feature collection, feature instance and geometry instance levels.

1. <wfs:FeatureCollection>
2.      <gml:boundedBy>
3.          <gml:Envelope srsName="..."> ... </gml:Envelope>
4.      </gml:boundedBy>
5.      <!-- ... feature instances go here ... -->
6.      <wfs:member>
7.          <myns:MyFeature>
8.              <gml:boundedBy>
9.                  <gml:Envelope srsName="..."> ... </gml:Envelope>
10.             </gml:boundedBy>
11.             <!-- ... zero or more property values go here ... -->
12.             <myns:geomProperty>
13.                 <gml:Polygon srsName="..."> ... </gml:Polygon>
14.             </myns:geomProperty>
15.             <!-- ... zero or more property values go here ... -->
15.         </myns:MyFeature>
16.     </wfs:member>
17.     <!-- ... more feature instances go here ... -->
18. </wfs:FeatureCollection>

Line 3 shows the srsName attribute specified at the feature collection level. Line 9 shows the srsName attribute specified at the feature instance level. Line 13 show the srsName attribute specified at the geometry instance level.

In order to reduce redundancy, instance documents should specify the srsName attribute at the highest possible level. In the case were a CRS is not explicitly specified for a geometry instance, the CRS of the geometry instance shall be assumed to take on the value of the srsName attribute of the gml:boundedBy Envelope of the nearest containing element (i.e. feature instance or feature collection) that contains an Envelope. This implies that if all geometry instances in a document are in the same CRS, then the best practice for a compliant instance document is to not repeatedly specify that same value for the srsName attribute for each geometry instance. Instead, the compliant document should specify a gml:boundedBy element at the feature collection level and specify a value for the srsName attribute on the gml:Envelope element. Thus, the srsName attribute is specified once in the entire document.

In the case where the bounding box at the feature collection level and the feature type level has no value, then the srsName attribute shall be specified for each geometry instance of the corresponding feature type even if the CRS is the same for all geometry instances.

8.4.4.12.  Declaring elements whose content is a URI

The following XML-Schema fragment shows how to declare a property element with URI content in a GML application schema that complies with this profile:

1 <xsd:element name="propertyName"
2               type="xsd:anyURI"
3               [minOccurs="0|1"] [maxOccurs="1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

8.4.4.13.  Declaring elements that reference other resources

The following XML-Schema fragment shows how to declare an element whose value is a reference to a local or remote resource:

1 <xsd:element name=”propertyName” type=”gml:ReferenceType” minOccurs=”0|1”>
2   <xsd:annotation>
3       <xsd:appinfo source=”urn:x-gml:targetElement”>…target element…</xsd:appinfo>
4   </xsd:annotation>
5 </xsd:element>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which should match the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

The value of the mandatory type attribute shall be gml:ReferenceType.

To explicitly describe that an association exists between two features, an XML Schema annotation shall be used, as shown above, to specify the namespace-qualified elements in each feature that encode the association. For example, consider the following association between two fictitious features called AIRPORT and BUILDING:

Figure 1 — Example association between two features

In this example, the BUILDING feature might contain the property declaration:

<xsd:element name=”partOfAirport” type=”gml:ReferenceType minOccurs=”1”>
    <xsd:annotation>
        <xsd:appinfo>
            <gml:targetElement>myns:AIRPORT</gml:targetElement>
        </xsd:appinfo>
    </xsd:annotation>
</xsd:element>

used to indicate in an instance of the BUILDING object to which airport the building belongs.

In instance documents, local objects may be identified using only the following shorthand xpointer expression template: a local resource is identified by setting the value of the xlink:href attribute to be the fragment separator ‘#’ and the gml:id value of the feature. The absence of a URI before the fragment separator indicates that the local document is being referenced. For example:

xlink:href=”#o1013”

Similarly, remote objects may be identified by setting the value of the xlink:href attribute to be the URI for the remote document, a fragment separator ‘#’ and the id of the object being referenced. For example:

xlink:href=http://…www.someserver.com…/somedoc.xml#o1013

8.4.4.14.  Declaring elements with string content from a code list

The following XML Schema fragment defines the encoding of a property element whose content shall be from a list of values stored in one or more external dictionaries.

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:complexType>
3       <xsd:simpleContent>
4           <xsd:restriction base="gml:CodeType">
5               <xsd:attribute name="codeSpace" type="xsd:anyURI" [use="optional"]
6                   default="...some uri..." | fixed="... some uri..."/>
7           </xsd:restriction>
8       <xsd:simpleContent>
9   </xsd:complexType>
10 </xsd:element>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

A default GML dictionary for the code list can be specified as shown in line 5 using the default or fixed attribute on the attribute declaration pointing to the desired dictionary. If the desired value dictionary is specified in an application schema using the default attribute then an instance document may point to an alternate value dictionary at runtime using the codeSpace attribute. If, however, the fixed attribute is used in an application schema, then an instance document shall use values from the specified dictionary.

In addition to GML dictionaries, dictionaries encoded using other schemas may also be referenced (e.g. SKOS Simple Knowledge Organiztion System).

8.4.4.15.  Declaring elements with real content

The following XML-Schema fragments show how to define property elements with real content in a GML application schema that complies with this profile:

1 <xsd:element name="propertyName" [minOccurs="0|1"] [maxOccurs="1"]>
2   <xsd:simpleType>
3       <xsd:restriction base="xsd:double|xsd:decimal">
4           <!-- ... Optional facets described in sub-clause 8.4.4.2 ... -->
5           [<xsd:totalDigits value="N"/>]
6           [<xsd:fractionDigits value="N" />]
7       </xsd:restriction>
8   </xsd:simpleType>
9 </xsd:element>

SHORT FORM: <xsd:element name="propertyName" type="xsd:double"
                        [minOccurs="0|1"] [maxOccurs="0|1"]/>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of feature property being encoded.

The use of the attributes minOccurs and maxOccurs is described in Clause 8.4.4.2.

A real-valued property (or an element with real content) shall be of type xsd:double or type xsd:decimal. The type xsd:decimal is included in the profile for the encoding of real values and to support the mapping, into GML, of source formats where the precision and scale are precisely known. For example, when encoding numeric values from a table in a relational database, the definition of numeric columns can include both a precision and scale.

If the type is xsd:decimal then the facets totalDigits and fractionDigits listed in lines 5 and 6 shall be specified. If the type is xsd:double, then the facets totalDigits and fractionDigits listed in lines 5 and 6 shall not be specified.

The declaration of an element with real content may also include one of more of the optional facets described in Clause 8.4.4.2. If no optional facets are specified in the element declaration, then the short form schema fragment may be used instead.

In most cases, a real-valued property is used for encoding a measurement of some sort and as such the value has an associated unit of measure. For this reason, this standard strongly recommends that real-valued properties be encoded using the gml:MeasureType as described in Clause 8.4.4.6.

8.5.  Comments and annotations

Application schemas that comply with level SF-0 of this profile may freely use XML comments and annotations, using the annotation element, wherever they are legally allowed by XML-Schema and GML.

9.  Schema coding patterns for compliance level SF-1

9.1.  Introduction

This clause describes a rigid coding pattern for GML application schemas that comply with level SF-1 of this profile. All the coding rules defined for compliance level SF-0, in Clause 7 and Clause 8, apply to schemas that conform with level SF-1 except for the changes and additions noted in Clause 9.2 and Clause 9.3.

9.2.  Changes from compliance level SF-0

9.2.1.  Basic data types

In additions to the basic data types listed in Clause 8.4.4, schemas that comply with compliance level SF-1 of this profile also allow:

  1. User defined types composed of elements with spatial and non-spatial scalar types as defined in this profile

Clause 9.3.2 describes how user defined types shall be declared in application schemas that comply with level SF-1.

9.2.2.  Cardinality

The maximum cardinality that can be declared in an application schema that complies with level SF-0 is 1. This means that the attribute minOccurs can have values of 0 or 1 and the attribute maxOccurs can only have the value of 1.

This restriction is relaxed for application schemas that comply with level SF-1 of this profile. The attribute minOccurs can have a value of 0 or N, where N is a non-negative integer greater than zero. The attribute maxOccurs can have a value of 0, N or unbounded, where N is a non-negative integer greater than zero and the special value “unbounded” is used to indicate that the element may recur an unlimited number of times in an instance document.

In the XML schemas fragments presented as templates in Clause 8, all instance of minOccurs=”0|1” shall be replaced by minOccurs=”0|N” and all instances of maxOccurs=”1” shall be replaced by maxOccurs=”0|N|unbounded” for compliance level SF-1.

9.2.3.  Multiplicity

For compliance level SF-1, the attributes minOccurs and maxOccurs can have the values 0, any positive integer N or the string “unbounded”.

9.2.4.  Null values

Unlike compliance level SF-0, level SF-1 allows the use of the nillable attribute when declaring elements in an application schema.

Table 8, which is similar to Table 5 in Clause 8.4.4.4, summarizes how the various combinations of minOccurs, maxOccurs, nillable, an element’s content and the nil attribute are interpreted to set the value of a feature property for GML application schemas that comply with level SF-1. The table takes into account the fact that elements can have a maximum cardinality that is greater than 1.

Table 8 — Interpretation of feature property value

Value of minOccurs facet on element declaration in GML application schemaValue of maxOccurs facet on element declaration in GML application schemaValue of nillable attribute on element declaration in GML application schemaExistence of element in GML instance documentInterpretation of feature property value
00false or truenoNot allowed by this profile.
00false or trueyesInvalid combination
0>=1falsenoProperty value is interpreted as being absent.
0>=1trueyes, with xsi:nill=’true’Property value is null
0>=1false or trueyes, without xsi:nil=”true”Property value is the content of the element.
>=10false or truenoInvalid according to XML Schema.
>=10false or trueyesInvalid according to XML Schema.
>=1>=1falsenoInvalid according to XML Schema.
>=1>=1trueyes, with xsi:nill=’true’Property value is null
>=1>=1false or trueyes, without xsi:nil=”true”Property value is the content of the element.

This standard does not assign any specific semantics to a property element with a xsi:nil attribute with a value “true” vs. the omission of a property element.

9.3.  Additions to compliance level SF-0

9.3.1.  Introduction

Application schemas that comply with level SF-0 can only declare, with the exception of geometric property types, feature properties that have simple or scalar values. For compliance level SF-1, the restriction is eased and conformant schemas are allowed to declare compound or complex valued feature properties. For example, the following schema fragment:

<xsd:complexType name="IdentifierPropertyType">
    <xsd:sequence>
        <xsd:element ref="fw:Identifier"/>
    </xsd:sequence>
</xsd:complexType>
<xsd:element name="Identifier">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="identifier" type="xsd:string"/>
            <xsd:element name="idAuthority" type="xsd:string"
                            minOccurs="0" maxOccurs="1"/>
            <xsd:element name="description" type="xsd:string"
                            minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

declares a complex feature property called Identifier as an element that contains three sub-elements, identifier, idAuthority and description.

9.3.2.  Declaring elements with complex content

The following XML-Schema fragment shows how to declare a property element with complex content.

1 <xsd:element name="propertyName"
2               type="userDefinedNamePropertyType"
3               [minOccurs="0|N"] [maxOccurs="0|N|unbounded"]>

The value of the mandatory name attribute, propertyName, is a placeholder for the name of the element being declared which shall be the name of the feature property being encoded.

The value of the mandatory type attribute, userDefinedNamePropertyType, is a placeholder for the name of a user-defined type that shall be declared as described in Clause 9.3.3.

The attributes minOccurs and maxOccurs may be specified and indicate the minimum and maximum number of times that the element shall appear in an instance document. If minOccurs and maxOccurs are omitted, then they are assumed to have the default values defined in XML-Schema for these facets -one (1). The combination minOccurs = maxOccurs = 0 is specifically forbidden by this profile.

9.3.3.  Declaring a user defined type

The following XML-Schema fragments shows how to declare a used-defined complex type.

1 <xsd:complexType name="userDefinedNamePropertyType">
2   <xsd:sequence>
3       <xsd:element ref="tns:userDefinedName"
4           [minOccurs="0|N"] [maxOccurs=")|N|unbounded"]/>
5   </xsd:sequence>
6 </xsd:complexType>
7
8 <xsd:element name="userDefinedName">
9   <xsd:complexType>
10      <xsd:sequence | xsd:choice [minOccurs="1"] [maxOccurs="1]>
11
12      <!-- ...one or more element declarations as described in clause 8.4.4... -->
13
14      </xsd:sequence | xsd:choice>
15  </xsd:complexType>
16 </xsd:element>

The mandatory attribute name, in line 1, contains the name of the user-defined type. The value userDefinedName is a placeholder the name the user chooses for the type. This type name shall include the suffix PropertyType that is a convention used in GML to indicate that this type may be used to declare feature property elements. In order to adhere to the GML object-property rule, the user-defined type declaration shall reference an element with complex content that contains the desired fields for the complex type. As shown in line 3, the value of the mandatory ref element shall be a qualified element name. The value tns is a placeholder for the namespace prefix of this element. The value userDefinedName is a placeholder for the actual name of the element with complex content. It is recommended that the name of the element match the value userDefinedName used in line 1 as the prefix for the name of the user-defined type.

Line 8 declares an element with complex content. The value of the mandatory name attribute shall match the name of the element referenced in line 3. The comment at line 12 is used to indicate that the element named in line 8 shall contain zero or more element declarations that represent the fields of the complex type. These element declarations shall match the scalar non-spatial or spatial property patterns defined in Clause 8. In other words, a complex type cannot contain a field that is itself a complex type (with the exception of the spatial property types declared in Table 6).

At line 10, the content model of the element may be declared using a sequence or choice model group. The use of the sequence model group means that the order in which fields appear in an instance document shall match the order in which they are declared in a compliant application schema document. The use of the choice model group means that one of the fields may appear in an instance document. The minOccurs and maxOccurs attributes of the sequence or choice model group shall not have a value other than 1.

It should be noted that the complex type defined at line 1 can be used to define any number of feature property elements of the same type.

10.  Schema coding patterns for compliance level SF-2

10.1.  Introduction

Compliance level SF-2 is the least restrictive of the compliance levels defined in this profile and is intended to include all the feature encoding abilities provided by the OpenGIS® Simple Features Specification for SQL, Version 1.1 [1]. Unlike compliance levels SF-0 and SF-1, application schemas that comply with compliance level SF-2 have no restrictions whatsoever placed on non-spatial properties. Spatial properties, however, are limited to the set of geometric property types supported by compliance levels SF-0 and SF-1 with the caveats noted in this clause.

10.2.  Changes from compliance levels SF-0 and SF-1

Application schemas that comply with level SF-2 shall comply with all the sub-clauses in Clause 7 and in Clause 8.2 and Clause 8.3. In addition, application schemas that comply with level SF-2 shall comply with Clause 8.4.2 that describes how to define feature collections, and Clause 8.4.4.11 that describes which geometric property types are supported and how they are to be encoded in conformant application schemas.


Annex A
(normative)
Compliance testing

A.1.  Introduction (Level SF-0, SF-1, SF-2)

This annex outlines how a GML application schema can be tested for compliance with this profile.

It is assumed that a method exists for lexically scanning the application schema being tested in order to access all the elements and attributes contained therein.

The following description is only concerned with interpreting the schema definition in order to ascertain if the schema is compliant with this profile.

The best way to test a GML application schema for compliance to this profile is to build an XML-Schema interpreter that checks all the elements and attributes defined in the application schema for compliance.

The following clauses present each of the XML-Schema pattern templates defined in this profile and describe how to test them for compliance. Every effort has been made to ensure that the schema fragments presented in this annex match those in the main body of this profile. If, however, a discrepancy is found then the fragments in the main body of this profile should be considered normative.

A.2.  Elements to ignore (Level SF-0, SF-1, SF-2)

All XML comments may be ignored. All XML-Schema annotation elements and subelements may be ignored except as directed in this profile.

Attention is drawn to the fact that in this annex, as in the profile, the namespace prefix xsd is used for the XML-Schema namespace. This is purely for illustrative purposes and the prefix xsd should be considered a placeholder for the actual prefix defined in any particular schema instance.

A.3.  General compliance rules (Level SF-0, SF-1, SF-2)

Only the elements and attributes defined or discussed in this profile shall appear in a compliant schema regardless of the implicit elements and attributes that may be defined in XML-Schema or GML.

The order in which elements are declared is not important except where the order matters with regard to XML-Schema or GML.

Only opening tags or elements are described in this annex. It is assumed that the schema is well formed and the corresponding closing tags exist.

The order in which attributes appear in opening elements is not important. The order chosen in this document is purely for the sake of clarity.

A.4.  Root element (Level SF-0, SF-1, SF-2)

A compliant application schema shall be a valid GML application schema, which means that is shall be a valid XML-Schema document. The following fragment defines the root element of a compliant XML-Schema document:

1 <xsd:schema
2   targetNamespace="target_name_space"
3   xmlns:prefix="target_name_space"
4   xmlns:xmlns_prefix="http://www.w3.org/2001/XMLSchema"
5   xmlns:gml="http://www.opengis.net/gml/3.2"
6   xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
7   elementFormDefault="qualified"
8   version="99.99.99">

Compliance rules:

  1. the root element shall be xsd:schema (line 1)

    1. the attribute targetNamespace shall be present (line 2)

      1. its value is user defined

    2. the attribute xmlns:prefix shall be present (line 3)

      1. the value of prefix is user defined and represents the target namespace

      2. the namespace value shall be same as target namespace(line 2)

    3. the attribute xmlns:xmls_prefix shall be present (line 4)

      1. the value xmls_prefix is user defined and is the alias for the XML-Schema namespace; this profile uses xsd as an example

      2. its value shall be ‘http://www.w3.org/2001/XMLSchema

    4. the attribute xmlns:gml shall be present (line 5)

      1. its value shall be ‘http://www.opengis.net/gml/3.2

      2. the namespace alias gml is recommended but may be redefined by the user; this profile uses the prefix gml as an example

    5. the attribute xmlns:gmlsf shall be present (line 6)

      1. its value shall be ‘http://www.opengis.net/gmlsf

      2. the namespace alias shall be gmlsf

    6. additional xmlns:prefix attributes may be present declaring prefixes for imported namespaces

    7. the attribute elementFormDefault should be present

      1. its value shall be ‘qualified’

    8. the attribute version shall be present

      1. its value is user defined

A.5.  Identifying the compliance level (Level SF-0, SF-1, SF-2)

An application schema shall use an appinfo annotation to declare its compliance level (defined in Clause 7.4).

1 <xsd:annotation>
2   <xsd:appinfo source="...SOME URI.../gmlsfLevels.xsd">
3       <gmlsf:ComplianceLevel>0|1|2<gmlsf:ComplianceLevel>
4   </xsd:appinfo>
5 </xsd:annotation>

Compliance rules:

  1. the element xsd:annotation shall be present (line 1)

    1. the element xsd:appinfo shall be present (line 2)

      1. the attribute source shall be present (line 2)

      2. its value shall be some URI that resolves to the contents of gmlsfLevels.xsd (line 2)

      3. the element gmlsf:ComplianceLevel shall be present (line 3)

        1. its value shall be one of 0,1 or 2 (line 3)

          1. the value shall be 0 for application schema that claim compliance with level SF-0

          2. the value shall be 1 for application schemas that claim compliance with level SF-1

          3. the value value be 2 for application schemas that claim compliance with level SF-2

A.6.  Importing the GML schema (Level SF-0, SF-1, SF-2)

All features in a compliant application schema shall be substitutable for gml:AbstractFeature and their definition shall be derived from gml:AbstractFeatureType.

This implies that a compliant application schema shall import the entire GML schema (i.e. gml.xsd). The following element shall appear in a compliant application schema document:

1 <xsd:import
2   namespace="http://www.opengis.net/gml/3.2"
3   schemaLocation="http://... SOME URI.../gml/3.2.1/gml.xsd"/>

Compliance rules:

  1. an xsd:import element shall be present (line 1)

    1. the attribute namespace shall be present (line 2)

      1. its value shall he ‘http://www.opengis.net/gml/3.2

    2. the attribute schemaLocation shall be present (line 3)

      1. its value shall be a valid URL to the complete GML Schema

A.7.  Importing and including other schemas (Level SF-0, SF-1, SF-2)

A conformant schema may import other schemas as long as they too are compliant with this profile. The only exception is the GML schema which is describe in Annex A.6

1 <xsd:import
2   namespace=”target_namespace_of_schema”
3   schemaLocation=”URI_reference_to_schema”/>

Compliance rules:

  1. an xsd:import element may be present (line 1)

    1. the attribute namespace shall be present (line 2)

      1. its value is user defined

    2. The attribute schemaLocation shall be present (line 2)

      1. its value shall be a valid URI reference to the imported schema

1 <xsd:include
2   schemaLocation=”URI_reference_to_schema”/>

Compliance rules:

  1. one or more xsd:include elements may be present (line 1)

    1. For each, the attribute schemaLocation shall be present (line 2)

      1. its value shall be a valid URI reference to the included schema

A.8.  Feature collections (Level SF-0, SF-1)

A.8.1.  Element declaration

A compliant application schema shall define one or more feature types by defining one or more global elements for those feature types.

The following XML-Schema fragment defines the global element for a feature type:

1 <element name="FeatureCollectionName"
2           type="[prefix:]FeatureCollectionNameType"
3           substitutionGroup="gml:AbstractGML"/>

Compliance rules:

  1. an xsd:element element shall be present for each feature collection defined in the application schema (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the feature collection

    2. the attribute type shall be present (line 2)

      1. its value shall be the name of a complex type defined elsewhere in the document that derives from gml:AbstractFeatureType

      2. the value shall follow the following pattern: ‘prefix:FeatureCollectionNameType’

      3. the prefix shall match the target namespace prefix defined in the root element of the schema document

      4. the FeatureCollectionName is the same as the value of the name attribute

      5. the suffix shall be the literal ‘Type’

    3. the attribute substitutionGroup shall be present (line 3)

      1. its value shall be ‘gml:AbstractGML

    4. the prefix gml is recommended but it may be redefined

A.8.2.  Complex type

A complex type shall be defined that corresponds to the value of the type attribute in the definition of the global element of each feature type.

1 <xsd:complexType name="FeatureCollectionNameType">
2   <xsd:complexContent>
3       <xsd:extension base="gml:AbstractFeatureType">
4           <xsd:sequence minOccurs="0" maxOccurs="unbounded">
5               <xsd:element name="featureMember">
6                   <xsd:complexType>
7                       <xsd:complexContent>
8                           <xsd:extension base="gml:AbstractFeatureMemberType">
9                               <xsd:sequence>
10                                  <xsd:element ref="gml:AbstractFeature"/>
11                              </xsd:sequence>
12                          </xsd:extension>
13                      </xsd:complexContent>
10                  </xsd:complexType>
11              </xsd:element>
12          </xsd:sequence>
13      </xsd:extension>
14  </xsd:complexContent>
15 </xsd:complexType>

Compliance rules:

  1. a complexType element shall be present to define the XML type of each feature type

    1. the attribute name shall be present (line 1)

      1. the value shall follow the pattern in validation rule A.6.1(b,ii,iii,iv)

  2. the element xsd:complexContent shall be present (line 2)

  3. the element xsd:extension shall be present (line 3)

    1. the attribute base shall be present

    2. its value shall be ‘gml:AbstractFeatureType’

    3. the prefix gml is recommended but it may be redefined

  4. the element xsd:sequence must be present

    1. the attribute minOccurs must be present

      1. its value must be zero

    2. the attribute maxOccurs must be present

      1. its value must be ‘unbounded’

  5. the element xsd:element must be present (line 5)

    1. the attribute name must be present (line 5)

      1. its value must be featureMember (line 5)

  6. the element xsd:complexType must be present (line 6)

  7. the element xsd:complexContent must be present (line 7)

  8. the element xsd:extensions must be present (line 8)

    1. the attribute base must be present (line 8)

      1. its value must be gml:AbstractFeatureMemberType

  9. the element xsd:sequence must be present (line 9)

  10. the element xsd:element must be present (line 10)

    1. the attribute ref must be present (line 8)

      1. its value must be ‘gml:AbstractFeature’

A.9.  Feature types (Level SF-0, SF-1, SF-2)

A.9.1.  Element declaration

A compliant application schema shall define one or more feature types by defining one or more global elements for those feature types.

The following XML-Schema fragment defines the global element for a feature type:

1 <xsd:element name="FeatureTypeName"
2               type="prefix:FeatureTypeNameType"
3               substitutionGroup="gml:AbstractFeature"/>

Compliance rules:

  1. an xsd:element element shall be present for each feature type defined in the application schema (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the feature type

    2. the attribute type shall be present (line 2)

      1. its value shall be the name of a complex type defined elsewhere in the document that derives from gml:AbstractFeatureType

      2. the value shall follow the following pattern: ‘prefix:FeatureTypeNameType’

      3. the prefix shall match the target namespace prefix defined in the root element of the schema document

      4. the FeatureTypeName is the same as the value of the name attribute

      5. the suffix shall be the literal ‘Type’

    3. the attribute substitutionGroup shall be present (line 3)

      1. its value shall be ‘gml:AbstractFeature’

    4. the prefix gml is recommended but it may be redefined

A.9.2.  Complex type

A complex type shall be defined that corresponds to the value of the type attribute in the definition of the global element of each feature type.

1 <xsd:complexType name="FeatureTypeNameType">
2   <xsd:complexContent>
3       <xsd:extension base="gml:AbstractFeatureType">
4           <xsd:sequence>
5
6           <!-- ... one or more element declarations as described in sec. 8.4.4 ... -->
7
8           </xsd:sequence>
9       </xsd:extension>
11  </xsd:complexContent>
12 </xsd:complexType>

Compliance rules:

  1. a complexType element shall be present to define the XML type of each feature type

    1. the attribute name shall be present (line 1)

      1. the value shall follow the pattern in validation rule Annex A.9.1(b,ii,iii,iv)

  2. the element xsd:complexContent shall be present (line 2)

  3. the element xsd:extension shall be present (line 3)

    1. the attribute base shall be present

    2. its value shall be ‘gml:AbstractFeatureType’

    3. the prefix gml is recommended but it may be redefined

  4. the element xsd:sequence shall be present (line 4)

  5. zero or more property definitions shall follow (line 6)

    1. for compliance level SF-0 property definitions are described in Clause 8.4.4.1 through Clause 8.4.4.14

    2. for compliance level SF-1 property definitions are described in Clause 8.4.4.1 through Clause 8.4.4.14 with the provisos in Clause 9.2 and Clause 9.3

    3. for compliance level SF-2 any property definitions are allowed following any desired pattern except for spatial properties which must conform to Clause 8.4.4.10

A.10.  Properties

A.10.1.  Integer valued properties (Level SF-0, SF-1)

Each integer-valued property shall be defined using the following XML-Schema fragments:

SHORT FORM

1 <xsd:element name=”propertyName” type=”xsd:integer”
2              [minOccurs=”0|N”] [maxOccurs=”1|N|unbounded”][nillable=”true|false”]/>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall present (line 1)

      1. its value shall be the qualified name integer

    3. the attribute minOccurs may be present (line 2)

      1. for application schemas that claim compliance to level SF-0

      2. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall equal 1

        2. for compliance level 1, N shall be >= 1

      3. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1, or some value N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or the value unbounded

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if present, it value shall be true or false

      2. if not present, the default value is false

LONG FORM

1 <xsd:element name=”propertyName”
2   [minOccurs=”0|N”] [maxOccurs=”1|N|unbounded”][nillable=”true|false”]>
3   <xsd:simpleType>
4       <xsd:restriction base=”xsd:integer”>
5           [<xsd:totalDigits value=”nDigits”/>]
6          <!— … Optional facets describe in sub-clause 8.4.4.2 … —>
7       </xsd:restriction>
8   </xsd:simpleType>
9 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >= 1

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or the value unbounded

      2. if it is not present, the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 2)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:simpleType shall be present (line 3)

  3. the element xsd:restriction shall be present (line 4)

    1. the attribute base shall be present (line 4)

      1. its value shall be ‘xsd:integer’

  4. the element xsd:totalDigits may be present (line 5)

    1. if xsd:totalDigits is present, the attribute value shall be present (line 5)

      1. its value is user defined and shall represent the number of digits in the integer

  5. one or more optional facets (Clause 8.4.4.2) may be present (line 6)

    1. only the facets defined in Clause 8.4.4.2 may be included

    2. for any additional facet, only the attributes defined in Clause 8.4.4.2 may be present

A.10.2.  Real valued properties (Level SF-0, SF-1)

SHORT FORM

1 <xsd:element name=”propertyName” type=”xsd:double”
2       [minOccurs=”0|N”] [maxOccurs=”0|N|unbounded”][nillable=”true|false”]/>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall be present (line 1)

      1. its value shall be the qualified name double

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >= 1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or unbounded

      2. if it not present, the default value is 1

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if present, its value shall be true or false

      2. if not present, the default value is false

LONG FORM

1 <xsd:element name=”propertyName” [minOccurs=”0|N”]
        [maxOccurs=”1|N|unbounded”][nillable=”true|false”>
2   <xsd :simpleType>
3       <xsd:restriction base=”xsd:double|xsd:decimal”>
4           … Optional facets described in sub-clause 8.4.4.2 …
5           [<xsd:totalDigits value=”N”/>]
6           [<xsd:fractionDigits value=”N” />]
7       </xsd:restiction>
8   </xsd :simpleType>
9 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 1)

      1. if it is present, its value shall be 0 or some integer N>0

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 1)

      1. if it is present, its value shall 1 or some integer N>1 or unbounded

      2. if it is not present, the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 1)

    5. for compliance level 1, the attribute nillable may be present (line 1)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:simpleType shall be present (line 3)

  3. the element xsd:restriction shall be present (line 4)

    1. the attribute base shall be present (line 4)

      1. its value shall be ‘xsd:decimal‘ or ‘xsd:double

        1. if the value of the type attribute is xsd:decimal then the facets totalDigits and fractionDigits shall be specified (lines 5 & 6)

          1. the only allowed attribute on both the totalDigits and fractionDigits facets is value

        2. if the value of the type attribute is xsd:double then the facts totalDigits and fractionDigits shall not be specified (lines 5 & 6)

  4. one or more optional facets (Clause 8.4.4.2) may be present (line 7)

    1. only the facets defined in Clause 8.4.4.2 may be included

    2. for any additional facet, only the attributes defined in Clause 8.4.4.2 may be present

A.10.3.  Character string valued properties (Level SF-0, SF-1)

SHORT FORM

1 <xsd:element name=”propertyName” type=”xsd:string”
2       [minOccurs=”0|N”] [maxOccurs=”1|N|unbounded”] [nillable=”true|false”]/>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall be present (line 1)

      1. its value shall be the qualified name string

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1, or some integer N

        1. for compliance level 0, N shall be >=1 or unbounded

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value if false

LONG FORM

1 <xsd:element name=”propertyName”
2       [minOccurs=”0|N”] [maxOccurs=”1|N|unbounded”] [nillable=”true|false”]>
2   <xsd:simpleType>
3       <xsd:restriction base=”xsd:string”>
4           <xsd:maxLength value=”nCharacters”/> -or- <xsd:length value=”nCharacters”/>
5           … Optional facets described in sub-clause 8.4.4.2 …
6       </xsd:restriction>
7   </xsd:simpleType>
8 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >= 1

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 2)

      1. if it is present its value shall be 1 or some integer N

        1. for compliance level 0 N shall be 1

        2. for compliance level 1 N shall be >=1 or unbounded

      2. if it is not present the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 2)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:simpleType shall be present (line 3)

  3. the element xsd:restriction shall be present (line 4)

    1. the attribute base shall be present (line 4)

      1. its value shall be ‘xsd:string’

  4. the element xsd:maxLength OR xsd:length shall be present (line 5)

    1. if present, the attribute value shall be present (line 5)

      1. its value is user defined and represents the max number of chars that the string can be (xsd:maxLength) or the fixed length of the character string (xsd:length)

    2. if not present, the max length of the string is undefined

  5. one or more optional facets (Clause 8.4.4.2) may be present (line 7)

    1. only the facets defined in Clause 8.4.4.2 may be included

    2. for any additional facet, only the attributes defined in Clause 8.4.4.2 may be present

A.10.4.  Date valued properties (Level SF-0, SF-1)

SHORT FORM

1 <xsd:element name=”propertyName” type=”xsd:date | xsd:dateTime”
2       [minOccurs=”0|N”] [maxOccurs=”0|N|unbounded”] [nillable=”true|false”]>

Compliance Rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall be present (line 1)

      1. its value shall be one of the qualified names date or dateTime

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0 N shall be 1

        2. for compliance level 1, N shall be >=1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1, or some integer N

        1. for compliance level 0 N shall be 1

        2. for compliance level 1 N shall be >=1 or unbounded

      2. if it is not present, the default value is 1

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value if false

LONG FORM

1 <xsd:element name=”propertyName”
2       [minOccurs=”0|N”] [maxOccurs=”0|N|unbounded”] [nillable=”true|false”]>
3   <xsd:simpleType>
4       <xsd:restriction base=”xsd:date | xsd:dateTime”>
5           … Optional facets described in sub-clause 8.4.4.2. …
6       </xsd:restriction>
7   </xsd:simpleType>
8 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

      2. if it is not present, the default value shall be 1

    3. the attribute maxOccurs may be present (line 2)

      1. if it is present its value shall be 0 or some integer N or unbounded

      2. if it is not present the default value shall be 1

    4. for compliance level 0, the attribute nillable shall not be present (line 2)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:simpleType shall be present (line 3)

  3. the element xsd:restriction shall be present (line 4)

    1. the attribute base shall be present (line 15)

      1. its values shall be xsd:date or xsd:dateTime

  4. one or more optional facets (Clause 8.4.4.2) may be present (line 7)

    1. only the facets defined in Clause 8.4.4.2 may be included

    2. for any additional facet, only the attributes defined in Clause 8.4.4.2 may be present

A.10.5.  Boolean valued properties (Level SF-0, SF-1)

1 <xsd:element name="propertyName" type="xsd:boolean"
2           [minOccurs="0|N"] [maxOccurs="0|N|unbounded"][nillable="true|false"]/>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of the property

    2. the attribute type shall be present (line 1)

      1. it value shall be xsd:boolean

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or the value unbounded

      2. if it is not present, the default value is 1

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is presents, its value shall be true or false

      2. if it is not present, the default value is false

A.10.6.  Binary valued properties (Level SF-0, SF-1)

1 <xsd:element name="propertyName"
2       [minOccurs="0|N"] [maxOccurs="0|N|unbounded"] [nillable="true|false"]>
3   <xsd:complexType>
4       <xsd:simpleContent>
5           <xsd:extension base="xsd:base64Binary|xsd:hexBinary">
6               <xsd:attribute name="url"
7                       type="xsd:anyURI" use="optional"/>
8               <xsd:attribute name="mimeType"
9                       type="xsd:string" use="required"/>
10              <xsd:attribute name="role"
11                      type="xsd:string" use="optional"/>
12              <xsd:attribute name="length"
13                      type="xsd:positiveInteger" use="optional"
12          </xsd:extension>
13      </xsd:simpleContent>
14  </xsd:complexType>
15 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of property

    2. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0 N shall be 1

        2. for compliance level 1, N shall be >= 1

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 1, N shall be >=1 or the value unbounded

      2. if it is not present, the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 2)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, it value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:complexType shall be present (line 3)

  3. the element xsd:simpleContent shall be present (line 4)

  4. the element xsd:extension shall be present (line 5)

    1. the attribute base shall be present (line 5)

      1. its value shall one or xsd:base64Binary or xsd:hexBinary

  5. the element xsd:attribute shall be present (line 6)

    1. the attribute name shall be present (line 6)

      1. its value shall be ‘url’

    2. the attribute type shall be present (line 7)

      1. its value shall be ‘xsd:anyURI’

    3. the attribute use shall be present (line 7)

      1. its value shall be ‘optional’

  6. the element xsd:attribute shall be present (line 8)

    1. the attribute name shall be present (line 8)

      1. its value shall be ‘mimeType’

    2. the attribute type shall be present (line 9)

      1. its value shall be ‘xsd:string’

    3. the attribute use shall be present (line 9)

      1. its value shall be ‘required’

  7. the element xsd:attribute shall be present (line 10)

    1. the attribute name shall be present (line 10)

      1. its value shall be ‘role’

    2. the attribute type shall be present (line 11)

      1. its value shall be ‘xsd:string’

    3. the attribute use shall be present (line 11)

      1. its value shall be ‘optional’

  8. the element xsd:attribute shall be present (line 12)

    1. the attibute name shall be present (line 12)

      1. its value shall be ‘length’

    2. the attribute type shall be present (line 13)

      1. its value shall be ‘positiveInteger’

    3. the attribute use shall be present (line 13)

      1. its value shall be ‘optional’

A.10.7.  Geometry valued properties (Level SF-0, SF-1)

1 <xsd:element name="propertyName"
2       type="gml_geometric_propertyType"
3       [minOccurs="0|N"] [maxOccurs="0|N|unbounded"] [nillable="true|false"]>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of the property

    2. the attribute type shall be present (line 2)

      1. it value shall be one of: gml:PointPropertyType, gml:CurvePropertyType, gml:SurfacePropertyType, gml:GeometryPropertyType, gml:MultiPointPropertyType, gml:MultiCurvePropertyType, gml:MultiSurfacePropertyType, gml:MultiGeometryPropertyType

    3. the attribute minOccurs may be present (line 3)

      1. if it is present, its value shall be 0 or some integer N

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 3)

      1. if it is present, its value shall be 0 or some integer N or unbounded

      2. if it is not present, the default value is 1

    5. for compliance level 0, the attribute nillable shall not be present (line 3)

    6. for compliance level 1, the attribute nillable may be present (line 3)

      1. if it is present, it value shall be true or false

      2. if it is not present, the default value is false

    7. In an instance document, the allowed values for each of the geometric property types is defined in Table 6.

A.10.8.  Properties with URI valued content (Level SF-0, SF-1, SF-2)

1 <xsd:element name="propertyName" type="xsd:anyURI"
2       [minOccurs="0|N"] [maxOccurs="0|N|unbounded"] [nillable="true|false"]/>

Compliance Rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall present (line 1)

      1. its value shall be the qualified name anyURI

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1, or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or unbounded

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

A.10.9.  Properties with references to other resources (Level SF-0, SF-1)

1 <xsd:element name="propertyName" type="gml:ReferenceType"
2           [minOccurs="0|1"] [maxOccurs="1|N|unbounded"] [nillable="true|false"]>
3   <xsd:annotation>
4       <xsd:appinfo source="urn:x-gml:targetElement">target element</xsd:appinfo>
5   </xsd:annotation>
6 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall be present (line 1)

      1. its value shall be gml:ReferenceType

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or 1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or unbounded

      2. if it is not present, the default value is 1

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if present, its value shall be true or false

      2. if not present, the default value is false

  2. the element xsd:annotation shall be present (line 3)

  3. the element xsd:appinfo shall be present (line 4)

    1. the source attribute shall be present (line 4)

      1. its value shall be urn:x-gml:targetElement

    2. the content of the xsd:appinfo element shall be the fully qualified name of the element being referenced

A.10.10.  Properties with string values from a code list (Level SF-0, SF-1)

1 <xsd:element name="propertyName" [minOccurs="0|N"]            [maxOccurs="1|N|unbounded"]
            [nillable="true|false"]>
2   <xsd:complexType>
3       <xsd:simpleContent>
4           <xsd:restriction base="gml:CodeType">
5               <xsd:attribute name="codeSpace" type="xsd:anyURI"
6                           [use="optional"] default|fixed="...SOME URI..."/>
7           </xsd:restriction>
8       </xsd:simpleContent>
9   </xsd:complexType>
10 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 1)

      1. if it is present, its value shall be 0 or 1

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 1)

      1. if it is present, its value shall be 1 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or unbounded

      2. if it is not present, the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 1)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:complexType shall be present (line 2)

  3. the element xsd:simpleContent shall be present (line 3)

  4. the element xsd:restriction shall be present (line 4)

    1. the attribute base shall be present (line 4)

      1. its value shall be gml:CodeType

  5. the element xsd:attribute shall be present (line 5)

    1. the attribute name shall be present (line 5)

      1. its value shall be codeSpace

    2. the attribute type shall be present (line 5)

      1. its value shall be xsd:anyURI

    3. the attribute use may be present (line 6)

      1. its value shall be optional

      2. if the use attribute is not present, the default value is optional

    4. one of the attributes default or fixed shall be present (line 6)

      1. its value shall be a URI that resolved to a GML simple dictionary profile document

A.10.11.  Measurements (Level SF-0, SF-1)

1 <xsd:element name="propertyName"
2   [minOccurs="0|N"] [maxOccurs="0|N|unbounded"] [nillable="true|false"]>
3       <xsd:complexType>
4           <xsd:simpleContent>
5               <xsd:restriction base="xsd:double">
6                   ... Optional facets described in sub-clause 8.4.4.2 ...
7               </xsd:restiction>
8           </xsd:simpleType>
9       </xsd:complexType>
10 </xsd :element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or the value unbounded

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1 or the value unbounded

      2. if it is not present, the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 2)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:complexType shall be present (line 3)

  3. the element xsd:simpleContent shall be present (line 4)

  4. the element xsd:restriction shall be present (line 5)

    1. the attribute base shall be present (line 5)

      1. its value shall be ‘gml:MeasureType’

  5. one or more optional facets (Clause 8.4.4.2) may be present (line 6)

    1. only the facets defined in Clause 8.4.4.2 may be included

    2. for any additional facet, only the attributes defined in Clause 8.4.4.2 may be present

A.10.12.  Complex-value properties (Level SF-1)

A.10.12.1.  Introduction

The pattern described here following GML object-property rule, which necessitates the element nesting, described in this clause.

A.10.12.2.  User defined property declaration

The following pattern declares a property of a feature of user-defined type:

1 <xsd:element name="propertyName"
2               type="userDefinedNamePropertyType"
3               [minOccurs="0|N"] [maxOccurs="0|N|unbounded"] [nillable="true|false">

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. it value is user defined and represents the name of the property

    2. the attribute type shall be present (line 2)

      1. its value is user defined and shall be of a type defined elsewhere in the application schema

    3. the attribute minOccurs may be present (line 3)

      1. it if is present, its value shall be 0 or some integer N

        1. for compliance level SF-0, N shall be 1

        2. for compliance level SF-1, N shall be >=1 or the value unbounded

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 3)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level SF-0, N shall be 1

        2. for compliance level SF-1, N shall be >= 1 or the value unbounded

    5. for compliance level 0, the attribute nillable shall not be present (line 3)

    6. for compliance level 1, the attribute nillable may be present (line 3)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

A.10.12.3.  User-defined complex type declaration

The following XML Schema fragment describes the pattern for defining a user-defined complex type. Following the GML object-property pattern, the user-defined type references an element that declares the properties of the complex type.

1 <xsd:complexType name="userDefineNamePropertyType">
2   <xsd:sequence>
3       <xsd:element ref="[prefix:]userDefinedName"/>
4   </xsd:sequence>
5 </xsd:complexType>
6
7 <xsd:element name="userDefinedName">
8   <xsd:complexType>
9       <xsd:sequence|xsd:choice>
10
11      <!-- ...one or more element declarations as described in clause 8.4.4... -->
12
13      </xsd:sequence|xsd:choice>
14 </xsd:complexType>
15 </xsd:element>

Compliance rules:

  1. the element xsd:complexType shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. the value is user defined and represents the name of the user defined type

      2. the type name shall have the suffix ‘PropertyType’

  2. the element xsd:sequence shall be present (line 2)

  3. the element xsd:element shall be present (line 3)

    1. the attribute ref shall be present

    2. the value shall reference an element declared elsewhere in the application schema (line 3) that declares the properties of the complex type

  4. the element xsd:element shall be present (line 7)

    1. the attribute name shall be present

    2. its value shall be the name of the element (line 7) referenced in line 3

  5. the element xsd:complexType shall be present (line 8)

  6. either the element xsd:sequence or the element xsd:choice shall be present (line 9)

  7. one or more element declarations as described in Clause 8.4.4 shall follow

A.10.13.  Internationalized string

TYPE DECLARATION

1 <xsd:complexType name=”xxx:LanguageStringType”>
2   <xsd:simpleContent>
3       <xsd:extension base=”string”>
4           <xsd:attribute ref=”xml:lang” use=”optional”/>
5       </xsd:extension>
6   </xsd:simpleContent>
7 </xsd:complexType>

Compliance rules:

  1. the complex type xxx:LanguageStringType shall be defined in the application schema

    1. the element xsd:complexType shall be present (line 1)

      1. the attribute name shall be present (line 1)

        1. its value shall be xxx:LangaugeString where xxx is a placeholder for the target namespace of the application schema (line 1)

    2. the element xsd:simpleContent shall be present (line 2)

    3. the element xsd:extension shall be present (line 3)

      1. the attribute base shall be present (line 3)

        1. its value shall be xsd:string (line 3)

    4. the element xsd:attribute shall be present (line 4)

      1. the attribute ref shall be present (line 4)

        1. its value shall be xml:lang (line 4)

    5. the attribute use shall be present (line 4)

      1. its value shall be optional

SHORT FORM

1 <xsd:element name=”propertyName” type=”xxx:LanguageStringType”
2       [minOccurs=”0|N”] [maxOccurs=”1|N|unbounded”] [nillable=”true|false”]/>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute type shall be present (line 1)

      1. its value shall be xxx:LanguageStringType where xxx is the target namespace of application schema

    3. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >=1

      2. if it is not present, the default value is 1

    4. the attribute maxOccurs may be present (line 2)

      1. if it is present, its value shall be 1, or some integer N

        1. for compliance level 0, N shall be >=1 or unbounded

    5. for compliance level 0, the attribute nillable shall not be present (line 2)

    6. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value if false

LONG FORM

1 <xsd:element name=”propertyName”
2       [minOccurs=”0|N”] [maxOccurs=”1|N|unbounded”][nillable=”true|false”]>
3   <xsd:complexType>
4       <xsd:simpleContent>
5           <xsd:restriction base=”xxx:LanguageStringType”>
6               <xsd:maxLength value=”nCharacters”/>-or-<xsd:length value=”nCharacters”/>
7               … Optional facets described in sub-clause 8.4.4.2 …
8           </xsd:restriction>
9       </xsd:simpleContent>
10  </xsd:complexType>
11 </xsd:element>

Compliance rules:

  1. the element xsd:element shall be present (line 1)

    1. the attribute name shall be present (line 1)

      1. its value is user defined and represents the name of the property

    2. the attribute minOccurs may be present (line 2)

      1. if it is present, its value shall be 0 or some integer N

        1. for compliance level 0, N shall be 1

        2. for compliance level 1, N shall be >= 1

      2. if it is not present, the default value is 1

    3. the attribute maxOccurs may be present (line 2)

      1. if it is present its value shall be 1 or some integer N

        1. for compliance level 0 N shall be 1

        2. for compliance level 1 N shall be >=1 or unbounded

      2. if it is not present the default value is 1

    4. for compliance level 0, the attribute nillable shall not be present (line 2)

    5. for compliance level 1, the attribute nillable may be present (line 2)

      1. if it is present, its value shall be true or false

      2. if it is not present, the default value is false

  2. the element xsd:complexType shall be present (line 3)

  3. the element xsd:simpleContent shall be present (line 3)

  4. the element xsd:restriction shall be present (line 5)

    1. the attribute base shall be present (line 5)

      1. its value shall be xxx:LanguageStringType where xxx is the target namespace of the application schema

  5. the element xsd:maxLength OR xsd:length shall be present (line 6)

    1. if present, the attribute value shall be present (line 6)

      1. its value is user defined and represents the max number of chars that the string can be (xsd:maxLength) or the fixed length of the character string (xsd:length)

    2. if not present, the max length of the string is undefined

  6. one or more optional facets (Clause 8.4.4.2) may be present (line 7)

    1. only the facets defined in Clause 8.4.4.2 may be included

    2. for any additional facet, only the attributes defined in Clause 8.4.4.2 may be present


Annex B
(normative)
Schema file gmlsfLevels.xsd

The following schema file, called gmlsfLevels.xsd declares the gmlsf:ComplianceLevel element used in application schemas to declare the level of conformance to this profile.

<?xml version="1.0" ?>
<schema
    targetNamespace="http://www.opengis.net/gmlsf/2.0"
    xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
    xmlns="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <annotation>
        <documentation>
            Compliance levels schema for Simple features GML 3.2 Profile
            Copyright (c) 2011 Open Geospatial Consortium, Inc.
            All Rights Reserved.
        </documentation>
    </annotation>
    <!-- ============================================================= -->
    <element name="ComplianceLevel">
        <annotation>
            <documentation>
                Level 0 = no complex-valued properties and minOccurs,maxOccurs
                        have a value domain of 0 or 1
                Level 1 = complex-valued properties with no restriction on
                        minOccurs and maxOccurs
                Level 2 = no restrictions on type of non-spatial scalar properties
                        but must only support spatial properties declared in
                        clause 8
            </documentation>
        </annotation>
        <simpleType>
            <restriction base="integer">
                <enumeration value="0"/>
                <enumeration value="1"/>
                <enumeration value="2"/>
            </restriction>
        </simpleType>
    </element>
</schema>

Annex C
(informative)
Mapping to SQL/MM geometric types

The following table maps all the geometric property types supported by this profile to their equivalent SQL/MM geometry types. The information in Table C.1 was compiled from the mapping presented in Table 14 of the SQL/MM specification [7].

Table C.1 — GML geometric property types mapped to SQL/MM types.

GML Geometric Property Type Equivalent SQL/MM Type
gml:PointPropertyType ST_Point
gml:CurvePropertyType ST_LineString.
gml:SurfacePropertyType ST_Polygon
gml:GeometryPropertyType ST_Geometry
gml:MultiPointPropertyType ST_MultiPoint
gml:MultiCurvePropertyType ST_MultiCurve
gml:MultiSurfacePropertyType ST_MultiSurface
gml:MultiGeometryPropertyType ST_GeomCollection

Annex D
(informative)
Examples

D.1.  News item example

The following is a GML application schema that defines two features types, Reporter and NewsItem and complies with the coding patterns described in this document:

<?xml version="1.0" encoding="ISO-8859-1"?>
<schema
    targetNamespace="http://www.cubewerx.com/cw"
    xmlns:cw="http://www.cubewerx.com/cw"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
    elementFormDefault="qualified"
    version="1.0">

    <annotation>
        <appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
            <gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
        </appinfo>
    </annotation>
    <!-- ============================================================= -->
    <!-- === includes and imports === -->
    <!-- ============================================================= -->
    <import namespace="http://www.opengis.net/gml/3.2"
            schemaLocation="http://schemas.opengis.net/gml/3.2.1/base/gml.xsd"/>
    <import namespace="http://www.opengis.net/gmlsf/2.0"
            schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
    <!-- =========================================================
        define feature types
        ========================================================= -->
    <element name="Reporter" type="cw:ReporterType"
            substitutionGroup="gml:AbstractFeature"/>
    <!-- ============================================================= -->
    <complexType name="ReporterType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence>
                    <element name="reporterId">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="9"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element name="firstName" minOccurs="0" maxOccurs="1">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="20"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element name="lastName" minOccurs="0" maxOccurs="1">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="20"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element name="organization" minOccurs="0" maxOccurs="1">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="50"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element name="email" minOccurs="0" maxOccurs="1">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="50"/>
                            </restriction>
                        </simpleType>
                        </element>
                        <element name="age" minOccurs="0" maxOccurs="1">
                            <simpleType>
                                <restriction base="integer">
                                    <totalDigits value="10"/>
                                </restriction>
                            </simpleType>
                        </element>
                        <element name="photo" minOccurs="0" maxOccurs="1">
                            <complexType>
                                <simpleContent>
                                    <extension base="base64Binary">
                                        <attribute name="url" type="anyURI" use="optional"/>
                                        <attribute name="mimeType" type="string"
                                            use="required"/>
                                        <attribute name="role" type="string" use="optional"/>
                                    </extension>
                                </simpleContent>
                            </complexType>
                        </element>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <element name="NewsItem" type="cw:NewsItemType"
            substitutionGroup="gml:AbstractFeature"/>
        <!-- ============================================================= -->
        <complexType name="NewsItemType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence>
                        <element name="location" type="gml:PointPropertyType"
                            minOccurs="1" maxOccurs="1"/>
                        <element name="reporterId" minOccurs="1" maxOccurs="1">
                            <simpleType>
                                <restriction base="string">
                                    <maxLength value="9"/>
                                </restriction>
                            </simpleType>
                        </element>
                        <element name="eventDate" type="dateTime" minOccurs="1"
                            maxOccurs="1"/>
                        <element name="byLine" minOccurs="1" maxOccurs="1">
                            <simpleType>
                                <restriction base="string">
                                    <maxLength value="30"/>
                                </restriction>
                            </simpleType>
                        </element>
                        <element name="details" minOccurs="1" maxOccurs="1">
                            <simpleType>
                                <restriction base="string">
                                    <maxLength value="20000"/>
                                </restriction>
                            </simpleType>
                        </element>
                        <element name="image" minOccurs="0" maxOccurs="5">
                            <complexType>
                                <simpleContent>
                                    <extension base="base64Binary">
                                        <attribute name="url" type="anyURI" use="optional"/>
                                        <attribute name="mimeType" type="string"
                                            use="required"/>
                                        <attribute name="role" type="string" use="optional"/>
                                    </extension>
                                </simpleContent>
                            </complexType>
                        </element>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <!-- Define a feature collection for a set of news items -->
        <!-- ============================================================= -->
        <element name="NewsItems"
                type="cw:NewsItemsType"
                substitutionGroup="gml:AbstractGML"/>
        <complexType name="NewsItemsType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence minOccurs="1" maxOccurs="unbounded">
                        <element name="featureMember">
                            <complexType>
                                <complexContent>
                                    <extension base="gml:AbstractFeatureMemberType">
                                        <sequence>
                                            <element ref="gml:AbstractFeature"/>
                                        </sequence>
                                    </extension>
                                </complexContent>
                            </complexType>
                        </element>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
</schema>

D.2.  Roads_bts example from the CIPI1.2 testbed

<?xml version="1.0" encoding="ISO-8859-1"?>
<schema
    targetNamespace="http://www.opengis.org/cipi1.2/level0/bts"
    xmlns:bts="http://www.opengis.org/cipi1.2/level0/bts"
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
    xmlns="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    version="1.0">
    <annotation>
        <appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
        <gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
        </appinfo>
    </annotation>
    <!-- ============================================================= -->
    <!-- === includes and imports === -->
    <!-- ============================================================= -->
    <import namespace="http://www.opengis.net/gml/3.2"
        schemaLocation="http://schemas.opengis.net/gml/3.2.1/base/gml.xsd"/>
    <import namespace="http://www.opengis.net/gmlsf/2.0"
        schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
    <!-- =========================================================
        define feature types
        ========================================================= -->
    <element name="Roads_bts" type="bts:Roads_btsType"
                substitutionGroup="gml:AbstractFeature"/>
    <!-- ============================================================= -->
    <complexType name="Roads_btsType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence>
                    <element maxOccurs="1" minOccurs="1" name="Objectid_1">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="1" name="Objectid">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="1" name="FNode_">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="1" name="TNode_">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="LPoly_">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="RPoly_">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Length"
                        type="gml:MeasureType"/>
                    <element maxOccurs="1" minOccurs="1" name="Bdt_roads_">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="1" name="Bdt_roads1">
                        <simpleType>
                            <restriction base="integer">
                                <totalDigits value="10"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Prefix">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="2"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Name">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="30"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Type">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="4"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Suffix">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="2"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="1" name="Fcc">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="3"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="1" name="Fips">
                        <simpleType>
                            <restriction base="string">
                                <maxLength value="11"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Shape_len">
                        <simpleType>
                            <restriction base="decimal">
                                <totalDigits value="30"/>
                                <fractionDigits value="15"/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="Geometry"
                        type="gml:CurvePropertyType"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!-- ============================================================= -->
    <!-- Define a feature collection for a set of Roads_bts -->
    <!-- ============================================================= -->
    <element name="Roads"
            type="bts:RoadsType"
            substitutionGroup="gml:AbstractGML"/>
    <complexType name="RoadsType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence minOccurs="1" maxOccurs="unbounded">
                    <element name="featureMember">
                        <complexType>
                            <complexContent>
                                <extension base="gml:AbstractFeatureMemberType">
                                    <sequence>
                                        <element ref="gml:AbstractFeature"/>
                                    </sequence>
                                </extension>
                            </complexContent>
                        </complexType>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
</schema>

D.3.  Hydrography model example

<?xml version="1.0" encoding="ISO-8859-1"?>
<schema
    targetNamespace="http://www.fgdc.gov/framework/073004/hydro"
    xmlns:hyd="http://www.fgdc.gov/framework/073004/hydro"
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
    xmlns="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    version="0.0.4">

    <annotation>
        <appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
            <gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
        </appinfo>
    </annotation>
    <!-- ============================================================= -->
    <!-- === includes and imports === -->
    <!-- ============================================================= -->
    <import namespace="http://www.opengis.net/gml/3.2"
        schemaLocation="http://schemas.opengis.net/gml/3.2.1/base/gml.xsd"/>
    <import namespace="http://www.opengis.net/gmlsf/2.0"
    schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
    <!-- ============================================================= -->
    <!-- IDENTIFIER -->
    <!-- ============================================================= -->
    <complexType name="IdentifierPropertyType">
        <sequence>
            <element ref="hyd:Identifier"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="Identifier">
        <complexType>
            <sequence>
                <element name="identifier" type="string"/>
                <element name="idAuthority" type="string" minOccurs="0"
                    maxOccurs="1"/>
                <element name="description" type="string" minOccurs="0"
                    maxOccurs="1"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- EXTERNALRESOURCE -->
    <!-- ============================================================= -->
    <complexType name="ExternalResourcePropertyType">
        <sequence>
            <element ref="hyd:ExternalResource"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="ExternalResource">
        <complexType>
            <sequence>
                <element name="url" type="anyURI"/>
                <element name="urlType" minOccurs="0" maxOccurs="1">
                    <complexType>
                        <simpleContent>
                            <restriction base="gml:CodeType">
                                <attribute name="codeSpace" type="anyURI"
                                    default="../Dictionaries/ResourceTypesDictionary.xml"/>
                            </restriction>
                        </simpleContent>
                    </complexType>
                </element>
                <element name="urlDescription" type="string" minOccurs="0"
                    maxOccurs="1"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- RESPONSIBLEPARTY -->
    <!-- ============================================================= -->
    <complexType name="ResponsiblePartyPropertyType">
        <sequence>
            <element ref="hyd:ResponsibleParty"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="ResponsibleParty">
        <complexType>
            <sequence>
                <element name="individualName" type="string"/>
                <element name="organizationName" type="string" minOccurs="0"
                    maxOccurs="1"/>
                <element name="positionName" type="string" minOccurs="0"
                    maxOccurs="1"/>
                <element name="contactInfo" type="string" minOccurs="0"
                    maxOccurs="1"/>
                <element name="role" type="string"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- EXTENDEDATTRIBUTE -->
    <!-- ============================================================= -->
    <complexType name="ExtendedAttributePropertyType">
        <sequence>
            <element ref="hyd:ExtendedAttribute"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="ExtendedAttribute">
        <complexType>
            <sequence>
                <element name="authority" type="string"/>
                <element name="link" type="hyd:ExternalResourcePropertyType"
                    minOccurs="0" maxOccurs="1"/>
                <element name="name" type="string"/>
                <element name="type" minOccurs="0" maxOccurs="1">
                    <complexType>
                        <simpleContent>
                            <restriction base="gml:CodeType">
                                <attribute name="codeSpace" type="anyURI" use="optional"
                                    default="../Dictionaries/DatatypeDictionary.xml"/>
                            </restriction>
                        </simpleContent>
                    </complexType>
                </element>
                <element name="value" type="string"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- NAME -->
    <!-- ============================================================= -->
    <complexType name="NamePropertyType">
        <sequence>
            <element ref="hyd:Name"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="Name">
        <complexType>
            <sequence>
                <element name="name" type="string"/>
                <element name="nameId" type="hyd:IdentifierPropertyType"
                    minOccurs="0" maxOccurs="1"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- REPRESENTATION -->
    <!-- ============================================================= -->
    <complexType name="RepresentationPropertyType">
        <sequence>
            <element ref="hyd:Representation"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="Representation">
        <complexType>
            <sequence>
                <element name="representationId" type="hyd:IdentifierPropertyType"
                    minOccurs="0" maxOccurs="1"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- MEASUREMENT -->
    <!-- ============================================================= -->
    <complexType name="MeasurementPropertyType">
        <sequence>
            <element ref="hyd:Measurement"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="Measurement">
        <complexType>
            <sequence>
                <element name="accuracy" type="string" minOccurs="0" maxOccurs="1"/>
                <element name="reportingOrganization"
                    type="hyd:ResponsiblePartyPropertyType"/>
                <element name="units">
                    <complexType>
                        <simpleContent>
                            <restriction base="gml:CodeType">
                                <attribute name="codeSpace" type="anyURI" use="optional"
                                    default="../Dictionaries/UnitsDictionary.xml"/>
                            </restriction>
                        </simpleContent>
                    </complexType>
                </element>
                <element name="value" type="string"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- ============================================================= -->
    <complexType name="ComputedNetworkValuesPropertyType">
        <sequence>
            <element ref="hyd:ComputedNetworkValues"/>
        </sequence>
    </complexType>
    <!-- ============================================================= -->
    <element name="ComputedNetworkValues">
        <complexType>
            <sequence>
                <element name="fromNode" type="integer"/>
                <element name="toNode" type="integer"/>
                <element name="hydrologicSequenceNumber" type="integer"/>
                <element name="startFlag" type="integer"/>
                <element name="terminalFlag" type="integer"/>
                <element name="terminalDrainId" type="integer"/>
                <element name="levelPathId" type="integer"/>
                <element name="arbolateSumKm" type="gml:MeasureType"/>
                <element name="pathLengthKm" type="gml:MeasureType"/>
                <element name="thinner" type="integer"/>
                <element name="divergenceFlag" type="integer"/>
                <element name="drainStreamLevel" type="integer"/>
                <element name="downstreamDrainLevel" type="integer"/>
                <element name="streamOrder" type="integer"/>
                <element name="upstreamLevelPathId" type="integer"/>
                <element name="upstreamHydrologicSequenceNumber" type="integer"/>
                <element name="upstreamMinimumHydrologicSequenceNumber"
                    type="integer"/>
                <element name="downstreamLevelPathId" type="integer"/>
                <element name="downstreamDrainCount" type="integer"/>
                <element name="downstreamMinorHydrologicSequenceNumber"
                    type="integer"/>
            </sequence>
        </complexType>
    </element>
    <!-- ============================================================= -->
    <!-- HYDRO COLLECTION -->
    <!-- ============================================================= -->
    <element name="HydroCollection" type="hyd:HydroCollectionType"
        substitutionGroup="gml:AbstractFeature"/>
    <!-- ============================================================= -->
    <complexType name="HydroCollectionType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence>
                    <element name="metadata" type="anyURI"
                        minOccurs="0" maxOccurs="unbounded"/>
                    <element name="featureMember" maxOccurs="unbounded">
                        <complexType>
                            <annotation>
                                <appinfo source="urn:xgml:
                                targetElement">hyd:HydroComplex/@gml:id</appinfo>
                            </annotation>
                            <sequence>
                                <element ref="gml:AbstractFeature"/>
                            </sequence>
                        </complexType>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!-- ============================================================= -->
    <!-- HYDRO COMPLEX -->
    <!-- ============================================================= -->
    <element name="HydroComplex" type="hyd:HydroComplexType"
    substitutionGroup="gml:AbstractFeature"/>
    <!-- ============================================================= -->
    <complexType name="HydroComplexType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence>
                    <element name="featureId" type="hyd:IdentifierPropertyType"/>
                    <element name="linkedResource"
                        type="hyd:ExternalResourcePropertyType" minOccurs="0"
                        maxOccurs="1"/>
                    <element name="metadata" type="anyURI" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="featureDate" type="date"/>
                    <element name="name" type="hyd:NamePropertyType" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="measure" type="hyd:MeasurementPropertyType"
                        minOccurs="0" maxOccurs="unbounded"/>
                    <element name="representation"
                        type="hyd:RepresentationPropertyType" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="attribute"
                        type="hyd:ExtendedAttributePropertyType" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="compositeType" minOccurs="1" maxOccurs="1">
                        <complexType>
                            <simpleContent>
                                <restriction base="gml:CodeType">
                                    <attribute name="codeSpace" type="anyURI"
                                        use="optional"
                                            default="../Dictionaries/CompositeTypeDictionary.xml"/>
                                </restriction>
                            </simpleContent>
                        </complexType>
                    </element>
                    <element name="element" type="gml:ReferenceType" minOccurs="1"
                        maxOccurs="unbounded">
                        <annotation>
                            <appinfo source="urn:xgml:
    targetElement">hyd:HydroElement/@gml:id</appinfo>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
        <!-- ============================================================= -->
    </complexType>
    <!-- ============================================================= -->
    <!-- HYDRO ELEMENT -->
    <!-- ============================================================= -->
    <element name="HydroElement" type="hyd:HydroElementType"
        substitutionGroup="gml:AbstractFeature"/>
    <complexType name="HydroElementType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence>
                    <element name="featureId" type="hyd:IdentifierPropertyType"/>
                    <element name="linkedResource"
                        type="hyd:ExternalResourcePropertyType" minOccurs="0"
                        maxOccurs="1"/>
                    <element name="metadata" type="anyURI" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="featureDate" type="date"/>
                    <element name="name" type="hyd:NamePropertyType" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="measure" type="hyd:MeasurementPropertyType"
                        minOccurs="0" maxOccurs="unbounded"/>
                    <element name="representation"
                        type="hyd:RepresentationPropertyType" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <element name="attribute"
                        type="hyd:ExtendedAttributePropertyType" minOccurs="0"
                        maxOccurs="unbounded"/>
                    <!-- ====================================================== -->
                    <element name="featureType">
                        <complexType>
                            <simpleContent>
                                <restriction base="gml:CodeType">
                                    <attribute name="codeSpace" type="anyURI"
                                    use="optional"
                                    default="../Dictionaries/HydroFeatureTypeDictionary.xml"/>
                                </restriction>
                            </simpleContent>
                        </complexType>
                    </element>
                    <element name="featureCode" minOccurs="0" maxOccurs="1">
                        <complexType>
                            <simpleContent>
                                <restriction base="gml:CodeType">
                                    <attribute name="codeSpace" type="anyURI"
                                        use="optional"
default="../Dictionaries/HydroFeatureCodeTypeDictionary.xml"/>
                                </restriction>
                            </simpleContent>
                        </complexType>
                    </element>
                    <element name="geometry" type="gml:GeometryPropertyType"
                        minOccurs="1" maxOccurs="1"/>
                    <element name="flowDirection" minOccurs="0" maxOccurs="1">
                        <complexType>
                            <simpleContent>
                                <restriction base="gml:CodeType">
                                    <attribute name="codeSpace" type="anyURI"
                                        use="optional"
                                        default="../Dictionaries/FlowCodeDictionary.xml"/>
                                </restriction>
                            </simpleContent>
                        </complexType>
                    </element>
                    <!-- ====================================================== -->
                    <element name="computedNetworkValues"
                        type="hyd:ComputedNetworkValuesPropertyType" minOccurs="0"
                        maxOccurs="1"/>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <!-- FEATURERELATIONSHIP -->
        <!-- ============================================================= -->
        <element name="FeatureRelationship" type="hyd:FeatureRelationshipType"
            substitutionGroup="gml:AbstractFeature"/>
        <complexType name="FeatureRelationshipType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence>
                        <element name="sourceFeature" type="gml:ReferenceType">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:HydroFeature/@gml:id</appinfo>
                            </annotation>
                        </element>
                        <element name="targetFeature" type="gml:ReferenceType"
                            minOccurs="1" maxOccurs="unbounded">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:HydroFeature/@gml:id</appinfo>
                            </annotation>
                        </element>
                        <element name="type">
                            <complexType>
                                <simpleContent>
                                    <restriction base="gml:CodeType">
                                        <attribute name="codeSpace" type="anyURI"
                                            use="optional"
                                            default="../Dictionaries/RelationshipTypeDictionary.xml"/>
                                    </restriction>
                                </simpleContent>
                            </complexType>
                        </element>
                        <element name="attribute"
                            type="hyd:ExtendedAttributePropertyType" minOccurs="0"
                            maxOccurs="unbounded"/>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <!-- EVENT -->
        <!-- ============================================================= -->
        <element name="Event" type="hyd:EventType" substitutionGroup="gml:AbstractFeature"/>
        <complexType name="EventType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence>
                        <element name="date" type="date" minOccurs="0" maxOccurs="1"/>
                        <element name="eventID" type="gml:ReferenceType" minOccurs="1"
                            maxOccurs="1">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:Identifier/@gml:id</appinfo>
                            </annotation>
                        </element>
                        <element name="relatedURL" type="anyURI" minOccurs="0"
                            maxOccurs="unbounded"/>
                        <element name="metadata" type="anyURI" minOccurs="0"
                            maxOccurs="1"/>
                        <element name="eventType">
                            <complexType>
                                <simpleContent>
                                    <restriction base="gml:CodeType">
                                        <attribute name="codeSpace" type="anyURI"
                                            use="optional"
                                            default="../Dictionaries/EventTypeDictionary.xml"/>
                                    </restriction>
                                </simpleContent>
                            </complexType>
                        </element>
                        <element name="dataType">
                            <complexType>
                                <simpleContent>
                                    <restriction base="gml:CodeType">
                                        <attribute name="codeSpace" type="anyURI"
                                            use="optional"
                                            fixed="../Dictionaries/DatatypeDictionary.xml"/>
                                    </restriction>
                                </simpleContent>
                            </complexType>
                        </element>
                        <element name="eventValue" type="string"/>
                        <element name="location" type="gml:GeometryPropertyType"
                            minOccurs="0" maxOccurs="1"/>
                        <element name="measure" type="hyd:MeasurementPropertyType"
                            minOccurs="0" maxOccurs="unbounded"/>
                        <element name="attribute"
                            type="hyd:ExtendedAttributePropertyType" minOccurs="0"
                            maxOccurs="unbounded"/>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <!-- UNMEASUREDEVENT -->
        <!-- ============================================================= -->
        <element name="UnmeasuredEvent" type="hyd:UnmeasuredEventType"
            substitutionGroup="gml:AbstractFeature"/>
        <complexType name="UnmeasuredEventType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence>
                        <element name="event" type="gml:ReferenceType">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:Event/@gml:id</appinfo>
                            </annotation>
                        </element>
                        <element name="location" type="gml:GeometryPropertyType"/>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <!-- MEASUREDEVENT -->
        <!-- ============================================================= -->
        <element name="MeasuredEvent" type="hyd:MeasuredEventType"
            substitutionGroup="gml:AbstractFeature"/>
        <complexType name="MeasuredEventType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence>
                        <element name="event" type="gml:ReferenceType">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:Event/@gml:id</appinfo>
                            </annotation>
                        </element>
                        <element name="startPosition" type="gml:PointPropertyType"/>
                        <element name="endPosition" type="gml:PointPropertyType"
                            minOccurs="0" maxOccurs="1"/>
                        <element name="startOffset" type="gml:MeasureType" minOccurs="0"
                            maxOccurs="1"/>
                        <element name="endOffset" type="gml:MeasureType" minOccurs="0"
                            maxOccurs="1"/>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
        <!-- ============================================================= -->
        <!-- EVENT ON -->
        <!-- ============================================================= -->
        <element name="EventOn" type="hyd:EventOnType"
            substitutionGroup="gml:AbstractFeature"/>
        <complexType name="EventOnType">
            <complexContent>
                <extension base="gml:AbstractFeatureType">
                    <sequence>
                        <element name="feature" type="gml:ReferenceType" minOccurs="1"
                            maxOccurs="unbounded">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:HydroFeature/@gml:id</appinfo>
                            </annotation>
                        </element>
                        <element name="event" type="gml:ReferenceType" minOccurs="0"
                            maxOccurs="unbounded">
                            <annotation>
                                <appinfo source="urn:xgml:
    targetElement">hyd:Event/@gml:id</appinfo>
                            </annotation>
                        </element>
                    </sequence>
                </extension>
            </complexContent>
        </complexType>
</schema>

D.4.  Internationalized string example

The following schema defines a single internationalized string element:

<?xml version=”1.0” encoding=”UTF-8”?>
<schema
    targetNamespace=”http://www.opengis.net/test”
    xmlns=”http://www.w3.org/2001/XMLSchema”
    xmlns:test=”http://www.opengis.net/test”
    xmlns:xml=”http://www.w3.org/XML/1998/namespace”
    xmlns:gml=”http://www.opengis.net/gml/3.2”
    xmlns:gmlsf=”http://www.opengis.net/gmlsf/2.0”
    elementFormDefault=”qualified”
    version=”1.0”>

    <annotation>
        <appinfo source=”http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd”>
            <gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
        </appinfo>
    </annotation>
    <!— ============================================================= —>
    <!— === includes and imports === —>
    <!— ============================================================= —>
    <import namespace=”http://www.w3.org/XML/1998/namespace”
        schemaLocation=”http://www.w3.org/2001/xml.xsd”/>
    <import namespace=”http://www.opengis.net/gml/3.2”
        schemaLocation=”http://schemas.opengis.net/gml/3.2.1/gml.xsd”/>
    <import namespace=”http://www.opengis.net/gmlsf/2.0”
schemaLocation=”http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd”/>
    <!— ============================================================= —>
    <!— Language string type —>
    <!— ============================================================= —>
    <complexType name=”LanguageStringType”>
        <simpleContent>
            <extension base=”string”>
                <attribute ref=”xml:lang” use=”optional”/>
            </extension>
        </simpleContent>
    </complexType>
    <!— ============================================================= —>
    <!— Define a feature type —>
    <!— ============================================================= —>
    <element name=”Description” type=”test:DescriptionType”
        substitutionGroup=”gml:AbstractFeature”/>
    <complexType name=”DescriptionType”>
        <complexContent>
            <extension base=”gml:AbstractFeatureType”>
                <sequence>
                    <element name=”descId”>
                        <simpleType>
                            <restriction base=”string”>
                                <maxLength value=”9”/>
                            </restriction>
                        </simpleType>
                    </element>
                    <element name=”descText” maxOccurs=”unbounded”>
                        <complexType>
                            <simpleContent>
                                <restriction base=”test:LanguageStringType”>
                                    <maxLength value=”20”/>
                                </restriction>
                            </simpleContent>
                        </complexType>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!— ============================================================= —>
    <!— Define a feature collection —>
    <!— ============================================================= —>
    <element name=”Descriptions”
            type=”test:DescriptionsType”
            substitutionGroup=”gml:AbstractGML”/>
    <complexType name=”DescriptionsType”>
        <complexContent>
            <extension base=”gml:AbstractFeatureType”>
                <sequence minOccurs=”1” maxOccurs=”unbounded”>
                    <element name=”featureMember”>
                        <complexType>
                            <complexContent>
                                <extension base=”gml:AbstractFeatureMemberType”>
                                    <sequence>
                                        <element ref=”gml:AbstractFeature”/>
                                    </sequence>
                                </extension>
                            </complexContent>
                        </complexType>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
</schema>

An instance document might be:

<?xml version=”1.0”?>
<test:Descriptions gml:id=”ID0”
    xmlns:test=”http://www.opengis.net/test”
    xmlns:gml=”http://www.opengis.net/gml/3.2”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=”http://www.opengis.net/test ./test.xsd”>
    <test:featureMember>
        <test:Description gml:id=”ID1”>
            <test:descId>12345</test:descId>
            <test:descText xml:lang=”en”>Hello world.</test:descText>
            <test:descText xml:lang=”fr”>Bonjour monde.</test:descText>
            <test:descText xml:lang=”el”>Γειά σου κόσμος</test:descText>
        </test:Description>
    </test:featureMember>
</test:Descriptions>

D.5.  Circle-by-center-point Example

The following example illustrates a schema that declares one geometric property whose value is a circle.

<?xml version=”1.0” encoding=”UTF-8”?>
<xsd:schema
    targetNamespace=”http://www.someserver.com/rz”
    xmlns:myns=”http://www.someserver.com/rz”
    xmlns:xsd=”http://www.w3.org/2001/XMLSchema”
    xmlns:gml=”http://www.opengis.net/gml/3.2”
    elementFormDefault=”qualified”
    xmlns:gmlsf=”http://www.opengis.net/gmlsf/2.0”
    version=”myns:2003”>

    <xsd:annotation>
        <xsd:appinfo source=”http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd”>
            <gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
        </xsd:appinfo>
    </xsd:annotation>

    <!— ============================================================= —>
    <!— === includes and imports === —>
    <!— ============================================================= —>
    <xsd:import namespace=”http://www.w3.org/XML/1998/namespace”
            schemaLocation=”http://www.w3.org/2001/xml.xsd”/>
    <xsd:import namespace=”http://www.opengis.net/gml/3.2”
            schemaLocation=”http://schemas.opengis.net/gml/3.2.1/gml.xsd”/>
    <xsd:import namespace=”http://www.opengis.net/gmlsf/2.0”
schemaLocation=”http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd”/>
    <xsd:element name=”RadZones”
                type=”myns:RadZonesType”
                substitutionGroup=”gml:AbstractFeature”/>
    <xsd:complexType name=”RadZonesType”>
        <xsd:complexContent>
            <xsd:extension base=”gml:AbstractFeatureType”>
                <xsd:sequence>
                    <xsd:element name=”title” type=”xsd:string”/>
                    <xsd:element name=”abstract” type=”xsd:string” minOccurs=”0”/>
                    <xsd:element name=”rems” type=”gml:MeasureType”/>
                    <xsd:element name=”where”
                                type=”gml:SurfacePropertyType”
                                maxOccurs=”unbounded”/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:schema>

An instance document might be:

<?xml version=”1.0” encoding=”UTF-8”?>
<rz:RadZones
    gml:id=”RZ001”
    xmlns:rz=”http://www.someserver.com/rz”
    xmlns:gml=”http://www.opengis.net/gml/3.2”
    xmlns:xlink=”http://www.w3.org/1999/xlink”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=”http://www.someserver.com/rz
                        http://www.someserver.com/schemas/RadZones.xsd
                        http://www.opengis.net/gml/3.2
                        http://schemas.opengis.net/gml/3.2.1/gml.xsd”>
    <rz:title>Radiation Hot Spots</rz:title>
    <rz:abstract>Radiation hot spots in the vicinity of the AnyTown nuclear reactor. Only
readings that exceed the background radiation of 100 millirems per hour.</rz:abstract>
    <rz:rems uom=”REM”>170</rz:rems>
    <rz:where>
        <gml:Surface
            gml:id=”RZ001_1”
            srsName=”http://www.opengis.net/def/crs/EPSG/0/4326”>
            <gml:patches>
                <gml:PolygonPatch>
                    <gml:exterior>
                        <gml:Ring>
                            <gml:curveMember>
                                <gml:Curve gml:id=”C01”>
                                    <gml:segments>
                                        <gml:CircleByCenterPoint numArc=”1”>
                                            <gml:pos>51.389 30.099</gml:pos>
                                            <gml:radius uom=”m”>20000</gml:radius>
                                        </gml:CircleByCenterPoint>
                                    </gml:segments>
                                </gml:Curve>
                            </gml:curveMember>
                        </gml:Ring>
                    </gml:exterior>
                </gml:PolygonPatch>
            </gml:patches>
        </gml:Surface>
    </rz:where>
</rz:RadZones>

Annex E
(informative)
Schematron rules

This profile does not recommend subsetting the full GML schema because of issues that may arise with caching XML parsers. Instead, a Schematron schema document can be used to ascertain whether a GML document instance complies to the rules specified in this profile. As an example, this annex contains an informative Schematron implementation of the SF2 rules as applied to GML document instances.

<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
    <sch:ns prefix="gml" uri="http://www.opengis.net/gml/3.2"/>
    <!-- Linda van den Brink, Geonovum, 2011
        - The schematron file implements the validation of the restricted
        - subset of GML 3.2 defined in the GML simple features profile
        - compliance level SF2. The scope of the validation consists of
        - GML document instances. Validation of the restricted subset of
        - XML Schema, defined in the same profile document, is not
        - implemented by this schematron file.-->
    <sch:pattern>
        <sch:rule context="/*/*/*">
            <!-- Rule to exclude metadataProperty -->
            <sch:assert test="not(gml:metaDataProperty)">
                This profile prohibits use of gml:metaDataProperty
                elements for referencing metadata in instance documents.
            </sch:assert>
        </sch:rule>
        <sch:rule context="/*//*">
            <!-- Rule to exclude spatial topology types -->
            <sch:assert
test="not(self::gml:Node|self::gml:Edge|self::gml:Face|self::gml:TopoSolid|self::gml:Topo
Point|self::gml:TopoCurve|self::gml:TopoSurface|self::gml:TopoVolume|self::gml:TopoComple
x)">
                Spatial properties are limited to the set of geometric
                types consisting of point, curve with linear and/or
                circular arc interpolation, planar surface, or aggregates
                thereof. Spatial topology is excluded.
            </sch:assert>
            <!-- Rule for content of curves -->
            <sch:assert test="not(self::gml:Curve) or
self::gml:Curve/gml:segments[gml:LineStringSegment|gml:Arc|gml:Circle|gml:CircleByCenterP
oint]">
                Curves (standalone or within surfaces) must have linear
                and/or circular arc interpolation (LineString, Curve with
                Arc, Circle or CircleByCenterpoint segments)
            </sch:assert>
            <!-- Rule for constraints on planar surfaces -->
            <sch:assert
test="not(self::gml:OrientableSurface|self::gml:CompositeSurface|self::gml:PolyhedralSurf
ace|self::gml:Tin|self::gml:TriangulatedSurface)">
                Planar surface types are restricted to Polygon or Surface
                elements.
            </sch:assert>
            <!-- Rule for constraints on GeometryPropertyType -->
            <sch:assert
test="not(self::gml:Solid|self::gml:MultiSolid|self::gml:CompositeSolid|self::gml:Composi
teCurve|self::gml:Grid)">
                Supported geometry types are restricted to point, curve with
                linear and/or circular arc interpolation, planar surface,
                or aggregates thereof.
            </sch:assert>
            <!-- Rule for geometry coordinates of points and circles by
                centerpoint -->
            <sch:assert test="count(self::gml:Point/gml:pos) = count(self::gml:Point/*)">
                Geometry coordinates shall only be specified using the gml:pos element for
                gml:Point.
            </sch:assert>
            <sch:assert
test="count(self::gml:CircleByCenterPoint/gml:pos|self::gml:CircleByCenterPoint/gml:radiu
s) = count(self::gml:CircleByCenterPoint/*)">
                Geometry coordinates shall only be specified using the gml:pos
                element for gml:CircleByCenterPoint.
            </sch:assert>
            <!-- Rules for geometry coordinates in geometries other than points -->
            <sch:assert test="count(self::gml:LineStringSegment/gml:posList) =
count(self::gml:LineStringSegment/*)">
                Geometry coordinates shall only be specified using the gml:posList
                element for gml:LineStringSegment.
            </sch:assert>
            <sch:assert test="count(self::gml:LinearRing/gml:posList) =
count(self::gml:LinearRing/*)">
                Geometry coordinates shall only be specified using the gml:posList
                element for gml:LinearRing.
            </sch:assert>
            <sch:assert test="count(self::gml:Arc/gml:posList) = count(self::gml:Arc/*)">
                Geometry coordinates shall only be specified using the gml:posList
                element for gml:Arc.
            </sch:assert>
            <sch:assert test="count(self::gml:Circle/gml:posList) =
count(self::gml:Circle/*)">
                Geometry coordinates shall only be specified using the gml:posList
                element for gml:Circle.
            </sch:assert>
            <!-- Rules for aggregate geometry types -->
            <sch:assert test="not(self::gml:MultiPoint/gml:pointMembers)">
                This profile restricts instance documents to using the property
                container gml:pointMember for the MultiPoint geometry type.
            </sch:assert>
            <sch:assert test="not(self::gml:MultiCurve/gml:curveMembers)">
                This profile restricts instance documents to using the property
                container gml:curveMember for the MultiCurve geometry type.
            </sch:assert>
            <sch:assert test="not(self::gml:MultiSurface/gml:surfaceMembers)">
                This profile restricts instance documents to using the property
                container gml:surfaceMember for the MultiSurface geometry type.
            </sch:assert>
            <sch:assert test="not(self::gml:MultiGeometry/gml:geometryMembers)">
                This profile restricts instance documents to using the property
                container gml:geometryMember for the MultiGeometry geometry type.
            </sch:assert>
            <!-- Rule for content of surfaces -->
            <sch:assert test="count(self::gml:Surface/gml:patches/gml:PolygonPatch) =
count(self::gml:Surface/gml:patches/*)">
                The content of gml:Surface elements is restricted to
                gml:PolygonPatch patches.
            </sch:assert>
            <sch:assert test="not(self::*/@srsDimension &#x3e; 3)">
                Coordinate reference systems may have 1, 2 or 3 dimensions.
            </sch:assert>
        </sch:rule>
    </sch:pattern>
</sch:schema>

This Schematron schema can also be found at:

http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfL2.sch