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

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 SWE Common Data Model OGC 08-094r1 This element is used to specify numerical constraints for the “Count” and “Quantity” elements and the corresponding range components. The XML snippet below illustrates how to constrain an angular value to the -180180 degrees domain: swe:Quantity definition = http:sweet.jpl.nasa.gov2.0spaceDirection.owlAngle swe:label Planar Angle swe:label swe:uom code = deg swe:constraint swe:AllowedValues swe:interval -180 +180 swe:interval swe:AllowedValues swe:constraint swe:Quantity Several intervals can be specified to generate holes with forbidden values. Using several intervals means that the value is constrained to be within one of the intervals: swe:AllowedValues swe:interval -INF -20 swe:interval swe:interval 20 50 swe:interval swe:interval 60 INF swe:interval swe:AllowedValues Note that the –Infinity and +Infinity are allowed in order to specify unbounded intervals. The above example indicates that the value must be either less than or equal to -20, between 20 and 50 included, or greater than or equal to 60. Intervals specified with this element are always inclusive and should not overlap. Allowed values can also be enumerated as shown in the example below: swe:Count definition = http:www.opengis.netdefpropertyOGC0NumberOfPixels swe:label Image Width swe:label swe:constraint swe:AllowedValues swe:value 256 swe:value swe:value 512 swe:value swe:value 1024 swe:value swe:AllowedValues swe:constraint swe:Count Several allowed intervals and values can also be combined to express a complex constraint even though this is rarely used in practice: swe:AllowedValues swe:value 5 swe:value swe:value 10 swe:value swe:interval 20 30 swe:interval swe:interval 40 60 swe:interval swe:AllowedValues In the above example, the actual value must be 5, or 10, or between 20 and 30 included, or between 40 and 60 included. All numbers used within “interval” and “value” elements shall be expressed in the same unit as the enclosing data component Req 36. Copyright © 2011 Open Geospatial Consortium 87