DataRecord Element Requirements Class: Record Components Schema Requirements Class

SWE Common Data Model OGC 08-094r1 element sequence extension complexContent complexType The element contains all sub-elements inherited from “AbstractDataComponentType” as well as a list of at least one “field” property elements, each with a “name” attribute and containing the data component element that defines the field. The XML example below describes a record composed of weather data fields. In this case the “DataRecord” element is used as a data descriptor and the corresponding data stream is usually composed of several tuples of values, each tuple corresponding to one record as defined here: swe:DataRecord swe:label Weather Data Record swe:label swe:description Record of synchronous weather measurements swe:description swe:field name = time swe:Time definition = http:www.opengis.netdefpropertyOGC0SamplingTime referenceFrame = http:www.opengis.netdeftrsOGC0GPS swe:label Sampling Time swe:label swe:uom xlink:href = http:www.opengis.netdefuomISO-86010Gregorian swe:Time swe:field swe:field name = temperature swe:Quantity definition = http:mmisw.orgontcfparameterair_temperature swe:label Air Temperature swe:label swe:uom code = Cel swe:Quantity swe:field swe:field name = pressure swe:Quantity definition = http:mmisw.orgontcfparameterair_pressure_at_sea_level swe:label Air Pressure swe:label swe:uom code = mbar swe:Quantity swe:field swe:field name = windSpeed swe:Quantity definition = http:mmisw.orgontcfparameterwind_speed swe:label Wind Speed swe:label swe:uom code = kmh swe:Quantity swe:field swe:field name = windDirection swe:Quantity definition = http:mmisw.orgontcfparameterwind_to_direction swe:label Wind Direction swe:label swe:uom code = deg swe:Quantity swe:field swe:DataRecord Each field shall have a unique name within the record Req 39. This is enforced by a Schematron pattern. The “DataRecord” element can also carry its own “definition” attribute to carry semantics about the whole group of values. The next example shows how radial distortion coefficients of a frame camera sensor could be encoded in this way: Copyright © 2011 Open Geospatial Consortium 91 OGC 08-094r1 SWE Common Data Model swe:DataRecord definition = urn:x-ogc:def:property:CSM::RadialDistortionCoefficients swe:label Radial Distortion Coefficients swe:label swe:field name = k1 swe:Quantity definition = urn:x-ogc:def:property:CSM::DISTOR_RAD1 swe:uom code = mm-2 swe:value 1.92709e-005 swe:value swe:Quantity swe:field swe:field name = k2 swe:Quantity definition = urn:x-ogc:def:property:CSM::DISTOR_RAD2 swe:uom code = mm-2 swe:value -5.14206e-010 swe:value swe:Quantity swe:field swe:field name = k3 swe:Quantity definition = urn:x-ogc:def:property:CSM::DISTOR_RAD3 swe:uom code = mm-2 swe:value -3.33356e-012 swe:value swe:Quantity swe:field swe:DataRecord Note: URNs used in this example haven’t been registered with OGC yet so they are in the “x-ogc” namespace. The “DataRecord” element is fully recursive so that each field can itself be a “DataRecord”, but most importantly each field can be any other data component defined in this standard such as “Vector”, “DataChoice” and “DataArray”. Examples above only make use of field components with minimum metadata, but each of these fields can have all the possible content defined in clause 8.1, including quality, constraints, etc.

8.2.2 Vector Element

The “Vector” element is the XML schema implementation of the “Vector” UML class defined in clause 7.3.2. The schema snippet for this element and its corresponding complex type is shown below: element name = Vector type = swe:VectorType substitutionGroup = swe:AbstractDataComponent complexType name = VectorType complexContent extension base = swe:AbstractDataComponentType sequence element name = coordinate maxOccurs = unbounded complexType complexContent extension base = swe:AnyNumericalPropertyType attribute name = name type = NCName use = required extension complexContent complexType element sequence attribute name = referenceFrame type = anyURI use = required attribute name = localFrame type = anyURI use = optional extension complexContent complexType 92 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1 This element is similar to the “DataRecord” element except that it is composed of a list of coordinates instead of fields. Each “coordinate” element is restricted to numerical component types see “AnyNumerical” element group defined in clause 8.1.18 and inherits the reference frame from the “Vector” element. A Schematron pattern enforces that an “axisID” attribute is specified and that no “referenceFrame” attribute is used on each coordinate component see Req 41 and Req 42. The example below illustrates how to use the “Vector” element to encode geographic location: swe:Vector definition = http:sweet.jpl.nasa.gov2.0space.owlLocation referenceFrame = http:www.opengis.netdefcrsEPSG04326 swe:coordinate name = lat swe:Quantity definition = http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLatitude axisID = Lat swe:label Latitude swe:label swe:uom xlink:href = deg swe:value 45.36 swe:value swe:Quantity swe:coordinate swe:coordinate name = lon swe:Quantity definition = http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLongitude axisID = Long swe:label Longitude swe:label swe:uom code = deg swe:value 5.2 swe:value swe:Quantity swe:coordinate swe:Vector This snippet indicates that the location coordinates are given in the EPSG 4326 WGS 84 LatLon coordinate reference system. Note the use of a “definition” attribute to indicate what type of vector it is. This definition is very important because the “Vector” element can be used to represent other vector quantities than location. For instance, the velocity vector of a spacecraft can be defined as show below: swe:Vector definition = http:sweet.jpl.nasa.gov2.0physDynamics.owlVelocity referenceFrame = http:www.opengis.netdefcrsOGC0ECI_WGS84 swe:coordinate name = Vx swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physDynamics.owlSpeed axisID =X swe:label Velocity X swe:label swe:uom xlink:href = ms swe:Quantity swe:coordinate swe:coordinate name = Vy swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physDynamics.owlSpeed axisID =Y swe:label Velocity Y swe:label swe:uom code = ms swe:Quantity swe:coordinate swe:coordinate name = Vz swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physDynamics.owlSpeed axisID =Z swe:label Velocity Z swe:label swe:uom code = ms swe:Quantity swe:coordinate swe:Vector Copyright © 2011 Open Geospatial Consortium 93