SensorNet
Data Center Services
Design Document


David Resseguie
resseguiedr@ornl.gov

1.   Introduction

The SensorNet web service interfaces use Open Geospatial Consortium (OGC) XML schemas for publication of sensor data. OGC is an association developing open, vendor-independent computing standards for geographic information systems (GIS) and other related technologies. OGC specifies the usage of the Geography Markup Language (GML), an XML grammar written in XML Schema, for the encoding of geographic information. Although GML provides specifications for describing a variety of geographical information, the fundamental element of GML is a geographic "feature". According to the OGC description of GML 3.0, a geographic feature is "an abstraction of a real world phenomenon; it is a geographic feature if it is associated with a location relative to the Earth". Many features contain both spacial and temporal information. As such, almost all aspects of SensorNet can be treated as geographic features, including nodes, sensors, and O&M data.

To facilitate the communication of feature data between clients and servers, OGC has developed the Web Feature Service Interface Specification (WFS). The WFS specification describes the request and response documents for web services using HTTP as the distributed computing platform for creating or modifying feature instances and for querying features based on both spatial and non-spatial constraints. SensorNet takes advantage of these open standards and uses a WFS interface for access to node, sensor, and observation and measurement (O&M) data. The SensorNet nodes use transactional WFS services to insert and update O&M data at the SensorNet Data Center. The transactional WFS services are also used for updating mutable properties of nodes and sensors - i.e. for mobile devices.

This document describes how SensorNet uses WFS services to implement a standards-based sensor network.

2.   SensorNet Data Center

A SensorNet Data Center (SDC) consists of the following main components related to the serving of feature data.

2.1   Web Feature Service

Any COTS WFS-T (Transactional WFS) implementation may be used at an SDC, provided it implements the functionality described here within.

The SensorNet feature definitions are described below.

2.2   Policy Server

SensorNet requires client authentication using Public Key Infrastructure (PKI) digital certificates and HTTP Certificate Authentication over Secure Sockets Layer/Transport Layer Security (SSL/TLS).

The presented client certificate is passed to the policy server to generate a list of allowed owner labels and functional labels the user is allowed to read and/or write. Details of the Policy Server interface are hidden from SensorNet clients and are thus not given here.

2.3   Sensor Alert Service (SAS) Server

SensorNet alerts are handled using the OGC Sensor Alert Service over the XMPP / Jabber protocol. This document does not include detailed descriptions of SAS usage within SensorNet.

3.   SensorNet Features

All SensorNet data types have been defined in terms of features. All SensorNet features have a set of common properties. Type-specific elements are defined for certain feature types. Formal schema definitions are available in Appendix A.

An example helps illustrate this concept. Below is an XML document for an observation from a Smith's Detection Centurion.

      <snet:Feature xmlns:snet="http://www.sensornet.gov/snet" xmlns:gml="http://www.opengis.net/gml" gml:id="1234">
         <gml:description>A test feature only.</gml:description>
         <snet:Location>
            <gml:Point>
               <gml:coordinates>-84.3122716,35.9281064</gml:coordinates>
            </gml:Point>
         </snet:Location>
         <snet:Datetime>
            <gml:TimePeriod>
               <gml:begin>
                  <gml:TimeInstant>
                     <gml:timePosition>2005-03-07T22:17:26Z</gml:timePosition>
                  </gml:TimeInstant>
               </gml:begin>
               <gml:end>
                  <gml:TimeInstant>
                     <gml:timePosition>2005-03-07T22:18:26Z</gml:timePosition>
                  </gml:TimeInstant>
               </gml:end>
            </gml:TimePeriod>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>data.chem.smiths.centurian</snet:FunctionalLabel>
         <snet:AssociationId>NDC.ORNL.1-100006801</snet:AssociationId>
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN />
         <snet:Data schemaURI="http://www.sensornet.gov/schema">
            
            <cent:DetectorData xmlns:cent="http://www.sensornet.gov/centurion" id="501">
               <cent:Alarmed>False</cent:Alarmed>
               <cent:AmbientTemp>36</cent:AmbientTemp>
               <cent:AirInFilterDirty>False</cent:AirInFilterDirty>
               <cent:AutoCalibrationFailed>False</cent:AutoCalibrationFailed>
               <cent:DriftFlow>378</cent:DriftFlow>
               <cent:MoistureTooHigh>False</cent:MoistureTooHigh>
               <cent:PgramSampleIndex>1330504</cent:PgramSampleIndex>
               <cent:SampleFlow>58</cent:SampleFlow>
               <cent:SampleTemp>30</cent:SampleTemp>
               <cent:VerifiationFailed>False</cent:VerifiationFailed>
               <cent:Alarms />
               <cent:Plasmagram totalScan="161">
                  -466 -490 -409 -409 -452 -479 -508 -483 -426 -371
                  ... 
                  482 504 532 556
               </cent:Plasmagram>
            </cent:DetectorData>
            
         </snet:Data>
      </snet:Feature>


The colored portion is the type-specific content, stored as children of the snet:Data element.

3.1   Common Feature Properties

The following are the common SensorNet feature properties and attributes:

gml:id

The gml:id, or feature ID, is assigned when the feature is inserted and uniquely identifies a feature.

gml:description

This is informational text accompanying the feature.

snet:AssociationId

This property is optional and serves as a means of linking or relating one or more features to a target feature or referent. The ID used here is the feature ID of the associated feature.

snet:Data

Contains one or more elements, the content of which is the type-specific feature data. An XML Schema Document (XSD) should exist, at least in principle, for each property value. That is, a consumer of the feature should be able to determine how to process the feature content from the FunctionalLabel property. The optional schemaURI attribute specifies the URI of the schema describing the type-specific properties.

snet:DataCenter

Gives the name of the data center the feature was originally submitted to.

snet:Datetime

The Datetime property specifies the temporal domain in which the feature is valid. It is specified as either a GML TimeInstant or GML TimePeriod. All datetimes must be represented in ISO 8601 extended format1, as defined for the dateTime element in the XML Schema.

GML TimeInstant

      <gml:TimeInstant>
         <gml:timePosition>2005-03-07T22:53:37Z</gml:timePosition>
      </gml:TimeInstant>
    

GML TimePeriod

      <gml:TimePeriod>
         <gml:begin>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T22:52:39Z</gml:timePosition>
            </gml:TimeInstant>
         </gml:begin>
         <gml:end>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T22:53:39Z</gml:timePosition>
            </gml:TimeInstant>
         </gml:end>
      </gml:TimePeriod>

    

snet:FunctionalLabel

Each feature must have a fully qualified FunctionalLabel property. Requests can include one or more labels with wildcards to identify features of interest, and access control and authorization uses the labels to determine a user's access for retrievals and insertions. A detailed description of functional labels is provided, including suggested best practices for organizing the label hierarchy.

snet:Location

The Location property specifies the geographic range of the feature. It is specified as either a GML point or GML bounding box.

GML Point - specified by longitude and latitude

      <gml:Point>
         <gml:coordinates>-84.3122716,35.9281064</gml:coordinates>
      </gml:Point>
    

GML Box - specified by west longitude, south latitude, east longitude, north latitude.

      <gml:Box>
         <gml:coordinates>-84.3122716,35.9281064 -82.84752,37.523</gml:coordinates>
      </gml:Box>
    

snet:OwnerLabel

This is an optional owner label. Access control and authorization includes verification that a user has access to a feature with a particular owner label.

snet:SensitivityLabel

Gives the sensitivity level of the feature - i.e. "OUO", "Public", etc.

snet:SubmitterCertificateDN

Gives the distinguished name of the feature submitter's digital certificate.

3.2   Feature Types

Each of the SensorNet feature types contain the common properties listed above. In addition, some feature types specify additional type-specific properties. The following sections describe the SensorNet feature types and their additional properties.

3.2.1   snet:Feature

This is the base feature type for all features in SensorNet. All other SensorNet features are derived from snet:Feature. snet:Feature may also be used itself to insert generic data into SensorNet.

3.2.2   snet:Group

Feature type representing a logical grouping of other features. The geometric properties of this feature should describe a general area of interest for this group. It is not required to be a superset of the geometries for all features in the group. A group feature may, in turn, contain other groups.

In addition to the snet:Feature properties, the snet:Group feature type has the additional properties:

snet:GroupName

Descriptive (verbose) name of this logical group.

snet:GroupId

Compact format ID of this logical group. (i.e. useful for labeling icons)

      <snet:Group gml:id="1234">
         <gml:description>An example group feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.group.logical</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:GroupName>Example Logical Group</snet:GroupName>
         <snet:GroupId>EXPLGRP</snet:GroupId>
      </snet:Group>

3.2.3   snet:DataSource

Feature type representing a data source. The geometric properties of the feature should describe either the actual location of the data source itself or an area representing the coverage of the data.

In addition to the snet:Feature properties, the snet:DataSource feature type has the additional properties:

snet:DataSourceName

Descriptive (verbose) name of this data source.

snet:DataSourceId

Compact format ID of this data source. (i.e. useful for labeling icons)

snet:DataSourceType

Gives the type of this data source, such as "Node", "Sensor", and "External".

snet:MobileDataSource

Indicates if this is a mobile or fixed data source. "true" indicates the node is mobile, "false" indicates fixed.

snet:OperationalStatus

Indicates the operational status of this data source, usually "ACTIVE".

snet:DeploymentNotes

Verbose description of any deployment specific notes. These notes may include access restritions, driving directions,etc.

snet:PointOfContact

Gives name and contact information for the point of contact for this data source.

snet:DataSourceManufacturer

Gives the manufacturer of this data source.

snet:DataSourceModel

Gives the model of this data source.

snet:DataSourceMetaData

Gives additional meta data properties about this data source. The schemaURI attribute specifies the URI of the schema describing the type-specific properties.

      <snet:DataSource gml:id="1234">
         <gml:description>An example external data source feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.datasource.external.acme.model01</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:DataSourceId>EXPLDS01</snet:DataSourceId>
         <snet:DataSourceName>Example Data Source Feature</snet:DataSourceName>
         <snet:DataSourceManufacturer>ACME</snet:DataSourceManufacturer>
         <snet:DataSourceModel>MODEL01</snet:DataSourceModel>
         <snet:DataSourceType>External</snet:DataSourceType>
         <snet:DeploymentNotes/>
         <snet:DataSourceMetaData schemaURI="http://www.foo.com/schema/datasource.xsd">
            <MyMetaData01 />
            <MyMetaData02 />
         </snet:DataSourceMetaData>
         <snet:MobileDataSource>false</snet:MobileDataSource>
         <snet:OperationalStatus>ACTIVE</snet:OperationalStatus>
         <snet:PointOfContact>J. Doe (865-555-1212)</snet:PointOfContact>
      </snet:DataSource>

3.2.4   snet:Node

Feature type representing a physical node. The geometric properties of the feature should describe the location of the node itself, not necessarily the location of all sensors reporting to the node. The snet:Node feature type extends the snet:DataSource feature type.
      <snet:Node gml:id="1234">
         <gml:description>An example node feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.datasource.node.acme.model01</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:DataSourceId>EXPLNODE01</snet:DataSourceId>
         <snet:DataSourceName>Example Node Feature</snet:DataSourceName>
         <snet:DataSourceManufacturer>ACME</snet:DataSourceManufacturer>
         <snet:DataSourceModel>MODEL01</snet:DataSourceModel>
         <snet:DataSourceType>Node</snet:DataSourceType>
         <snet:DeploymentNotes>Security clearance allowed for site access.</snet:DeploymentNotes>
         <snet:DataSourceMetaData schemaURI="http://www.foo.com/schema/node.xsd">
            <MyMetaData01 />
            <MyMetaData02 />
         </snet:DataSourceMetaData>
         <snet:MobileDataSource>true</snet:MobileDataSource>
         <snet:OperationalStatus>ACTIVE</snet:OperationalStatus>
         <snet:PointOfContact>J. Doe (865-555-1212)</snet:PointOfContact>
      </snet:Node>

3.2.5   snet:Sensor

Feature type representing a physical sensor. The snet:Sensor feature type extends the snet:DataSource feature type. The snet:AssociationId for a sensor should be the feature ID of the node it is attached to.
      <snet:Sensor gml:id="1234">
         <gml:description>An example sensor feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.datasource.sensor.acme.model01</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:DataSourceId>EXPLSENSOR01</snet:DataSourceId>
         <snet:DataSourceName>Example Sensor Feature</snet:DataSourceName>
         <snet:DataSourceManufacturer>ACME</snet:DataSourceManufacturer>
         <snet:DataSourceModel>MODEL01</snet:DataSourceModel>
         <snet:DataSourceType>Sensor</snet:DataSourceType>
         <snet:DeploymentNotes>Located on top of guard station.</snet:DeploymentNotes>
         <snet:DataSourceMetaData schemaURI="http://www.foo.com/schema/sensor.xsd">
            <MyMetaData01 />
            <MyMetaData02 />
         </snet:DataSourceMetaData>
         <snet:MobileDataSource>true</snet:MobileDataSource>
         <snet:OperationalStatus>ACTIVE</snet:OperationalStatus>
         <snet:PointOfContact>J. Doe (865-555-1212)</snet:PointOfContact>
      </snet:Sensor>

3.2.6   snet:Observation

Feature type representing an observation from a sensor or other data source. The snet:AssociationId for an observation should be the feature ID of the datasource that produced the data.

In addition to the snet:Feature properties, the snet:Observation feature type has the additional properties:

snet:Data

For an snet:Observation, the snet:Data property us used to represent the actual observation data. It is recommended, but not required, that observation data be represented using the OGC Observation and Measurement (O&M) specification. Regardless, the schemaURI attribute should specifies the URI of the schema describing the observation data.

snet:ObservationDescription

A verbose description explaining what is being observed, how the observation was made, what the result means, etc.

      <snet:Observation gml:id="1234">
         <gml:description>An example observation feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.data.chem.acme.model01</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:Data schemaURI="http://www.foo.com/schema/observation.xsd">
            <Property1/>
            <Property2/>
            <Property3/>
         </snet:Data>
         <snet:ObservationDescription>Example observation from a fictional Acme Model01 sensor.</snet:ObservationDescription>
      </snet:Observation>

3.2.7   snet:Event

Feature type representing an event. The snet:AssociationId for an event should be the feature ID of the node, sensor, or data causing the event.

In addition to the snet:Feature properties, the snet:Event feature type has the additional properties:

snet:Data

In addition to the description of snet:Data for the snet:Feature feature type, this element is used within an snet:Event feature type to describe the data causing the event.

snet:EventType

Gives the type of event, such as "Alert", "MaintenanceNotification", etc.

snet:EventMessage

A message associated with this event. The event message may be formatted as a CAP message.

      <snet:Event gml:id="1234">
         <gml:description>An example event feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.event.maint.lowbattery</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:Data/>
         <snet:EventType>MaintenanceNotification</snet:EventType>
         <snet:EventMessage>Low battery on sensor "SENSOR01"</snet:EventMessage>
      </snet:Event>

3.2.8   snet:Alert

Feature type representing an alert. The snet:Alert feature type extends snet:Event.
      <snet:Alert gml:id="1234">
         <gml:description>An example alert feature</gml:description>
         <snet:Location>
            <gml:Box>
               <gml:coordinates>-85,35 -80,40</gml:coordinates>
            </gml:Box>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-07T00:00:00Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:DataCenter />
         <snet:FunctionalLabel>demo.event.alert.overthreshold</snet:FunctionalLabel>
         <snet:AssociationId />
         <snet:OwnerLabel>owner1</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:SubmitterCertificateDN/>
         <snet:Data schemaURI="http://www.foo.com/schema/observation.xsd">
            <Property1/>
            <Property2/>
            <Property3/>
         </snet:Data>
         <snet:EventType>Alert</snet:EventType>
         <snet:EventMessage>Sensor "SENSOR01" has gone over threshold.</snet:EventMessage>
      </snet:Event>

3.3   Functional Labels

Functional labels represent an ordered categorization of a feature. When stored in the database, each feature is accompanied by a fully qualified label (i.e., no wildcards for category names). Each data source is responsible for appropriately labeling all data it produces and/or submits to SensorNet. In particular, a data source producing multiple types of data must divide its data input into atomic features.

The notation for functional labels is tokens separated by a '.' similar to Java's package naming convention.

Example labels might include:

SensorNet has defined an initial set of category names for the first couple of hierarchical levels. This certainly does not preclude the introduction of new names or discontinued use of existing names in the future. Moreover, such changes will have no effect on the software components comprising the authorization and access control system. Rather, only the data used by the system (e.g., role definitions) need be altered to respond to such future changes.

The XML schema for each feature is determined by the feature type as required by the WFS specification. But a fully qualified functional label may be the identifier specifying the XML schema for the more specific feature content containing the actual observation and measurement data.

A wfs:GetFeature request can be mapped to a set of labels specifying the kinds or types of features desired. Similarly, authorization roles specify separate sets of read and write labels for which entities mapped to the role have access rights to retrieve and store, respectively. In the case of requests and roles, labels in a set are viewed inclusively, and the labels may include a wildcard value ('*') for the final category name. Wildcards specify a universal match with all categories at that level or deeper in the hierarchy. For example,

model.dispersion.*

would match all dispersion model results, whether produced by SCIPUFF, HYSPLIT, CAMEO, ALOHA, or any other model. That is, the above label would match all of the following fully qualified labels

model.dispersion.scipuff
model.dispersion.hysplit
model.dispersion.cameo

but would not match any of the following

model.effects.ripdlipi
model.evac.orems
data.met.noaa.dcnet

The following table gives more examples of fully qualified labels that would and would not match.

Label Expression Matching Labels Non-Matching Labels
model.* model.dispersion.scipuff
model.evac.orems
model.effects.ripdlipi
model.waterflow.hytras
data.noaa.dcnet
data.chem.centurion.detection
data.rad.farwest
event.node.disconnect
data.met.* data.met.noaa.dcnet
data.met.wind
data.chem.centurion.detection
data.rad.farwest
model.dispersion.scipuff

Having wildcards in role labels allows the role to capture new feature types as they are envisioned and added. For example, a role with model.dispersion.* is authorized for any new feature type with a functional label starting with model.dispersion.

4.   SensorNet Service Interfaces

SensorNet services use POST method document-oriented requests based on the OGC WFS and GML specifications.

All SensorNet specific elements the namespace URI   http://www.sensornet.gov/snet.

4.1   ogc:Filter

ogc:Filter elements are used in each of the WFS services and consist of logical and comparison filters to be checked against feature properties of affected features. A filter consists of an ogc:Filter element with an enclosed filter operator.

   <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <!-- one of the supported operators below -->
   </ogc:Filter>

The prototype SensorNet WFS supports the following filters:

Logical Operators

Comparison Operators

Spatial Operators

Complex queries are generated by nesting logical operators with comparison, spatial, and custom operators. The following filter example matches any features within the given time and location with either a functional label matching "test.*" or an owner label of "TestOwner" but not with a functional label matching test.bad.*.

   <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:And>
         <ogc:BBOX>
            <ogc:PropertyName>Location</ogc:PropertyName>
            <gml:Box xmlns:gml="http://www.opengis.net/gml">
               <gml:coordinates>-85.0,30.0 -80.0,35.0</gml:coordinates>
            </gml:Box>
         </ogc:BBOX>
         <ogc:PropertyIsBetween>
            <ogc:PropertyName>Datetime</ogc:PropertyName>
            <ogc:LowerBoundary>2005-01-28T00:00:00Z</ogc:LowerBoundary>
            <ogc:UpperBoundary>2005-02-02T00:00:00Z</ogc:UpperBoundary>
         </ogc:PropertyIsBetween>
         <ogc:Or>
            <ogc:PropertyIsEqualTo>
               <ogc:PropertyName>OwnerLabel</ogc:PropertyName>
               <ogc:Literal>TestOwner</ogc:Literal>
            </ogc:PropertyIsEqualTo>
            <ogc:PropertyIsLike wildCard="*" singleChar="?" escape="!">
               <ogc:PropertyName>snet:FunctionalLabel</ogc:PropertyName>
               <ogc:Literal>test.*</ogc:Literal>
            </ogc:PropertyIsLike>
         </ogc:Or>
         <ogc:Not>
            <ogc:PropertyIsLike wildCard="*" singleChar="?" escape="!">
               <ogc:PropertyName>snet:FunctionalLabel</ogc:PropertyName>
               <ogc:Literal>test.bad.*</ogc:Literal>
            </ogc:PropertyIsLike>
         </ogc:Not>
      </ogc:And>
   </ogc:Filter>

4.2   wfs:Transaction Requests

The SensorNet prototype WFS supports the three basic WFS transaction requests: wfs:Insert, wfs:Update, and wfs:Delete.

4.2.1   wfs:Insert

The WFS insert transaction is used to insert a new feature instance into the SensorNet WFS. The snet:DataCenter and snet:SubmitterCertificateDN properties are set automatically by the SensorNet WFS. In response to a successful insertion, the assigned unique feature ID, or gml:id, is returned. Depending on the nature of the insert, the returned ID may be recorded or discarded.

To perform a WFS insert transaction, the following request XML is wrapped around the feature to be inserted. Multiple inserts may be included in one request, if desired. In the case of an error, a transaction result of either wfs:PARTIAL or wfs:FAILURE will be returned.

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" handle="ExampleTransactionRequest" version="1.0.0" service="WFS">

   <wfs:Insert handle="InsertTransaction1">
      <!-- Any SensorNet Feature -->
   </wfs:Insert>

   <wfs:Insert handle="InsertTransaction2">
      <!-- Any SensorNet Feature -->
   </wfs:Insert>
   
</wfs:Transaction>


<wfs:WFS_TransactionResponse xmlns:wfs="http://www.opengis.net/wfs">

   <wfs:InsertResult handle="InsertTransaction1">
      <ogc:FeatureId fid="123" xmlns:ogc="http://www.opengis.net/ogc" />
   </wfs:InsertResult>

   <wfs:InsertResult handle="InsertTransaction2">
      <ogc:FeatureId fid="124" xmlns:ogc="http://www.opengis.net/ogc" />
   </wfs:InsertResult>

   <wfs:TransactionResult>
      <wfs:Status>
         <wfs:SUCCESS />
      </wfs:Status>
   </wfs:TransactionResult>

</wfs:WFS_TransactionResponse>   
   

WFS insert requests are used for various purposes within SensorNet.

Register groups and data sources

Logical groups, nodes, sensors, and other datasources are "registered" by inserting either an snet:Group, snet:Node, snet:Sensor, or snet:DataSource feature respectively. When registering one of these feature types, the returned feature ID should be recorded so that it may be used as the association ID property for any associated features. Groups and data sources may be registered through a management application or automatically.

The current SensorNet nodes are designed to self-register themselves and any attached sensors. In the current system, when a node is powered on, it checks to see if it has a feature ID assigned to it. If not, it constructs a WFS insert request with an snet:Node feature representing itself. It then stores the returned feature ID for future use. Similarly, for each attached sensor (or when a new sensor is added), if the node does not have a feature ID associated with that sensor, it creates a WFS insert request with an snet:Sensor feature representing the sensor and stores the returned feature ID.

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" handle="ExampleTransactionRequest" version="1.0.0" service="WFS">
   <wfs:Insert handle="SensorInsertTransaction">
   
      <snet:Sensor xmlns:snet="http://www.sensornet.gov/snet" xmlns:gml="http://www.opengis.net/gml">
         <gml:description>FarWest 2070 Gamma Radiation Detector</gml:description>
         <snet:Location>
            <gml:Point>
               <gml:coordinates>2.2,1.1</gml:coordinates>
            </gml:Point>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-03T18:12:38Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:FunctionalLabel>sensor.rad.farwest</snet:FunctionalLabel>
         <snet:AssociationId>NDC.ORNL.1-100000751</snet:AssociationId>
         <snet:OwnerLabel>ORNL</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:DataSourceId>NTG-02</snet:DataSourceId>
         <snet:DataSourceName>Farwest</snet:DataSourceName>
         <snet:DataSourceManufacturer>FarWest Technology, Inc.</snet:DataSourceManufacturer>
         <snet:DataSourceModel>2070</snet:DataSourceModel>
         <snet:DataSourceType>Sensor</snet:DataSourceType>
         <snet:DeploymentNotes />
         <snet:DataSourceMetaData>
            <SensorMetaData sensor="Farwest">
               <DataName>DoseAvg</DataName>
               <DataField>1</DataField>
               <Description>average dose</Description>
               <Unit>mRAD/hr</Unit>
               <Type>integer</Type>
            </SensorMetaData>
            <SensorMetaData sensor="Farwest">
               <DataName>Dose</DataName>
               <DataField>2</DataField>
               <Description>dose</Description>
               <Unit>mRAD/hr</Unit>
               <Type>integer</Type>
            </SensorMetaData>
         </snet:DataSourceMetaData>
         <snet:MobileDataSource>false</snet:MobileDataSource>
         <snet:OperationalStatus>ACTIVE</snet:OperationalStatus>
         <snet:PointOfContact>J. Doe (865-555-1212)</snet:PointOfContact>
      </snet:Sensor>
      
   </wfs:Insert>
</wfs:Transaction>


<wfs:TransactionResponse xmlns:wfs="http://www.opengis.net/wfs">
   <wfs:InsertResult handle="SensorInsertTransaction">
      <ogc:FeatureId fid="NDC.ORNL.1-100010495" xmlns:ogc="http://www.opengis.net/ogc" />
   </wfs:InsertResult>
   <wfs:TransactionResult>
      <wfs:SUCCESS />
   </wfs:TransactionResult>
</wfs:TransactionResponse>   
   

Insert observation and measurement data

Observation and measurement data from sensors are inserted as snet:Observation features. The feature ID of the sensor producing the observation is used as the association ID of the observation. The returned feature ID may not need to be recorded unless the data is also the cause of an event or alert.

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" handle="ExampleTransactionRequest" version="1.0.0" service="WFS">
   <wfs:Insert handle="ObservationInsertTransaction">
   
      <snet:Observation xmlns:snet="http://www.sensornet.gov/snet" xmlns:gml="http://www.opengis.net/gml">
         <gml:description>FarWest 2070 Gamma Radiation Detector Measurement Data</gml:description>
         <snet:Location>
            <gml:Point>
               <gml:coordinates>2.2,1.1</gml:coordinates>
            </gml:Point>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-03T18:12:40Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:FunctionalLabel>data.rad.farwest</snet:FunctionalLabel>
         <snet:AssociationId>NDC.ORNL.1-100010495</snet:AssociationId>
         <snet:OwnerLabel>ORNL</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:Data>
            <SensorData id="334865" gid="NTG-02" time="2005-03-03T18:11:01Z">
               <DoseAvg unit="mRAD/hr">3</DoseAvg>
               <Dose unit="mRAD/hr">47</Dose>
            </SensorData>
         </snet:Data>
         <snet:ObservationDescription>Observation from Farwest</snet:ObservationDescription>
      </snet:Observation>
      
   </wfs:Insert>
</wfs:Transaction>


<wfs:TransactionResponse xmlns:wfs="http://www.opengis.net/wfs">
   <wfs:InsertResult handle="ObservationInsertTransaction">
      <ogc:FeatureId fid="NDC.ORNL.1-100010496" xmlns:ogc="http://www.opengis.net/ogc" />
   </wfs:InsertResult>
   <wfs:TransactionResult>
      <wfs:SUCCESS />
   </wfs:TransactionResult>
</wfs:TransactionResponse>   
   

Insert event and alert data

Events and alerts are inserted as snet:Event and snet:Alert features respectively. The feature ID of either the node, sensor, or data (as appropriate) causing the event is used as the association ID of the event.

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" handle="ExampleTransactionRequest" version="1.0.0" service="WFS">
   <wfs:Insert handle="ObservationInsertTransaction">
   
      <snet:Alert xmlns:snet="http://www.sensornet.gov/snet" xmlns:gml="http://www.opengis.net/gml">
         <gml:description>FarWest 2070 Gamma Radiation Detector Data Event</gml:description>
         <snet:Location>
            <gml:Point>
               <gml:coordinates>2.2,1.1</gml:coordinates>
            </gml:Point>
         </snet:Location>
         <snet:Datetime>
            <gml:TimeInstant>
               <gml:timePosition>2005-03-04T20:54:06Z</gml:timePosition>
            </gml:TimeInstant>
         </snet:Datetime>
         <snet:FunctionalLabel>event.data.farwest</snet:FunctionalLabel>
         <snet:AssociationId>NDC.ORNL.1-100010496</snet:AssociationId>
         <snet:OwnerLabel>ORNL</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:Data />
         <snet:EventType>Alert</snet:EventType>
      </snet:Alert>
      
   </wfs:Insert>
</wfs:Transaction>


<wfs:TransactionResponse xmlns:wfs="http://www.opengis.net/wfs">
   <wfs:InsertResult handle="ObservationInsertTransaction">
      <ogc:FeatureId fid="NDC.ORNL.1-100010497" xmlns:ogc="http://www.opengis.net/ogc" />
   </wfs:InsertResult>
   <wfs:TransactionResult>
      <wfs:SUCCESS />
   </wfs:TransactionResult>
</wfs:TransactionResponse>   
   

Track mobile nodes and sensors

When a node or sensor moves, location update features are inserted as snet:LocationHistory features. The feature ID of either the associated node or sensor (as appropriate) is used as the association ID of the history record.

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" handle="ExampleTransactionRequest" version="1.0.0" service="WFS">
   <wfs:Insert handle="LocationHistoryInsertTransaction">
   
      <snet:LocationHistory xmlns:snet="http://www.sensornet.gov/snet" xmlns:gml="http://www.opengis.net/gml">
         <gml:description>Location update for node A</gml:description>
         <snet:Location>
            <gml:Point>
               <gml:coordinates>2.2,1.1</gml:coordinates>
            </gml:Point>
         </snet:Location>
         <snet:Datetime>
            <gml:TimePeriod>
               <gml:begin>
                  <gml:TimeInstant>
                     <gml:timePosition>2005-03-07T22:15:26Z</gml:timePosition>
                  </gml:TimeInstant>
               </gml:begin>
               <gml:end>
                  <gml:TimeInstant>
                     <gml:timePosition>2005-03-07T22:20:26Z</gml:timePosition>
                  </gml:TimeInstant>
               </gml:end>
            </gml:TimePeriod>
         </snet:Datetime>
         <snet:FunctionalLabel>history.location.datasource.node.acme.nodeA</snet:FunctionalLabel>
         <snet:AssociationId>NDC.ORNL.1-100010496lt;/snet:AssociationId>
         <snet:OwnerLabel>ORNL</snet:OwnerLabel>
         <snet:SensitivityLabel>OUO</snet:SensitivityLabel>
         <snet:Data />
      </snet:LocationHistory>
      
   </wfs:Insert>
</wfs:Transaction>


<wfs:TransactionResponse xmlns:wfs="http://www.opengis.net/wfs">
   <wfs:InsertResult handle="ObservationInsertTransaction">
      <ogc:FeatureId fid="NDC.ORNL.1-100010497" xmlns:ogc="http://www.opengis.net/ogc" />
   </wfs:InsertResult>
   <wfs:TransactionResult>
      <wfs:Status>
         <wfs:SUCCESS />
      </wfs:Status>
   </wfs:TransactionResult>
</wfs:TransactionResponse>   
   

4.2.2   wfs:Update

The WFS update transaction is used to update mutable properties of feature instances in the SensorNet WFS. The update transaction is most often used to update the snet:Location and snet:Datetime properties of mobile nodes and sensors.

4.2.3   wfs:Delete

The WFS delete transaction is used to delete feature instances in the SensorNet WFS. The delete functionality is still under development at this time.

4.3   wfs:GetFeature Requests

A WFS GetFeature request consistes of a wfs:GetFeature element containing one or more wfs:Query elements. The get feature element can specify a maximum number of results to return using the maxFeatures attribute. Each query element specifies a feature type, an optional handle, and and ogc:Filter element.

   <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" handle="ExampleGetFeatureRequest" outputFormat="GML3" version="1.0.0" service="WFS" maxFeatures="100">
      <wfs:Query typeName="snet:Feature" handle="ExampleQuery">
         <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <!-- any filter -->
         </ogc:Filter>
      </wfs:Query>
   </wfs:GetFeature>

The response to a GetFeature request is a feature collection with matching features.

   <gml:FeatureCollection xmlns:gml="http://www.opengis.net/gml">
      <gml:boundingBox>
         <gml:Box>
            <gml:coordinates>19.5,74.5 20.5,75.5</gml:coordinates>
         </gml:Box>
      </gml:boundingBox>
      <gml:featureMember>
         <snet:Feature>
            <!-- Any SensorNet feature -->
         </snet:Feature>
      </gml:featureMember>
      <gml:featureMember>
         ...
      </gml:featureMember>
      ...
   </gml:FeatureCollection>

Appendix A - SensorNet Application Schema

Appendix B - Example Requests

B.1   Example GetFeature request to get all Sensor records.

   <wfs:GetFeature 
      xmlns:wfs="http://www.opengis.net/wfs" 
      xmlns:snet="http://www.sensornet.gov/snet" 
      handle="ExampleGetFeatureRequest" 
      outputFormat="GML3" version="1.0.0" service="WFS" maxFeatures="100">

      <wfs:Query typeName="snet:Sensor" handle="ExampleSensorQuery"></wfs:Query>

   </wfs:GetFeature>

B.2   Example GetFeature request to get observations records from a specific sensor for a specific time range.

   <wfs:GetFeature 
      xmlns:wfs="http://www.opengis.net/wfs"  
      xmlns:snet="http://www.sensornet.gov/snet" 
      xmlns:gml="http://www.opengis.net/gml" 
      handle="ExampleGetFeatureRequest" 
      outputFormat="GML3" version="1.0.0" service="WFS" maxFeatures="100">

      <wfs:Query typeName="snet:Observation" handle="ExampleObservationQuery">
         <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:And xmlns:ogc="http://www.opengis.net/ogc">
               <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>snet:AssociationId</ogc:PropertyName>
                  <ogc:Literal>SENSOR-001</ogc:Literal>
               </ogc:PropertyIsEqualTo>
               <ogc:PropertyIsBetween>
                  <ogc:PropertyName>snet:Datetime/gml:TimeInstant/gml:timePosition</ogc:PropertyName>
                  <ogc:LowerBoundary>
                     <ogc:Literal>2002-07-01T12:00:00</ogc:Literal>
                  </ogc:LowerBoundary>
                  <ogc:UpperBoundary>
                     <ogc:Literal>2002-07-01T12:40:00</ogc:Literal>
                  </ogc:UpperBoundary>
               </ogc:PropertyIsBetween>
            </ogc:And>
         </ogc:Filter>
      </wfs:Query>

   </wfs:GetFeature>

Footnotes


1  "W3C Date and Time Formats", 15 Sep 1997, http://www.w3.org/TR/NOTE-datetime