SWE Common Data Model OGC 08-094r1
8.1.5 Category Element
The “Category” element is the XML schema implementation of the “Category” UML class defined in clause 7.2.6. The schema snippet for this element and its corresponding
complex type is shown below:
element name
= Category
substitutionGroup =
swe:AbstractSimpleComponent type
= swe:CategoryType
complexType name
= CategoryType
complexContent extension
base =
swe:AbstractSimpleComponentType sequence
element name
= codeSpace
maxOccurs =
1 minOccurs
= type
= swe:Reference
element name
= constraint
maxOccurs =
1 minOccurs
= type
= swe:AllowedTokensPropertyType
element name
= value
maxOccurs =
1 minOccurs
= type
= string
sequence extension
complexContent complexType
The “codeSpace” element is of type “swe:Reference” and thus makes use of an “xlink:href” XML attribute to reference an external dictionary, taxonomy or ontology
representing the code space Please refer to the documentation of the “xlink:simpleLink” attribute group for more details. Constraints can be expressed by using the
“AllowedTokens” element detailed in clause 8.1.15. The “value” property element is of the XML schema type “string”. The text content of this element should however be
limited to short tokens in the case of a categorical representation.
The following example shows how the “codeSpace” element can be used to give the value of a geological period:
swe:Category definition
= http:sweet.jpl.nasa.gov2.0timeGeologic.owlGeologicTime
swe:label Geological Period
swe:label swe:description
Name of the geological period according to the nomenclature of the International Commission on Stratigraphy
swe:description swe:codeSpace
xlink:href =
http:sweet.jpl.nasa.gov2.0timeGeologic.owlPeriod swe:value
Jurassic swe:value
swe:Category
Note that the code space references an existing dictionary defined by CGI Commission for the Management and Application of Geoscience Information. This shows how SWE
Common can leverage an existing community managed terminology. Alternatively it can be used without the value to describe, for instance, a “bird species” field in a biology
dataset:
swe:Category definition
= http:sweet.jpl.nasa.gov2.0biol.owlSpecies
swe:label Bird Species
swe:label swe:description
Bird species according to the classification of the World Bird Database swe:description
swe:codeSpace xlink:href
= http:www.birdlife.orgdatazonespeciesindex.html
swe:Category
Copyright © 2011 Open Geospatial Consortium
73
OGC 08-094r1 SWE Common Data Model
In this example, no official code space URI was found so the “codeSpace” element is used to reference the online source of the taxonomy The “birdlife.org” website hosts the
international database that is the reference in this case.
When no code space is specified, Req 25 must be satisfied by inserting a constraint with a list of allowed values as shown in the example below:
swe:Category definition
= http:www.opengis.netdefpropertyOGC0SensorStatus
swe:label Sensor Status
swe:label swe:description
Current status of the sensor swe:description
swe:constraint swe:AllowedTokens
swe:value Off
swe:value swe:value
Stand-by swe:value
swe:value Ready
swe:value swe:value
Busy swe:value
swe:AllowedTokens swe:constraint
swe:Category
Note that in this case, the data consumer has no way of knowing the exact meaning of each allowed value, since there is no associated description. A code space is thus more
explicit as it defines not only the list of allowed terms but should also give a textual description. This is why a code space is preferred whenever it is possible to implement it.
8.1.6 Count Element
The “Count” element is the XML schema implementation of the “Count” UML class defined in clause 7.2.7. The schema snippet for this element and its corresponding
complex type is shown below:
element name
= Count
substitutionGroup =
swe:AbstractSimpleComponent type
= swe:CountType
complexType name
= CountType
complexContent extension
base =
swe:AbstractSimpleComponentType sequence
element name
= constraint
maxOccurs =
1 minOccurs
= type
= swe:AllowedValuesPropertyType
element name
= value
maxOccurs =
1 minOccurs
= type
= integer
sequence extension
complexContent complexType
Constraints are expressed by using the “AllowedValues” element detailed in clause 8.1.16. The “value” property element is of the XML schema type “integer”.
The following example shows how this XML element can be used to give the value of a geological period:
swe:Count definition
= http:www.opengis.netdefpropertyOGC0NumberOfPixels
swe:label Row Size
swe:label swe:description
Number of pixels in each row of the image swe:description
swe:value 1024
swe:value swe:Count
74
Copyright © 2011 Open Geospatial Consortium