GML documents Instances of GML objects

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. Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. 227 EXAMPLE 6 An application wants to prohibit the use of multiple names in their feature types. This may be achieved by deriving an application-specific root feature type by restriction from gml:AbstractFeatureType that sets the maximum occurrence of the gml:name to ―1‖. An application schema may declare new elements that are assigned to a substitution group whose head is an abstract or concrete GML element. The element declared in the application schema may then appear in instance documents in place of the substitution group head and be conformant to the content model that refers to the substitution group head. Note that in order to be a valid member of a substitution group, the type of the element shall be validly derived from the type of the element which is the head of the substitution group. All abstract elements in the GML schema are only useful acting as the heads of substitution groups. EXAMPLE 7 gml:AbstractGML, gml:AbstractFeature, gml:AbstractGeometry, gml:AbstractCoverage may all serve as the head of a substitution group for elements in an application schema . An application schema may declare new elements, attributes and types in its own namespace using types it has defined to give vocabulary-specific names to their content models. EXAMPLE 8 Application-specific data types or enumerations. All GML application schemas are constructed, using the general rules of this Clause, from one or more of the GML schema components defined in Error Reference source not found. to Clause 19. GML allows the derivation of many other kinds of elements such as new units of measure, new geometry properties and new geometries. While these elements may be packaged into separate schemas they are viewed as subordinate to the schema categories of this Clause. Any GML application schema shall be of at least one of the schema types described in 21.3 through 21.11, and comply to the rules from the respective subclauses in addition to 21.2. It is thus permissible to create a GML application schema that defines Features, Coverages and Values, so long as this schema satisfies the rules of 21.2, 21.3, 21.8 and 21.9.

21.2.2 Target namespace

An application schema shall declare a target namespace. This is the namespace in which the terms for objects and properties of the vocabulary defined by the application schema live. This shall not be the GML namespace http:www.opengis.netgml3.2. It is conventional for the namespace identifier to be a URL controlled by the application schema author‘s organization. A target namespace is declared in an application schema using the targetNamespace attribute of the schema element from XML Schema. An application schema may be comprised of multiple schema documents that all declare the same target namespace. NOTE It is recommended that a top-level schema document in such a modularized application schema should directly or indirectly include the other documents to avoid the XML application processing limitations discussed in Annex J.

21.2.3 Import GML schema

A GML application schema shall import the full GML schema. It may identify GML profiles that include all of the components from GML that it directly or indirectly uses to define its vocabulary as specified in 20.5. The required import of the GML schema components may be provided indirectly via the import of another schema in the namespace of GML that includes the required GML schema documents. EXAMPLE 1 The import of gml.xsd from Annex C would satisfy any of these schema import requirements. import namespace=http:www.opengis.netgml3.2 schemaLocation=..gml.xsd