publishing consuming linked sensor data meetup cuenca
DESCRIPTION
TRANSCRIPT
Date: 01/12/2011
Publishing and Consuming Linked Sensor
Data
Jean-Paul Calbimonte
Ontology Engineering Group. Facultad de Informática, Universidad Politécnica de Madrid.
1st Latin American Linked Data MeetupCuenca, Ecuador
2
Linked Sensor Data 101
Linked Sensor Data
Motivation
Ingredients
Generate
Consume
Motivation
From Sensor Networks…
… to the Sensor Web/ Internet of Things…
… to Semantic Sensor Web and …
Linked Sensor Data
3
Sensors
4
http://www.flickr.com/photos/wouterh/2409251427/
• Cheaper• Ubiquitous• Robust• Routing
• Noisy• Processing• Memory• Energy(Limited)
(t9, a1, a2, ... , an)(t8, a1, a2, ... , an)(t7, a1, a2, ... , an)......(t1, a1, a2, ... , an)......
Streaming Data
Background – Querying Relational Data Streams
5
Streaming DataSTREAMAurora/BorealisCougarTinyDBSNEE
e1
e2e1
e2 e3
e2e1 e3
e1
e4
t t+1 t+2 t+3 t+4 t+5
WINDOW [tnow-2 TO tnow] SLIDE 1
Transform infinite sequence of tuples to bounded bag
...
CQLSNEEqlTinyQL
Query engines
Query languages
SELECT attribute FROM stream [NOW -10 MIN]
Sensor Networks
Source: Antonis Deligiannakis
An example: SmartCities
7 SmartSantander Project
Environmental sensors
Parking sensors
Who are the end users of Sensor Networks?
Source: Dave de Roure
The climate change expert, or a simple citizen
Not only environmental, but many others…
9
Weather Sensors
Camera SensorsSatellite Sensors
GPS Sensors
Sensor Dataset
Source: H Patni, C Henson, A Sheth
10
The Sensor Web
Universal, web-based access to sensor data
Source: Adapted from Alan Smeaton’s invited talk at ESWC2009
Make sensors more accessible?
11Source: SemsorGrid4Env consortium
Should we care as computer scientists?
“Grand Challenge” CS issues:• Heterogeneity• Scale• Scalability• Autonomic behaviour• Persistence, evolution• Deployment challenges• Mobility
Source: Dave de Roure
Anything left for Semantic Web research?
Data from the Web
13Sensors, Mappings and Queries
Emergency planner
Flood risk alert: South East
England
forecastswave data Environmental
defenses
I have to make sense out of all this
data
Semantic Sensor Web / Linked Sensor Data (LSD)
A representation of sensor data following the standards of Linked Data
But what is Linked Data?
What is Linked Data?
15
An extension of the current Web…
data are given well defined and explicitly represented meaning
So that it can be shared and used By humans and machines
And clear principles on how to publish data
16
The four principles (Tim Berners Lee, 2006)
http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html
Use URIs as names of thingsUse HTTP URIsProvide useful information when URI is dereferencedLink to other URIs
Linked Open Data
17
http://richard.cyganiak.de/2007/10/lod/
2011
Semantic Sensor Web / Linked Sensor Data (LSD)
• Early references…• Sheth A, Henson C, and Sahoo S, Semantic Sensor Web, IEEE
Internet Computing, 2008.• Sequeda J, Corcho O. Linked Stream Data: A Position Paper.
Proceedings of the 2nd International Workshop on Semantic Sensor Networks, 2009.
• Le-Phuoc D, Parreira JX, Hauswirth M. Challenges in Linked Stream Data Processing: A Position Paper. Proceedings of the 3rd International Workshop on Semantic Sensor Networks, 2010.
A representation of sensor data following the standards of Linked Data
Let’s check some examples
• Meteorological data in Spain: automatic weather stations• http://aemet.linkeddata.es/
• Live sensors in Slovenia• http://sensors.ijs.si/
• Channel Coastal Observatory in Southern UK• http://webgis1.geodata.soton.ac.uk/flood.html
• And some more from DERI Galway, Knoesis, CSIRO, etc.
19
AEMET Linked Data
20
Observations
Sensors
JSI Sensors
21
Coastal Channel Observatory and other sources
22
• Work with Flood environmental sensor data.• SemSorGrid4Env project www.semsorgrid4env.eu.
Wave Height
Tidal Observations
Wind Speed
Motivation
23Enabling Ontology-based Access to Streaming Data Sources
Emergency planner
Flood risk alert: South East
England
...
...
...
Real-time data
Meteorological forecasts
Flood defences data
Other sources
• Detect conditions likely to cause a flood• Present data model in terms of the user domain: e.g. Flood risk
assessment
Example:• “provide me with the wind speed observations average over the last
minute in the Solent region, if it is higher than the average of the last 2 to 3 hours”
Wave,Wind,Tide
On
tolo
gy
SPARQL
RDDF RDF
RDF
RDF
Ingredients for Linked Sensor Data
Core ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
http://www.flickr.com/photos/santos/2252824606/
Sensor Metadata
25Sensors, Mappings and Queries
station
location
model
sensors
properties
Sensor Metadata
• What properties are measured
• Which sensors available
• Where are they located
• How are they configured
• Who is responsible
26Sensors, Mappings and Queries
Sensor Data: Observations
27Sensors, Mappings and Queries
Heterogeneity
Integration
Since aprox. 2005: Several proposalsProject specificReuse?Alignment?Best practices?
2009-2011: W3C SSN-XG incubator groupSSN Ontology: http://purl.oclc.org/NET/ssnx/ssn
Sensor Network Ontologies
Skeleton
Device
Deployment
PlatformSite
System
Process
ConstraintBlockMeasuringCapability
OperatingRestriction
Data
SSN ontology modules
Skeleton
Device
Deployment
PlatformSite
System
System
onPlatform only
hasSubsystem only, someSurvivalRang
e
hasSurvivalRange only
OperatingRangehasOperatingRange only
hasDeployment only
DeploymentRelatedProcess
Deployment
deploymentProcesPart only
deployedSystem only
Platform
deployedOnPlatform only
attachedSystem only
Device
Sensor
SensingDevice
Sensing
implements some
observes only
hasMeasurementCapability only
inDeployment only
SensorInput
detects only
isProxyFor onlyObservationValu
e
SensorOutput
hasValue some
isProducedBy some
Process
Process
hasInput only
hasOutput only, some
Input
Output
Observation
observedBy only
featureOfInterest only
observationResult only
Property
observedProperty onlyhasProperty only, some
isPropertyOf some
sensingMethodUsed only
includesEvent some
FeatureOfInterest
ConstraintBlock
Condition
inCondition only
MeasuringCapability
MeasurementCapability
forProperty only
OperatingRestriction
inCondition only
Data
Overview of the SSN ontologies
CommunicationMeasuringCapability
MeasurementCapability
MeasurementProperty
hasMeasurementProperty only
Accuracy
DetectionLimit
Drift
Frequency
MeasurementRange
Precision
Resolution
ResponseTime
Selectivity
Sensitivity
Latency
Skeleton
EnergyRestrictionOperatingRestriction
OperatingRange
OperatingProperty
hasOperatingProperty only
EnvironmentalOperatingProperty
MaintenanceSchedule
SurvivalRange
SurvivalProperty
hasSurvivalProperty only
EnvironmentalSurvivalProperty
SystemLifetime
BatteryLifetime
OperatingPowerRange
Property
SSN Ontology: Measurement Capabilities
Core ontological model
A model to bind them all
• W3C SSN Ontology
32
ssn:FeatureOfInterest
ssn:Observation
ssn:isProducedByssn:SensorOutput
ssn:Sensor
ssn:featureOfInterest
ssn:ObservationValue
ssn:Property
ssn:observedByssn:observationResult ssn:hasValue
ssn:hasProperty
ssn:observedProperty
ssn:observes
xsd:datatype
quantityValue
Example
swissex:Sensor1 rdf:type ssn:Sensor; ssn:onPlatform swissex:Station1; ssn:observes [rdf:type sweetSpeed:WindSpeed].
swissex:Sensor2 rdf:type ssn:Sensor; ssn:onPlatform swissex:Station1; ssn:observes [rdf:type sweetTemp:Temperature].
swissex:Station1 :hasGeometry [ rdf:type wgs84:Point;
wgs84:lat "46.8037166"; wgs84:long "9.7780305"].
33
station
senso
r1
senso
r2
Example
swissex:WindSpeedObservation1 rdf:type ssn:Observation; ssn:featureOfInterest [rdf:type sweetAtmoWind:Wind]; ssn:observedProperty [rdf:type sweetSpeed:WindSpeed]; ssn:observationResult [rdf:type ssn:SensorOutput; ssn:hasValue [qudt:numericValue "6.245"^^xsd:double]]; ssn:observationResultTime [time:inXSDDatatime "2011-10-26T21:32:52"]; ssn:observedBy swissex:Sensor1 ;
34
WindSpeed : 6.245
At: 2011-10-26T21:32:52
Usage: SSN & Domain Ontologies
SWEET
Service
Coastal Defences
Ordnance Survey
Additional Regions
Role
DOLCE UltraLite
Schema
FOAF
Upper
External
SSG4Env infrastructure
Flood domain
35
SSN
AEMET Ontology Network
• 83 classes• 102 object properties• 80 datatype properties• 19 instances
Additional domain ontologies
Examples: AWS, qu, Sweet
• http://www.w3.org/2005/Incubator/ssn/ssnx/meteo/aws
• http://www.w3.org/2005/Incubator/ssn/ssnx/qu/qu
• http://sweet.jpl.nasa.gov/
37
Observed Properties
Features of Interest
Types of Sensors
Units of Measurement
Time
Ingredients for Linked Sensor Data
Core ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
http://www.flickr.com/photos/santos/2252824606/
Good practices in URI Definition
Sorry, no clear practices yet…
Good practices in URI Definition
• URIs for:• Observations• Sensors• Features of interest• Properties• Time periods
• Debate: observation or sensor-centric?• Observation-centric seems to be the winner• Sensor-centric, check [Sequeda and Corcho, 2009]
• Example:
http://aemet.linkeddata.es/resource/Observation/at_1316382600000_of_08130_on_VV10m
when sensor property
Ingredients for Linked Sensor Data
Core ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
http://www.flickr.com/photos/santos/2252824606/
Sensor High-level API
Source: K. Page & Southampton’s team at SemsorGrid4Env
Sensor High-level API
Source: K. Page & Southampton’s team at SemsorGrid4Env
Ingredients for Linked Sensor Data
Core ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
http://www.flickr.com/photos/santos/2252824606/
45
Swiss-Experiment
• FP7 Network of Excellence
GeoResearcher
Environmental and GeoScience researchSwiss Alps
...
...
...
Real-time data
Snow,Wind,Radiation.Lots of stuff
• How much snow is lost to evaporation?
• Snow redistribution by wind• Wind erosion of sand• ...
I want data to create my
models and compare
Where is the Data?
46
GSN
GSN server instance
wan7
timed: datetime PKsp_wind: float
..sensor1sensor2sensor3…
Virtual
senso
rs
timed sp_wind
1 3.4
2 5.6
3 11.2
4 1.2
5 3.1
.. …
Queries
SELECT sp_wind FROM wan7 WHERE sp_wind >10
SELECT sp_wind FROM wan7 [NOW -5 HOUR] WHERE sp_wind >10I want SPARQL!
Where is the Data?
47
GSN
GSN server instance
wan7
timed: datetime PKsp_wind: float
..sensor1sensor2sensor3…
Virtual
senso
rs
ssn:Observation
Mappings
Creating Mappings
48
wan7
timed: datetime PKsp_wind: float
ssn:ObservationValue
qudt:numericValue
xsd:decimal
http://swissex.ch/data#Wan7/WindSpeed/ObsValue{timed}
sp_wind
ssn:SensorOutput
ssn:Observation
ssn:hasValue
ssn:observationResulthttp://swissex.ch/data#
Wan7/WindSpeed/Observation{timed}
http://swissex.ch/data#Wan7/ WindSpeed/ ObsOutput{timed}
ssn:Property
ssn:observedProperty
sweetSpeed:WindSpeed
R2RML
• RDB2RDF W3C Group, R2RML Mapping language:• http://www.w3.org/2001/sw/rdb2rdf/r2rml/
49
:Wan4WindSpeed a rr:TriplesMapClass; rr:tableName "wan7"; rr:subjectMap [ rr:template "http://swissex.ch/ns#WindSpeed/Wan7/{timed}"; rr:class ssn:ObservationValue; rr:graph ssg:swissexsnow.srdf ]; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate ssn:hasQuantityValue ]; rr:objectMap[ rr:column "sp_wind" ] ]; .
<http://swissex.ch/ns#/WindSpeed/Wan7/2011-05-20:20:00 > a ssn:ObservationValue<http://swissex.ch/ns#/WindSpeed/Wan7/2011-05-20:20:00 > ssn:hasQuantityValue " 4.5"
Queries to Sensor Data
C-SPARQLREGISTER QUERY WindSpeedAndDirection ASPREFIX fire:
<http://www.semsorgrid4env.eu/ontologies/fireDetection#>SELECT ?sensor ?speed ?directionFROM STREAM <http://…/SensorReadings.rdf> [RANGE 1 MSEC
SLIDE 1 MSEC]WHERE { … 50
SNEEqlRSTREAM SELECT id, speed, direction FROM wind [NOW];
Streaming SPARQLPREFIX fire: <http://www.semsorgrid4env.eu/ontologies/fireDetection#>SELECT ?WindSpeedFROM STREAM <http://…/SensorReadings.rdf> WINDOW RANGE 1 MS SLIDE 1 MSWHERE { ?sensor fire:hasMeasurements ?WindSpeed FILTER (?WindSpeed<30)}
SPARQL-Stream
Query translation
SELECT ?waveheightFROM STREAM <www.ssg4env.eu/SensorReadings.srdf> [NOW – 5 HOUR TO NOW]WHERE { ?WaveObs a ssn:ObservationValue; qudt:numericalValue ?waveheight; FILTER (?waveheight>10) }
SELECT sp_wind FROM wan7 [NOW -5 HOUR] WHERE sp_wind >10
Data Access
• GSN Web Services• GSN URL API
• Compose the query as a URL:
52
http://montblanc.slf.ch :22001/ multidata ?vs [0]= wan7 &field [0]= sp_wind &from =15/05/2011+05:00:00& to =15/05/2011+10:00:00&c_vs [0]= wan7 & c_field [0]= sp_wind & c_min [0]=10
SELECT sp_wind FROM wan7 [NOW -5 HOUR] WHERE sp_wind >10 ?
Algebra expressions
53
timed,sp_wind
π
ω
σ sp_wind>10
5 Hour
wan7
http://montblanc.slf.ch :22001/ multidata ?vs [0]= wan7 &field [0]= sp_wind &from =15/05/2011+05:00:00& to =15/05/2011+10:00:00&c_vs [0]= wan7 & c_field [0]= sp_wind & c_min [0]=10
SELECT sp_wind FROM wan7 [NOW -5 HOUR] WHERE sp_wind >10
Using the Mappings
54
SELECT ?waveheightFROM STREAM <www.ssg4env.eu/SensorReadings.srdf> [NOW – 5 HOUR TO NOW]WHERE { ?WaveObs a ssn:ObservationValue; qudt:numericalValue ?waveheight; FILTER (?waveheight>10) }
wan7
timed: datetime PKsp_wind: float
xsd:datatype
ssn:ObservationValue
qudt:numericalValue
sp_wind
http://swissex.ch/data#Wan7/WindSpeed/ObsValue{timed}
timed,sp_wind
π
ω
σsp_wind>10
5 Hour
wan7
Algebra construction
55Sensors, Mappings and Queries
timed,sp_wind
π
ω
σ sp_wind>10
5 Hour
wan7
windsensor1
windsensor2
Static optimization
56Sensors, Mappings and Queries
timed,sp_wind
π
ω
σ sp_wind>10
5 Hour
wan7
timed,windvalue
π
ω
σ windvalue>10
5 Hour
windsensor1
timed,windvalue
π
ω
σ windvalue>10
5 Hour
windsensor2
57
Querying the ObservationsSELECT ?waveheightFROM STREAM <www.ssg4env.eu/SensorReadings.srdf> [NOW -10 MINUTES TO NOW STEP 1 MINUTE]WHERE { ?WaveObs a sea:WaveHeightObservation; sea:hasValue ?waveheight; }
Query translation
Query ProcessingC
lient
Mappings
SPARQLStream
[tuples]
Sensor Network
Data translation[triples]
GSN API
R2RML Mappings
http://montblanc.slf.ch :22001/ multidata ?vs [0]= wan7 &field [0]= sp_wind
Query processing engines
Lessons Learned
• High-level• Sensor data is yet another good source of data with
some special properties• Everything that we do with our relational datasets or
other data sources can be done with sensor data• Practical lessons learned
• Manage separately data and metadata of the sensors• Data should always be separated between realtime-
data and historical-data• Use the time format xsd:dateTime and the time zone• Graphical representation of data for weeks or months
is not trivial anyway
Conclusions
Ingredients for Linked Sensor DataCore ontology
Domain ontologiesGuidelines for identifiersAPIs
Query processing engines
Work in progress & examples
Challenges: generate & consume LSD
Thanks!
Questions, please.
60
Acknowledgments: all those identified in slides, especially those working in LSD at OEG: Oscar Corcho, Raúl García-Castro, Freddy Priyatna + the SemsorGrid4Env team (Alasdair Gray, Kevin Page, etc.), the AEMET team at OEG-UPM (Ghislain Atemezing, Daniel Garijo, José Mora, María Poveda, Daniel Vila, Boris Villazón) + Pablo Rozas (AEMET)