NilValues Element Requirements Class: Basic Types and Simple Components Schemas Requirements Class

OGC 08-094r1 SWE Common Data Model complexType name = NilValuePropertyType simpleContent extension base = token attribute name = reason type = anyURI use = required extension simpleContent complexType This element allows specifying a list of nil value for a particular data component. The next example shows how it can be used to reserve values for indicating a bad measurement in a radiation sensor data stream. swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlIonizingRadiation swe:label Radiation Dose swe:label swe:description Radiation dose measured by Gamma detector swe:description swe:nilValues swe:NilValues swe:nilValue reason = http:www.opengis.netdefnilOGC0BelowDetectionRange -INF swe:nilValue swe:nilValue reason = http:www.opengis.netdefnilOGC0AboveDetectionRange INF swe:nilValue swe:NilValues swe:nilValues swe:uom code = uR swe:Quantity This means that if the “-INF” or “INF” values these are allowed values for a floating point representation are found in the data stream, they should not be taken as real measurement values but instead carry a specific meaning that is given by the “reason” attribute. In this example, all other values i.e. all decimal numbers should be interpreted as a radation dose expressed in micro-roentgens. One important feature is that the “NilValues” object can be referenced instead of being included inline. In addition to allowing their definition in shared repositories, this also enables sharing nil value definitions between several components of the same dataset. This is for instance useful for describing multispectral and hyperspectral images since all bands in these types of images usually share the same nil values. The field representing the first band can then be defined as shown below: swe:Count definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:label Band 1 swe:label swe:nilValues swe:NilValues id= NIL_VALUES swe:nilValue reason = http:www.opengis.netdefnilOGC0BelowDetectionRange swe:nilValue swe:nilValue reason = http:www.opengis.netdefnilOGC0AboveDetectionRange 255 swe:nilValue swe:NilValues swe:nilValues swe:Count And the following bands can have a much shorter description as it just references the nil values group previously defined: swe:Count definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:label Band 2 swe:label swe:nilValues xlink:href = NIL_VALUES swe:Count ... swe:Count definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:label Band 33 swe:label 84 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1 swe:nilValues xlink:href = NIL_VALUES swe:Count An important requirement of nil values is that they shall be expressible with the data component data type in order to guarantee that they can be properly encoded. This is enforced by a Schematron pattern. For a field with a string data type i.e. “Category” and “Text” components, each nil value can be any string but it is recommended to use short upper case alphabetical tokens for better readability. For a field with a floating point data type i.e. “Quantity” and “Time” components, nil values are restricted to decimal numbers and the three special values ‘INF’, ‘-INF’, ‘NaN’. These tokens shall be used when encoding nil values using the “TextEncoding” method. It is recommended to use these values to represent nil reasons whenever possible for clarity, but it is also possible to use special numbers such as ‘-9999’ or ‘9e99’, which are usually chosen outside of the sensor measurement range, for carrying NIL semantics. For a field with an integer data type i.e. “Count” component, only integer numbers such as ‘255’ or ‘999’ can be used for expressing NIL values. These are usually chosen outside of the measurement range, and in a way that the smallest possible data type can be used to store the data in memory i.e. reserved values should be outside of the measurement range but as small as possible.

8.1.15 AllowedTokens Element

The “AllowedTokens” element is the XML schema implementation of the “AllowedTokens” UML class defined in clause 7.2.17. The schema snippet for this element and its corresponding complex type is shown below: element name = AllowedTokens substitutionGroup = swe:AbstractSWE type = swe:AllowedTokensType complexType name = AllowedTokensType complexContent extension base = swe:AbstractSWEType sequence element name = value type = string minOccurs = maxOccurs = unbounded element name = pattern type = string minOccurs = sequence extension complexContent complexType This element is used to restrict the values allowed by both categorical and textual representations. An enumeration constraint used with a “Category” element is shown below: swe:Category definition = http:www.opengis.netdefpropertyOGC0SensorType swe:label Instrument Type swe:label swe:codeSpace xlink:href = http:mmisw.orgontbodcinstrument swe:constraint swe:AllowedTokens swe:value Multi beam echosounder swe:value swe:value Temperature sensor swe:value Copyright © 2011 Open Geospatial Consortium 85 OGC 08-094r1 SWE Common Data Model swe:value Underwater camera swe:value swe:AllowedTokens swe:constraint swe:Category In this example, the values allowed by the code space OWL ontology located at http:mmisw.orgontbodcinstrument are further restricted by allowing only three of its members. This element can also be used to specify a constraint with a regular expression pattern. This is shown below with a model number example using a “Text” element: swe:Text definition = http:mmisw.orgontmmideviceModelID swe:label Model Number swe:label swe:constraint swe:AllowedTokens swe:pattern [0-9][A-Z]{3}[0-9]{2}S1 swe:pattern swe:AllowedTokens swe:constraint swe:Text The pattern shall follow the unicode regular expression syntax described in Unicode Technical Std 18. This is the same syntax as the one used by the XML Schema specification. Requirement http:www.opengis.netspecSWE2.0reqxsd-simple-componentsunicode-regex-valid Req 66. The “pattern” child element of the “AllowedTokens” element shall be a regular expression valid with respect to Unicode Technical Standard 18, Version 13.

8.1.16 AllowedValues Element

The “AllowedValues” element is the XML schema implementation of the “AllowedValues” UML class defined in clause 7.2.18. The schema snippet for this element and its corresponding complex type is shown below: element name = AllowedValues substitutionGroup = swe:AbstractSWE type = swe:AllowedValuesType complexType name = AllowedValuesType complexContent extension base = swe:AbstractSWEType sequence element name = value type = double minOccurs = maxOccurs = unbounded element name = interval type = swe:RealPair minOccurs = maxOccurs = unbounded element name = significantFigures type = integer minOccurs = sequence extension complexContent complexType 86 Copyright © 2011 Open Geospatial Consortium