**Encoding IOOS v0.6.0 Observations**

**Introduction**

The DIF XML specification includes schema and data record definitions
for six IOOS core variables (currents, temperature, salinity, water
level, winds and waves) and a variety of\
sampling feature types (points, profiles, trajectories, and collections
or time series thereof). It consists of an Open Geospatial Consortium
(OGC) Geography Markup Language (GML)\
application schema (ioosTypes.xsd) that extends and specializes GML and
Sensor Web Enablement (SWE) schema definitions, a profile
(observationSpecializations.xsd) of the Observations and Measurements
(O&M) schema, a collection of O&M sample observation XML documents, and
an associated set of SWE sample XML record definition XML documents.

![](media/image1.jpeg){width="5.99375in" height="6.261805555555555in"}

Figure 1

As shown in Figure 1 above, for IOOS an Observation is a
CompositeObservation from observationSpecializations.xsd that constrains
the result of the observation to be an ioos:Composite from
ioosTypes.xsd. The result of an IOOS observation includes values for
phenomena that are the context of the observation as well as values for
the observed properties. In version 0.6.0, both the procedure that
describes the observation process and the result of the observation are
encoded using thes and elements from ioosTypes.xsd that extend types and
are members of substitution groups from GML valueObjects.xsd.

![](media/image2.png){width="4.822916666666667in"
height="7.385416666666667in"}

Figure 2

The ioos:Composite element shown in Figure 2 above is of type
ioos:CompositeValueType, defined in ioosTypes.xsd, which extends
gml:CompositeValueType from the GML valueObjects.xsd. It is intended to
serve as a container for result values of both observation context
Phenomena and the phenomena of interest. An ioos:CompositeContext
element with the same type definition is intended to serve as a
container only for observation context phenomena, or for observation
procedure process definitions. An ioos:CompositeValue element with the
same type definition is intended to serve as a container only for result
values of the phenomena of interest. All of these elements contain
gml:Value elements in either gml:valueComponent or gml:ValueComponents
properties. The contained gml:Value elements may be of different type
definitions, as described below.

A gml:id attribute is mandatory, as shown by its solid line rectangle
border in Figure 2. The values of gml:id attributes must be unique
within an XML document, because they are defined as XML ID types. The
value of gml:id attributes should be made meaningful to concisely
describe as well as identify XML elements unless there is an overriding
policy for the use of opaque ID values. If opaque gml:id values are
used, they should be supplemented with name attribute values. The
ioos:Composite element that contains the result of an observation or the
process definition for the observation procedure should also have a
recDef attribute with a URL value referencing the SWE record definition
for the ioos:Composite XML element and the elements it contains. If the
ioos:Composite element that contains the result of an observation is not
part of the om:CompositeObservation, but is a separate XML document, it
should also have a processDef attribute with a URL value referencing the
ioos:Composite element containing the definition of the observation
procedure.

The ioos:Array element shown in Figure 3 below is of type
ioos:ValueArrayType, defined in ioosTypes.xsd, which extends
gml:ValueArrayType from the GML valueObjects.xsd. Its structural
definition in XML schema is similar to that of ioos:CompositeValueType,
with additional codeSpace and uom attributes. Its semantic use is
constrained to containment of elements with the same type definitions,
or those with derived type definitions in the base element substitution
groups. It is intended to serve as a container for result values of both
observation context Phenomena and the phenomena of interest. An
ioos:ContextArray element with the same type definition is intended to
serve as a container only for observation context phenomena, or for
observation procedure process definitions. An ioos:ValueArray element
with the same type definition is intended to serve as a container only
for result values of the phenomena of interest.

In process or results encodings, the ioos:Array element must be
preceeded by an ioos:Count element specifying the size of the array, as
shown in the following example from the sample currentsPoint.xml.

[\<om:procedure\>]{.mark}

[\<om:Process\>]{.mark}

[\<ioos:CompositeContext gml:id=\"StationsSensors\"
recDef=\"http://www.csc.noaa.gov/ioos/schema/IOOS-DIF/IOOS/0.6.0/recordDefinitions/StationSensorRecordDefinition.xml\"\>]{.mark}

[\<gml:valueComponents\>]{.mark}

[\<ioos:Count name=\"NumberOfStations\"\>1\</ioos:Count\>]{.mark}

[\<ioos:ContextArray gml:id=\"StationArray\"\>]{.mark}

[\<gml:valueComponents\>]{.mark}

[\<ioos:CompositeContext gml:id=\"StationInfo\"\>]{.mark}

This count is referenced by the swe:Count elements in the record
definition, so that a separate record definition documents with a
"hard-coded" swe:Count for the array size does not have to be generated
for each observation with an array containing a different number of
elements. Here is the beginning of the sample
StationSensorRecordDefinition.xml. The first swe:Count element in this
record definition corresponds to the ioos:Count element in the extract
from currentsPoint.xml above. The second swe:Cound element , contained
in the swe:DataArray gml:id="StationArrayRecord" refers to the first one
by its gml:id to obtain the array size from the observation result.

[\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>]{.mark}

[\<swe:DataRecord]{.mark}

[xmlns:xlink=\"http://www.w3.org/1999/xlink\"]{.mark}

[xmlns:gml=\"http://www.opengis.net/gml/3.2\"]{.mark}

[xmlns:swe=\"http://www.opengis.net/swe/1.0.2\"]{.mark}

[xmlns:ioos=\"http://www.noaa.gov/ioos/0.6.0\"]{.mark}

[xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"]{.mark}

[xsi:schemaLocation=\"http://www.opengis.net/swe/1.0.2
../../../OGC/sweCommon/1.0.2/swe.xsd\"]{.mark}

[gml:id=\"StationsSensorsDataRecord\"\>]{.mark}

[\<swe:field name=\"NumberOfStations\"\>]{.mark}

[\<swe:Count gml:id=\"NumberOfStations\"/\>]{.mark}

[\</swe:field\>]{.mark}

[\<swe:field name=\"StationArray\"\>]{.mark}

[\<swe:DataArray gml:id=\"StationArrayRecord\"\>]{.mark}

[\<swe:elementCount ref=\"NumberOfStations\"/\>]{.mark}

[\<swe:elementType name=\"Station\"\>]{.mark}

The gml:Value element is defined as a choice group of generic value
types, including GML abstract geometries, abstract time objects, and a
variety of composite and scalar value types. In ioosTypes.xsd, both
specific and general scalar value types are defined for encoding
procedure definition and result values. Specific elements were defined
for commonly used values. The generic elements may be used for any other
required information, as shown in the sample instance documents.
Specific element definitions may be created in future versions of
ioosTypes.xsd to replace widely used ones encoded using the generic
elements.

The specific elements defined in v0.6.0 include:

-   SensorId

-   SensorModel

-   SensorNumberOfBeams

-   SamplingRate

-   ReportingInterval

-   VerticalDatum

-   ProcessingLevel

-   VerticalPosition

The generic elements include:

-   Text

-   Integer

-   Count

-   Quantity (real data type)

-   Context (real data type)

![](media/image3.png){width="4.375in" height="7.376388888888889in"}

Figure 3

Not shown in Figure 1 are the SWE record definitions that describe the
structure of both the procedure and result sections of the XML
Observation instance documents.
PlatformsSensorsStationsRecordDefinition.xml describes the structure
used for the sample observation procedures for moving platforms like
ships, drifters, airplanes, or balloons.
StationSensorRecordDefinition.xml describes the structure used for the
observation procedures of all of the other sample observation documents.
The record structure definitions for the result values of the sample
observations have names similar to those of the observation documents.
For example, the structure of currentsPoint.xml is defined by
CurrentsPointDataRecordDefinition.xml.

The observed property shown in Figure 1 is encoded in the sample
instance documents as a reference to an entry in
phenomenonDicitionary.xml, like this:

[\<om:observedProperty
xlink:href=\"http://www.csc.noaa.gov/ioos/schema/IOOS-DIF/IOOS/0.6.0/dictionaries/phenomenaDictionary.xml#Currents\"\>]{.mark}

[\<!\-- A remote reference to phenomena dictionary entry that provides
the semantics for the observed property. A new dictionary entry must be
created if a relevant one does not exist. \--\>]{.mark}

[]{.mark}

[The feature of interest shown in Figure 1 is encoded in a sample
instant document either as an in-line GML feature as shown in
currentsPoint.xml:]{.mark}

[]{.mark}

[\<!\-- Feature Of Interest \--\>]{.mark}

[\<om:featureOfInterest\>]{.mark}

[\<!\-- the feature of interest may be provided in-line as follows or
referenced via an XLink, e.g. to a WFS, as shown in other samples
\--\>]{.mark}

[\<ioos:WaterBodyFeature gml:id=\"NarragansettBay\"\>]{.mark}

[\<gml:name\>NarragansettBay\</gml:name\>]{.mark}

[\<ioos:surface\>]{.mark}

[\<gml:Polygon gml:id=\"NBPoly\"\>]{.mark}

[\<!\-- srsName is not specified, so the one from gml:Envelope above
applies here by default \--\>]{.mark}

[\<gml:exterior\>]{.mark}

[\<gml:Ring\>]{.mark}

[\<gml:curveMember\>]{.mark}

[\<!\-- this is just a place-holder; gml:Curve or gml:LineString with
coordintes goes here \--\>]{.mark}

[\</gml:curveMember\>]{.mark}

[\</gml:Ring\>]{.mark}

[\</gml:exterior\>]{.mark}

[\</gml:Polygon\>]{.mark}

[\</ioos:surface\>]{.mark}

[\</ioos:WaterBodyFeature\>]{.mark}

[\</om:featureOfInterest\>]{.mark}

[]{.mark}

[]{.mark}

[or as an xlink:href URL containing a request to a Web Feature Service
(WFS) to return the feature of interest, as shown in the other example
documents.]{.mark}

[]{.mark}

[\<om:featureOfInterest
xlink:href=\"http://wfs.ioos.noaa.gov?request=getFeature&amp;featureid=NarragansettBay
\"/\>]{.mark}

[\<!\-- a notional WFS call identifying the object regarding which the
observation was made \--\>]{.mark}

[]{.mark}

[]{.mark}

[]{.mark}