Recommendations for application schemas using GML profiles

Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. 225 comprise the standard GML distribution. The schema document gml.xsd is an exhaustive superset following the latter approach.

20.7 Summary of rules for GML profiles

In summary, the rules for a profile:  A profile of GML is a logical restriction of a subset of GML.  A profile shall not change the name, definition, or data type of mandatory GML elements or attributes.  The relevant schema or schemas that define a profile shall use in the core ‗gml‘ namespace http:www.opengis.netgml3.2.  An application schema may extend and use types from the profile, but shall do so in its own namespace, and not use http:www.opengis.netgml3.2. The functional test of these rules is: Any instance document for an application schema using a GML profile will be valid against the same application schema if the GML profile is replaced by the complete GML schema. Further, the interpretation of that document would be the same regardless of which of the two schemas were used. 21 Rules for GML application schemas

21.1 Instances of GML objects

21.1.1 GML documents

An XML document contains a single XML element as its root. A GML document may be one of the following elements:  A gml:AbstractFeature or any element directly or indirectly in its substitution group. NOTE 1 This includes feature collections and coverages as both are features, too.  A gml:Dictionary or any element directly or indirectly in its substitution group. NOTE 2 This includes coordinate reference system and units dictionaries.  A gml:TopoComplex or any element directly or indirectly in its substitution group. The standard methods for XML documents based on W3C XML Schema provide that the XML namespaces used in a document are declared as attributes within the document, and the location of schema documents that provide the source components for each namespace may be indicated. For a GML document, the source of the components describing the primary components within the document is a GML application schema. Both the document type and the associated GML application schema are described in this Clause. 226 Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. Note that this does not imply that all elements and attributes in the GML document are defined by a single GML application schema. The schema components referenced from the GML document may be contained in any number of GML application schemas or other XML Schemas.

21.1.2 GML object elements in other XML documents

Elements of GML objects may occur in XML documents that are not GML documents, too. The XML document shall validate against an XML Schema document that imports directly or indirectly the GML schema or a GML profile and optionally one or more GML application schemas. EXAMPLE GML object elements may be used in request and response messages of Web Services.

21.2 GML application schemas

21.2.1 Introduction

A GML application schema is an XML Schema, conforming to the rules outlined in this clause, which describes one or more types of geographic object, components of geographic objects or metadata, including dictionaries and definitions, used in the definition of geographic objects. A GML application schema defines a vocabulary for a particular domain of discourse by defining and describing the terms of that vocabulary see ISO 19109 as follows: An application schema may reference directly concrete, global GML elements including groups and attributes including attributeGroups whose names and content models accurately represent components of the vocabulary it defines. EXAMPLE 1 This includes property elements like gml:name or gml:description, object elements like gml:Observation, gml:Dictionary, or gml:Point, and attributes like gml:id. An application schema may declare new elements and attributes in its own namespace using GML types when the vocabulary it defines needs to include different names for the same content models to distinguish their semantic roles. The element declared in the application schema will be in a different namespace, and may be used in an instance document. EXAMPLE 2 gml:EnvelopeType may be used unmodified as the content model for an element xmml:Interval. EXAMPLE 3 gml:LengthType may be used unmodified as the content model for an element ex:height. EXAMPLE 4 gml:PointPropertyType may be used directly as the content model for a property element ex:representativePoint. An application schema may derive new types in its own namespace by extension of GML types when the vocabulary it defines needs to include components with additional, domain-specific properties. NOTE The definition of application-specific feature types requires that the content model of the feature types is derived from gml:AbstractFeatureType, typically by extension. EXAMPLE 5 The definition of new geometry types not specified in the GML schema, but required by an application, e.g. an ellipse. An application schema may derive new types in its own namespace by restriction of GML types when the vocabulary it defines needs to include more specialized versions of GML types that restrict the cardinality or type of their properties.