OGC 08-094r1 SWE Common Data Model
complexType element
sequence extension
complexContent complexType
This element contains a list of at least two “item” property elements, each with a “name” attribute and containing the data component element that defines the field.
The following “DataChoice” example illustrates how it can be used to define an element of a data stream that can either be a temperature or a pressure measurement, in both cases
associated to a time tag:
swe:DataChoice swe:item
name =
TEMP swe:DataRecord
swe:label Temperature Measurement
swe:label swe:field
name =
time swe:Time
definition =
http:www.opengis.netdefpropertyOGC0SamplingTime referenceFrame
= http:www.opengis.netdeftrsOGC0GPS
swe:uom xlink:href
= http:www.opengis.netdefuomISO-86010Gregorian
swe:Time swe:field
swe:field name
= temp
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0physThermo.owlTemperature
swe:uom code
= Cel
swe:Quantity swe:field
swe:DataRecord swe:item
swe:item name
= PRESS
swe:DataRecord swe:label
Pressure Measurement swe:label
swe:field name
= time
swe:Time definition
= http:www.opengis.netdefpropertyOGC0SamplingTime
referenceFrame =
http:www.opengis.netdeftrsOGC0GPS swe:uom
xlink:href =
http:www.opengis.netdefuomISO-86010Gregorian swe:Time
swe:field swe:field
name =
press swe:Quantity
definition =
http:sweet.jpl.nasa.gov2.0physPressure.owlPressure swe:uom
code =
HPa swe:Quantity
swe:field swe:DataRecord
swe:item swe:DataChoice
A dataset element defined by the structure above would be of a variant type, meaning that each instance actual data values of this structure could be either a pair of time and
temperature values OR a pair of time and pressure values. Note that each choice item has a unique name within the “DataChoice” element see Req 46. This is enforced by a
Schematron pattern.
The “DataChoice” element is fully recursive so that each field can itself be any type of component defined in this standard, although implementations are not required to support
nested “DataChoice” elements.
96
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
8.4 Requirements Class: Block Components Schema Requirements Class
http:www.opengis.netspecSWE2.0reqxsd-block-components
Target Type XML Instance
Dependency
http:www.opengis.netspecSWE2.0requml-block-components
Dependency
http:www.opengis.netspecSWE2.0reqxsd-simple-components
XML Schema elements and types defined in the “block_components.xsd” schema implement all classes defined in the “Block Components” UML packages.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-block-componentsdependency-simple-components
Req 71. An XML instance passing the “Block Components Schema” conformance
test class shall first pass the “Basic Types and Simple Components Schemas” and
“Simple Encodings Schema” conformance test classes.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-block-componentsschema-valid
Req 72. The XML instance shall be valid with respect to the grammar defined in the
“block_components.xsd” XML schema as well as satisfy all Schematron patterns
defined in “block_components.sch”.
8.4.1 DataArray Element
The “DataArray” element is the XML schema implementation of the “DataArray” UML class defined in clause 7.5.1. The schema snippet for this element and its corresponding
complex type is shown below:
element name
= DataArray
type =
swe:DataArrayType substitutionGroup
= swe:AbstractDataComponent
complexType name
= DataArrayType
complexContent extension
base =
swe:AbstractDataComponentType sequence
element name
= elementCount
type =
swe:CountPropertyType element
name =
elementType complexType
complexContent extension
base =
swe:AbstractDataComponentPropertyType attribute
name =
name type
= NCName
use =
required extension
complexContent
Copyright © 2011 Open Geospatial Consortium
97
OGC 08-094r1 SWE Common Data Model
complexType element
element name
= encoding
minOccurs =
complexType sequence
element ref
= swe:AbstractEncoding
sequence complexType
element element
name =
values type
= swe:EncodedValuesPropertyType
minOccurs =
sequence extension
complexContent complexType
The size of the array is given by the “elementCount” property element which takes a “Count” data component. It can be used to construct both fixed size and variable size
arrays. When the “Count” child element of the “elementCount” property includes an inline value, the array has a fixed size indicated by the value. When the “Count” child
element has no inline value or when the “elementCount” has an “xlink:href” attribute, the array has a variable size.
The “elementType” property carries the definition of a single array element while the “encoding” and “values” properties allow including the array data inline as an efficient
encoded data block. When present, this data block contains values for all elements of the array the number of elements is given by the array size.
The “values” element shall contain or reference a block of encoded values that are properly structured by following one of the encoding rule sets described in section 9.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-block-componentsencoded-values-valid
Req 73. The encoded data block included either inline or by‐reference in the
“values” property of a “DataArray”, “Matrix” or “DataStream” element shall be
structured according to the definition of the element type, the element count and
the encoding rules corresponding to the chosen encoding method.
This first example shows how the “DataArray” element can be used to define a fixed size array of several measurement records and give their values inline as an encoded data
block:
swe:DataArray definition
= http:sweet.jpl.nasa.gov2.0info.owlTimeSeries
swe:description Array of synchronous weather measurements
swe:description swe:elementCount
swe:Count swe:value
3 swe:value
swe:Count swe:elementCount
swe:elementType name
= weather_measurement
swe:DataRecord swe:label
Weather Data Record swe:label
swe:field name
= time
swe:Time definition
= http:www.opengis.netdefpropertyOGC0SamplingTime
swe:label Sampling Time
swe:label
98
Copyright © 2011 Open Geospatial Consortium