SensorML 2.0 Examples
Simple Streaming - latest value
SensorML supports the ability to describe the components and encoding of real-time data streams, and to provide a link to the data stream itself. This thus allows one to connect directly to a real-time data stream directly from a SensorML description and use a generic SWE Common Data reader to parse the data stream. SWE Common, which is used throughout SensorML, allows for very efficient binary or ASCII-based data streams. Describing a data stream into or out of a process (or sensor/actuator) is accomplished by having the input or output be of type DataInterface. The DataInterface element allows one to describe the DataStream, as well as provides for an optional interface description.
The example below describes a sensor with a simple data stream consisting of time (in ISO-8601 encoding) and temperature. The data is described in the DataStream element. The optional interface description is not required and thus omitted. The data themselves can be accessed through the URL provided by the xlink:href attribute in the swe:values element. Accessing this URL would return either the latest value(s) or open up an html stream of real-time values. This approach allows for easy incorporation of SensorML into RESTFUL and Internet of Things (IoT) environments.