SSN Sensor

From Semantic Sensor Network Incubator Group
Revision as of 00:19, 15 June 2011 by Llefort (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Measuring



The class ssn:Sensor in the ontology provides the structure to represent a concrete sensing object. The ontology defines several properties for instances of the class ssn:Sensor:

  • ssn:observes: points to a property observed by a sensor (e.g., temperature, acceleration, wind speed). An object of this property must be an instance of the class ssn:Property.
  • ssn:hasMeasurementCapability: Points to the description of the sensor's measurement capability expressed as an instance of the class ssn:MeasurementCapability. The description of a measurement capability includes such parameters as frequency, accuracy, measurement range, etc.

The class ssn:Sensor can represent any object with the sensing capability (e.g., in some cases a human observer can be a sensor).

In most scenarios the sensors are implemented as devices. The ssn:Device is described in the Device module documentation.

A concept map showing the Sensor class and its properties

Figure 5.13 - ssn:Sensor

How to create a description of a sensor?

Measuring examples (OWL)



A description of a sensor is created by defining an instance of the class ssn:SensingDevice. For example, the following description represents a concrete sensor (accelerometer) attached to a kitchen tool (knife).

 <owl:Ontology rdf:about="http://purl.oclc.org/NET/ssnx/product/smart-knife">
 ...
 <ssn:SensingDevice rdf:about="#ExampleWiTilt30Accelerometer">
   <ssn:observes rdf:resource="http://purl.oclc.org/NET/muo/ucum/physical-quality/acceleration"/>
   <rdfs:comment>A specific instance of a WiTilt 3.0 accelerometer attached to a knife.</rdfs:comment>
   <ssn:hasMeasurementCapability rdf:resource="#ExampleWiTiltAccelerometerMeasurementCapability"/>
   <ssn:onPlatform rdf:resource="#Knife_123"/>
 </ssn:SensingDevice>
 

Note that the SSN ontology does not contain a vocabulary of possible properties which can be measured by sensors. Specific instances of the class ssn:Property have to be created by the user or (preferably) imported from an existing ontology. For example, such ontologies as the MyMobileWeb Measurement Units Ontology (populated with instances), the QUDV ontology, the QUDT ontology, and others provide vocabularies of physical properties and corresponding units of measurement. In order to link an external ontology of measurement properties to the sensor ontology, it is possible to use class subsumption or equivalence links. For example, incorporating the physical properties from the MyMobileWeb ontology (represented by the class muo:PhysicalQuality) can be done in the following way:

 <owl:Ontology rdf:about="http://purl.oclc.org/NET/ssnx/product/smart-knife">
  <rdfs:comment> An example description of a hypothetical accelerometer sensor related to one of the
  SmartProducts use cases (cooking guidance).
  The ontology describes measurement capabilities of a class of accelerometer sensors (WiTilt v3.0 [1]), 
  and an example of such a sensor attached to a kitchen utensil (knife). 
  [1] http://www.sparkfun.com/datasheets/Accelerometers/WiTilt-v3.pdf </rdfs:comment>
  <owl:imports rdf:resource="http://purl.oclc.org/NET/muo/ucum/"/>
  <owl:imports rdf:resource="http://purl.oclc.org/NET/ssnx/ssn"/>
 </owl:Ontology>
 ...
 <owl:Class rdf:about="http://purl.oclc.org/NET/muo/muo#PhysicalQuality">
  <rdfs:subClassOf rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#Property"/>
 </owl:Class>
 

Note that an instance of the class ssn:SensingDevice represents one concrete physical object. It is possible that a use case deals with many sensors sharing common attributes: e.g., sensors measuring a specific property or sensing devices of the same model, which have the same measurement capabilities. In order to describe such groups of sensors with common properties, it is possible to define subclasses of the class ssn:Sensor with restricted property values. In the example below, the class Accelerometer is defined as a subclass of sensors which measure the acceleration property, and the class WiTilt30Accelerometer represents accelerometers of a specific model.

 <owl:Class rdf:about="#Accelerometer">
  <rdfs:subClassOf rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#SensingDevice"/>
  <rdfs:subClassOf>
   <owl:Restriction>
    <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#observes"/>
    <owl:hasValue rdf:resource="http://purl.oclc.org/NET/muo/ucum/physical-quality/acceleration"/>
   </owl:Restriction>
  </rdfs:subClassOf>
  <rdfs:comment>Accelerometer is a subclass of sensing devices which measures acceleration. 
  The individual describing a physical quality "acceleration" is defined in the imported MyMobileWeb 
  ontology of measurement units. To align the MyMobileWeb ontology with the SSN ontology, the class 
  muo:PhysicalQuality from the MyMobileWeb ontology is defined as a subclass of the class ssn:Property.</rdfs:comment>
 </owl:Class>
 ...
 <owl:Class rdf:about="#WiTilt30Accelerometer">
  <rdfs:subClassOf rdf:resource="#Accelerometer"/>
  <rdfs:subClassOf>
   <owl:Restriction>
    <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#hasMeasurementCapability"/>
    <owl:allValuesFrom rdf:resource="#WiTilt30AccelerationMeasurementCapability"/>
   </owl:Restriction>
  </rdfs:subClassOf>
  <rdfs:comment>This class describes WiTilt v3.0 accelerometers. 
  All possible configurations of their measurement capabilities are defined using the class
  WiTilt30AccelerationMeasurementCapability, so the property ssn:hasMeasurementCapability is 
  restricted to instances of this class.</rdfs:comment>
 </owl:Class>
 

Then, the description of our example accelerometer will look like:

 <owl:Thing rdf:about="#ExampleWiTilt30Accelerometer">
  <rdf:type rdf:resource="#WiTilt30Accelerometer"/> 
  <rdfs:comment>
A specific instance of a WiTilt 3.0 accelerometer attached to a knife.
 </rdfs:comment></nowiki>
 <ssn:hasMeasurementCapability rdf:resource="#ExampleWiTiltAccelerometerMeasurementCapability"/> 
 <ssn:onPlatform rdf:resource="#Knife_123"/> 
 </owl:Thing> 
</nowiki>

MeasuringCapability

MeasuringCapability module


The measurement capabilities of a sensor are collected using the class ssn:MeasurementCapability. Each instance of the class ssn:MeasurementCapability describes a set of measurement properties of a sensor in specific conditions. Possible measurement properties of a sensor are represented as subclasses of the class ssn:MeasurementProperty. Currently, the ontology defines the following types of measurement properties (follow links to definitions):

One instance of ssn:MeasurementCapability can describe a set of measurement properties linked by the property ssn:hasMeasurementProperty and connected to a property using ssn:forProperty (a sensor can observe a number of properties and this allows measurement capabilities to be defined for each property). The conditions, in which these measurement properties are valid, are specified using the property ssn:inCondition and expressed using an instance of the class ssn:Condition. The sensor ontology defines conditions as ssn:Property (i.e. observable conditions that affect the operation of the sensor) but as with all properties doesn't define any further structure: an imported domain vocabulary must be used for this purpose. A sensor can have different measurement capabilities depending on conditions. In this case, one instance of ssn:Sensor can have multiple values for the property ssn:hasMeasurementCapability.


A concept map showing the relationship between Sensor, MeasurementCapability, MeasurementProperty and Condition

Figure 5.14 - ssn:Sensor and ssn:MeasurementCapability

A concept map showing the relationship between MeasurementCapability and MeasurementProperty and the 11 sub-classes of MeasurementProperty

Figure 5.15 - ssn:MeasurementCapability and ssn:MeasurementProperty

How to describe capabilities of a sensor?

MeasuringCapability examples (OWL)



In order to describe measurement properties of one specific sensor, it is necessary to define one or several instances of the class ssn:MeasurementCapability and use the property ssn:hasMeasurementCapability to link the sensor with its measurement capabilities. For example, in case of an accelerometer sensor attached to a knife, this can be described in the following way:

 <owl:Ontology rdf:about="http://purl.oclc.org/NET/ssnx/product/smart-knife">
 ...
 <owl:Thing rdf:about="#ExampleWiTilt30Accelerometer">
   <rdf:type rdf:resource="#WiTilt30Accelerometer"/>
   <rdfs:comment>
   A specific instance of a WiTilt 3.0 accelerometer attached to a knife.
   </rdfs:comment>
   <ssn:hasMeasurementCapability rdf:resource="#ExampleWiTiltAccelerometerMeasurementCapability"/>
 ...
 </owl:Thing>
 

Please note that an instance of the class ssn:MeasurementCapability describes measurement properties of a specific physical sensor object. If it is necessary to describe measurement capabilities of a class of sensors, then it is necessary to define a restriction on the property ssn:hasMeasurementCapability for a particular subclass of ssn:Sensor which describes sensors of a specific type.

If all sensors of the same class have exactly the same measurement capabilities, then it is sufficient to define one instance of the class ssn:MeasurementCapability. Sometimes it is necessary to describe a range of possible measurement capabilities. In this case, one needs to define a subclass of the class ssn:MeasurementCapability where certain properties are restricted. For example, below is a superclass for all measurement capabilities of accelerometer sensors:

 <owl:Class rdf:about="#AccelerationMeasurementCapability">
   <rdfs:label>Acceleration measurement capability</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#MeasurementCapability"/>
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#forProperty"/>
       <owl:hasValue rdf:resource="http://purl.oclc.org/NET/muo/ucum/physical-quality/acceleration"/>
     </owl:Restriction>
   </rdfs:subClassOf>
   <rdfs:comment>This class describes measurement capabilities for accelerometer sensors. 
   The property ssn:forProperty is restricted to ucum:acceleration.</rdfs:comment>
 </owl:Class>
 

Now, in our example, we want to describe possible measurement capabilities of a specific type of accelerometer sensor devices (WiTilt 3.0). These sensors can be calibrated to measure acceleration in the ranges of +/-1.5g, +/-2g, +/-4g, and +/-6g. Moreover, they can operate in four modes with different output frequency: degree mode (50Hz), gravity mode (135Hz), raw ADC mode (220Hz), and binary mode (610Hz). To express possible measurement ranges, we define a subclass of the class ssn:MeasurementRange:

 <owl:Class rdf:about="#WiTilt30MeasurementRange">
   <rdfs:label>WiTilt 3.0 measurement range</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#MeasurementRange"/>
   <rdfs:comment>
   This class defines possible measurement ranges of a WiTilt 3.0 accelerometer sensor. 
   These sensors can be calibrated to measure acceleration in the ranges of +/-1.5g, +/-2g, +/-4g and +/-6g. 
   These four ranges are expressed using instances of this class: WiTilt30MeasurementRange_1...WiTilt30MeasurementRange_4. 
   Because the SSN ontology does not specify how the values of measurement properties should be expressed, 
   three properties are introduced: hasMeasurementPropertyValue (for exact values), hasMeasurementPropertyMaxValue 
   (for maximal values), and hasMeasurementPropertyMinValue (for minimal values).
   </rdfs:comment>
 </owl:Class>
 

Then, we define four instances of this class corresponding to each measurement range:

 <owl:Thing rdf:about="#WiTilt30MeasurementRange_1">
   <rdf:type rdf:resource="#WiTilt30MeasurementRange"/>
   <hasMeasurementPropertyMaxValue rdf:resource="#WiTilt30MeasurementRange_1MaxValue"/>
   <hasMeasurementPropertyMinValue rdf:resource="#WiTilt30MeasurementRange_1MinValue"/>
 </owl:Thing>
 ...
 <owl:Thing rdf:about="#WiTilt30MeasurementRange_1MaxValue">
   <rdf:type rdf:resource="#AccelerationValue"/>
   <hasQuantityValue rdf:datatype="&xsd;float">1.5</hasQuantityValue>
 </owl:Thing>
 ...
 <owl:Thing rdf:about="#WiTilt30MeasurementRange_1MinValue">
   <rdf:type rdf:resource="#AccelerationValue"/>
   <hasQuantityValue rdf:datatype="&xsd;float">-1.5</hasQuantityValue>
 </owl:Thing>
 

Note that the sensor ontology does not restrict the way in which specific measurement properties are described. In our example, we defined our own RDF properties to define values of measurement properties (hasMeasurementPropertyMinValue, hasMeasurementPropertyValue, hasMeasurementPropertyValue) and defined a subclass AccelerationValue of the class ObservationValue. For this class, we defined properties hasQuantityValue and hasQuantityUnitOfMeasurement and restricted the property hasQuantityUnitOfMeasurement:

 <owl:Class rdf:about="#AccelerationValue">
   <rdfs:label>Acceleration value</rdfs:label>
   ...
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="#hasQuantityUnitOfMeasurement"/>
       <owl:hasValue rdf:resource="http://purl.oclc.org/NET/muo/ucum/unit/acceleration/standard-acceleration-of-free-fall"/>
     </owl:Restriction>
   </rdfs:subClassOf>
   <rdfs:comment>Acceleration value measured in g - standard acceleration of free fall.</rdfs:comment>
 </owl:Class>
 

In the same way, we define possible output frequency values:

 <owl:Class rdf:about="#WiTilt30MeasurementFrequency">
   <rdfs:label>WiTilt 3.0 measurement frequency</rdfs:label>
   <rdfs:subClassOf rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#Frequency"/>
   <rdfs:comment>This class describes maximal output frequency values of WiTilt 3.0 accelerometers in four modes: 
         degree mode (50Hz), gravity mode (135Hz), raw ADC mode (220Hz), and binary mode (610Hz). 
   </rdfs:comment>
 </owl:Class>
 ...
 <WiTilt30MeasurementFrequency rdf:about="#WiTilt30BinaryModeFrequency">
   <hasMeasurementPropertyValue rdf:resource="#WiTilt30BinaryModeFrequencyValue"/>
 </WiTilt30MeasurementFrequency>
 ...
 <owl:Thing rdf:about="#WiTilt30BinaryModeFrequencyValue">
   <rdf:type rdf:resource="#FrequencyValue"/>
   <hasQuantityValue rdf:datatype="&xsd;float">610</hasQuantityValue>
 </owl:Thing>
 ...
 <owl:Class rdf:about="#FrequencyValue">
   <rdfs:label>Frequency value</rdfs:label>
   ...
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="#hasQuantityUnitOfMeasurement"/>
       <owl:hasValue rdf:resource="http://purl.oclc.org/NET/muo/ucum/unit/frequency/Herz"/>
     </owl:Restriction>
   </rdfs:subClassOf>
   <rdfs:comment>Frequency value measured in Hz.</rdfs:comment>
 </owl:Class>
 


Now, if we want to describe all acceptable measurement capabilities of WiTilt 3.0 accelerometers, we can define the following subclass of ssn:MeasurementCapability:

 <owl:Class rdf:about="#WiTilt30AccelerationMeasurementCapability">
   <rdfs:label>WiTilt 3.0 acceleration measurement capability</rdfs:label>
   <rdfs:subClassOf rdf:resource="#AccelerationMeasurementCapability"/>
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#hasMeasurementProperty"/>
       <owl:onClass rdf:resource="#WiTilt30MeasurementRange"/>
       <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
     </owl:Restriction>
   </rdfs:subClassOf>
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#hasMeasurementProperty"/>
       <owl:onClass rdf:resource="#WiTilt30MeasurementFrequency"/>
       <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
     </owl:Restriction>
   </rdfs:subClassOf>
 </owl:Class>
 

In this description, measurement capabilities are characterised by two parameters: measurement range and frequency. Possible values of these parameters are described by classes WiTilt30MeasurementRange and WiTilt30MeasurementFrequency respectively. A specific instance of a WiTilt 3.0 sensor must have exactly one value for each of these parameters. In other words, its property ssn:hasMeasurementCapability can only take values from the class WiTilt30AccelerationMeasurementCapability defined above.

 <owl:Class rdf:about="#WiTilt30Accelerometer">
   <rdfs:subClassOf rdf:resource="#Accelerometer"/>
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#hasMeasurementCapability"/>
       <owl:allValuesFrom rdf:resource="#WiTilt30AccelerationMeasurementCapability"/>
     </owl:Restriction>
   </rdfs:subClassOf>
 </owl:Class>
 

Now, we assume that our example sensor attached to a knife operates in the binary output mode and has its measurement range set to +/-1.5g. As shown above, its measurement capabilities are described using the instance ExampleWiTiltAccelerometerMeasurementCapability. This instance is defined in the following way:

 <owl:Thing rdf:about="#ExampleWiTiltAccelerometerMeasurementCapability">
   <rdf:type rdf:resource="#WiTilt30AccelerationMeasurementCapability"/>
   <ssn:hasMeasurementProperty rdf:resource="#WiTilt30BinaryModeFrequency"/>     
   <ssn:hasMeasurementProperty rdf:resource="#WiTilt30MeasurementRange_1"/>
 </owl:Thing>