Time Element Requirements Class: Basic Types and Simple Components Schemas Requirements Class
SWE Common Data Model OGC 08-094r1
element name
= uom
type =
swe:UnitReference element
name =
constraint maxOccurs
= 1
minOccurs =
type =
swe:AllowedTimesPropertyType element
maxOccurs =
1 minOccurs
= name
= value
type =
swe:TimePosition sequence
attribute name
= referenceTime
type =
dateTime use
= optional
attribute name
= localFrame
type =
anyURI use
= optional
extension complexContent
complexType
The “uom” property element is of type “UnitReferencePropertyType”. It has the same requirements as its equivalent in the “Quantity” element. When ISO 8601 calendar
notation is used, it is specified as a unit by using a special value in the “xlink:href” attribute i.e. for simplicity, a calendar representation is considered here as a complex
unit composed of year, month, day, hours, minutes and seconds.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-simple-componentsiso8601-uom-used
Req 65. When ISO 8601 notation is used to express the measurement value
associated to a “Time” element, the URI “http:www.opengis.netdefuomISO‐
86010Gregorian” shall be used as the value of the “xlink:href” XML attribute on
the “uom” element.
Additional constraints on the value can be expressed by using the “AllowedTimes” element detailed in clause 8.1.17. The “value” property element takes either a decimal
value or a calendar value encoded according to the ISO 8601 standard. This is enforced by using the “TimePosition” simple type defined below as the union of the “double” and
“TimeIso8601” data types:
simpleType name
= TimePosition
union memberTypes
= double swe:TimeIso8601
simpleType simpleType
name =
TimeIso8601 union
memberTypes =
date time dateTime swe:TimeIndeterminateValue simpleType
simpleType name
= TimeIndeterminateValue
restriction base
= string
enumeration value
= now
restriction simpleType
The “double” data type is used to express time as a scalar decimal number i.e. a duration and can be any of the special values “-INF”, “INF” and “NaN” just like the
value of a “Quantity” component.
The “date”, “time” and “dateTime” data types are built-in types of XML Schema and are implemented according to ISO 8601 complete representations of date, time and
combination of date and time respectively see XML schema 1.0 specification and ISO 8601 for details on the format.
Copyright © 2011 Open Geospatial Consortium
77
OGC 08-094r1 SWE Common Data Model
The example below shows how to use this XML element to specify the sampling time of a measurement:
swe:Time definition
= http:www.opengis.netdefpropertyOGC0SamplingTime
referenceFrame =
http:www.opengis.netdeftrsOGC0GPS swe:label
Sampling Time swe:label
swe:description Time at which the measurement was made
swe:description swe:uom
xlink:href =
http:www.opengis.netdefuomISO-86010Gregorian swe:value
2009-11-05T16:29:26Z swe:value
swe:Time
Note the “referenceFrame” attribute which clarifies the time reference system used. Here the GPS time standard, which is different from UTC and TAI is used. The presence of the
mandatory “referenceFrame” attribute see Req 27 is enforced by an additional Schematron assertion.
As mentioned above, the “Time” element can also be used to specify a time after an epoch by specifying a time of reference and using a scalar numerical value. This is shown
in the following example with a UNIX time:
swe:Time definition
= http:www.opengis.netdefpropertyOGC0RunTime
referenceTime =
1970-01-01T00:00:00Z swe:label
Model Run Time swe:label
swe:description Run time of the model expressed as a Unix time
swe:description swe:uom
code =
s swe:value
1257415633 swe:value
swe:Time
The “localFrame” attribute can be used to indicate the time frame whose origin is given by the time component value. This way several time positions can be defined relative to
each other. The next example shows how this can be used to express times of high frequency scan lines acquired by an airborne scanner relative to the flight’s start time:
swe:Time definition
= http:www.opengis.netdefpropertyOGC-EO0MissionStartTime
localFrame =
MISSION-START-TIME referenceFrame
= http:www.opengis.netdeftrsOGC0UTC
swe:label Flight Time
swe:label swe:description
Time at take-off in UTC swe:description
swe:uom xlink:href
= http:www.opengis.netdefuomISO-86010Gregorian
swe:value 2009-01-26T10:21:45+01:00
swe:value swe:Time
Scan times are then expressed relative to the flight’s start time:
swe:Time definition
= http:www.opengis.netdefpropertyOGC-EO0ScanStartTime
localFrame =
SCAN-START-TIME referenceFrame
= MISSION-START-TIME
swe:label Scanline Time
swe:label swe:description
Acquisition time of the scan line swe:description
swe:uom code
= s
swe:value 1256.235
swe:value swe:Time
78
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
In the snippet above the reference frame is the previously defined mission start time which means that the time value is relative to this time of reference. The value can then
be encoded as a float for better efficiency.
Note: A simple duration expressed outside of any time reference system should be defined by using a “Quantity” rather than a “Time” element.