Overview of Dictionary Schema
Many applications require definitions of terms that are used within instance documents as the values of certain properties or as reference information to tie properties to standard information values in some way. Units of measure and descriptions of measurable phenomena are two particular examples.
| It is often convenient to use definitions provided by external authorities. These may already be packaged for delivery in various ways, both online and offline. In order to be references from GML documents, it is usually necessary that a URL be available for each definition. Where this is the case, it is usually preferable to refer to these directly. Alternatively, it may be convenient or necessary to capture definitions in XML, either as a separate document or embedded within an instance document containing features. The definitions may be transcriptions from an external source, or may be new definitions for a local purpose. In order to support this case, some simple components are provided in GML in the form of:
These components may be used directly, but also serve as the basis for more specialized definition elements in GML, in particular: coordinate operations (Clause 12), coordinate reference systems (Clause 12), datums (Clause 12), temporal reference systems (Clause 14), and units of measure (Clause 16). Note that the GML definition and dictionary components implement a simple nested hierarchy of definitions with identifiers. The latter provides handles which may be used in the description of more complex relationships between terms. However, the GML dictionary components are not intended to provide direct support for complex taxonomies, ontologies, or thesauri. Specialized XML tools are available to satisfy the more sophisticated requirements. |
| The dictionary schema document is identified by the following location independent name (using URN syntax): urn:x-ogc:specification:gml:schema-xsd:dictionary:3.2.1. |
Dictionary Schema Feature

The basic gml:Definition element specifies a definition, which can be included in or referenced by a dictionary. It is declared as follows:
<element name="Definition" type="gml:DefinitionType"
substitutionGroup="gml:AbstractGML"/>
<complexType name="DefinitionBaseType">
<complexContent>
<restriction base="gml:AbstractGMLType">
<sequence>
<element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
<element ref="gml:description" minOccurs="0"/>
<element ref="gml:descriptionReference" minOccurs="0"/>
<element ref="gml:identifier"/>
<element ref="gml:name" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute ref="gml:id" use="required"/>
</restriction>
</complexContent>
</complexType>
<complexType name="DefinitionType">
<complexContent>
<extension base="gml:DefinitionBaseType">
<sequence>
<element ref="gml:remarks" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="remarks" type="string"/>
The content model for a generic definition is a derivation from gml:AbstractGMLType.
The gml:description property element shall hold the definition if this can be captured in a simple text string, or the gml:descriptionReference property element may carry a link to a description elsewhere.
The gml:identifier element shall provide one identifier describing this definition. The identifier must be unique within the dictionaries using this definition.
The gml:name elements shall provide zero or more terms and synonyms, for which this is the definition.
The gml:remarks element shall be used to hold additional textual information that is not conceptually part of the definition, but is useful in understanding the definition.

Sets of definitions may be collected into dictionaries or collections. These are declared in the schema as follows:
<element name="Dictionary" type="gml:DictionaryType"
substitutionGroup="gml:Definition"/>
<complexType name="DictionaryType">
<complexContent>
<extension base="gml:DefinitionType">
<choice minOccurs="0" maxOccurs="unbounded">
<element ref="gml:dictionaryEntry"/>
<element ref="gml:indirectEntry"/>
</choice>
<attributeGroup ref="gml:AggregationAttributeGroup"/>
</extension>
</complexContent>
</complexType>
A gml:Dictionary is a non-abstract collection of definitions. The gml:Dictionary content model adds a list of gml:dictionaryEntry and gml:indirectEntry (deprecated) properties that contain or reference gml:Definition objects. A database handle (gml:id attribute) is required in order to refer to this collection.
The standard gml:identifier, gml:description, gml:descriptionReference and gml:name properties are available to reference or contain more information about this dictionary. The gml:description and gml:descriptionReference property elements may be used for a description of this dictionary. The derived gml:name element may be used for the name(s) of this dictionary.

These elements contain or refer to the definitions that are members of a dictionary. The element gml:dictionaryEntry is declared as follows:
<element name="dictionaryEntry" type="gml:DictionaryEntryType"/>
<complexType name="DictionaryEntryType">
<complexContent>
<extension base="gml:AbstractMemberType">
<sequence minOccurs="0">
<element ref="gml:Definition"/>
</sequence>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
</extension>
</complexContent>
</complexType>
The content model follows the standard GML property pattern, so a gml:dictionaryEntry may either contain or refer to a single gml:Definition. Since gml:Dictionary is substitutable for gml:Definition, the content of an entry may itself be a lower-level dictionary.
Note that if the value is provided by reference, this definition does not carry a handle (gml:id) in this context, so does not allow external references to this specific definition in this context. When used in this way, the referenced definition will usually be in a dictionary in the same XML document.

Dictionaries and definitions are GML objects, so they may be found in independent GML data instance documents.
In application schemas, it might be useful to attach a gml:Dictionary or gml:Definitions to a feature collection in order to record definitions used in properties of members of the collection.
The following example shows two instances of dictionaries:
<gml:Dictionary gml:id="rockTypes">
<gml:description>
A simple dictionary of rock types using components from gmlBase
</gml:description>
<gml:identifier codeSpace="http://www.abc.org/terms">
Rock Types
</gml:identifier>
<gml:dictionaryEntry>
<gml:Definition gml:id="granite">
<gml:description>
A igneous rock normally composed of quartz, two feldspars and
optional mica
</gml:description>
<gml:identifier codeSpace="http://www.abc.org/terms">
Granite
</gml:identifier>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="sst">
<gml:description>
A detrital sedimentary rock normally composed of siliceous
grains
</gml:description>
<gml:identifier codeSpace="http://www.abc.org/terms">
Sandstone
</gml:identifier>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry xlink:href="http://my.big.org/definitions/geology/limestone"/>
</gml:Dictionary>
<gml:Dictionary gml:id="AbridgedGMLdictionary">
<gml:identifier codeSpace="http://www.opengis.net/gml/3.2">
GML Dictionary
</gml:identifier>
<gml:dictionaryEntry>
<gml:Definition gml:id="term4.1">
<gml:description>
conceptual schema for data required by one or more applications
</gml:description>
<gml:identifier codeSpace="http://www.isotc211.org/19101">
application schema
</gml:identifier>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="term4.2">
<gml:description>
application schema written in XML Schema in accordance with the rules specified in ISO 19136
</gml:description>
<gml:identifier codeSpace="http://www.opengis.net/gml/3.2">
GML application schema
</gml:identifier>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="term4.3">
<gml:description>
semantic relationship between two or more classifiers that specifies connections among their instances
</gml:description>
<gml:identifier codeSpace="http://www.uml.org/1.3">
association
</gml:identifier>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="term4.4">
<gml:description>
name-value pair contained in an element
</gml:description>
<gml:identifier codeSpace="http://www.w3.org/XML/1998/namespace">
attribute
</gml:identifier>
</gml:Definition>
</gml:dictionaryEntry>
</gml:Dictionary>