publishing consuming linked sensor data meetup cuenca

60
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. [email protected] 1 st Latin American Linked Data Meetup Cuenca, Ecuador

Upload: jean-paul-calbimonte

Post on 20-Jan-2015

124 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Publishing consuming Linked Sensor Data meetup Cuenca

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.

[email protected]

1st Latin American Linked Data MeetupCuenca, Ecuador

Page 2: Publishing consuming Linked Sensor Data meetup Cuenca

2

Linked Sensor Data 101

Linked Sensor Data

Motivation

Ingredients

Generate

Consume

Page 3: Publishing consuming Linked Sensor Data meetup Cuenca

Motivation

From Sensor Networks…

… to the Sensor Web/ Internet of Things…

… to Semantic Sensor Web and …

Linked Sensor Data

3

Page 4: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 5: Publishing consuming Linked Sensor Data meetup Cuenca

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]

Page 6: Publishing consuming Linked Sensor Data meetup Cuenca

Sensor Networks

Source: Antonis Deligiannakis

Page 7: Publishing consuming Linked Sensor Data meetup Cuenca

An example: SmartCities

7 SmartSantander Project

Environmental sensors

Parking sensors

Page 8: Publishing consuming Linked Sensor Data meetup Cuenca

Who are the end users of Sensor Networks?

Source: Dave de Roure

The climate change expert, or a simple citizen

Page 9: Publishing consuming Linked Sensor Data meetup Cuenca

Not only environmental, but many others…

9

Weather Sensors

Camera SensorsSatellite Sensors

GPS Sensors

Sensor Dataset

Source: H Patni, C Henson, A Sheth

Page 10: Publishing consuming Linked Sensor Data meetup Cuenca

10

The Sensor Web

Universal, web-based access to sensor data

Source: Adapted from Alan Smeaton’s invited talk at ESWC2009

Page 11: Publishing consuming Linked Sensor Data meetup Cuenca

Make sensors more accessible?

11Source: SemsorGrid4Env consortium

Page 12: Publishing consuming Linked Sensor Data meetup Cuenca

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?

Page 13: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 14: Publishing consuming Linked Sensor Data meetup Cuenca

Semantic Sensor Web / Linked Sensor Data (LSD)

A representation of sensor data following the standards of Linked Data

But what is Linked Data?

Page 15: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 16: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 17: Publishing consuming Linked Sensor Data meetup Cuenca

Linked Open Data

17

http://richard.cyganiak.de/2007/10/lod/

2011

Page 18: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 19: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 20: Publishing consuming Linked Sensor Data meetup Cuenca

AEMET Linked Data

20

Observations

Sensors

Page 21: Publishing consuming Linked Sensor Data meetup Cuenca

JSI Sensors

21

Page 22: Publishing consuming Linked Sensor Data meetup Cuenca

Coastal Channel Observatory and other sources

22

• Work with Flood environmental sensor data.• SemSorGrid4Env project www.semsorgrid4env.eu.

Wave Height

Tidal Observations

Wind Speed

Page 23: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 24: Publishing consuming Linked Sensor Data meetup Cuenca

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/

Page 25: Publishing consuming Linked Sensor Data meetup Cuenca

Sensor Metadata

25Sensors, Mappings and Queries

station

location

model

sensors

properties

Page 26: Publishing consuming Linked Sensor Data meetup Cuenca

Sensor Metadata

• What properties are measured

• Which sensors available

• Where are they located

• How are they configured

• Who is responsible

26Sensors, Mappings and Queries

Page 27: Publishing consuming Linked Sensor Data meetup Cuenca

Sensor Data: Observations

27Sensors, Mappings and Queries

Heterogeneity

Integration

Page 28: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 29: Publishing consuming Linked Sensor Data meetup Cuenca

Skeleton

Device

Deployment

PlatformSite

System

Process

ConstraintBlockMeasuringCapability

OperatingRestriction

Data

SSN ontology modules

Page 30: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 31: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 32: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 33: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 34: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 35: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 36: Publishing consuming Linked Sensor Data meetup Cuenca

AEMET Ontology Network

• 83 classes• 102 object properties• 80 datatype properties• 19 instances

Additional domain ontologies

Page 37: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 38: Publishing consuming Linked Sensor Data meetup Cuenca

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/

Page 39: Publishing consuming Linked Sensor Data meetup Cuenca

Good practices in URI Definition

Sorry, no clear practices yet…

Page 40: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 41: Publishing consuming Linked Sensor Data meetup Cuenca

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/

Page 42: Publishing consuming Linked Sensor Data meetup Cuenca

Sensor High-level API

Source: K. Page & Southampton’s team at SemsorGrid4Env

Page 43: Publishing consuming Linked Sensor Data meetup Cuenca

Sensor High-level API

Source: K. Page & Southampton’s team at SemsorGrid4Env

Page 44: Publishing consuming Linked Sensor Data meetup Cuenca

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/

Page 45: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 46: Publishing consuming Linked Sensor Data meetup Cuenca

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!

Page 47: Publishing consuming Linked Sensor Data meetup Cuenca

Where is the Data?

47

GSN

GSN server instance

wan7

timed: datetime PKsp_wind: float

..sensor1sensor2sensor3…

Virtual

senso

rs

ssn:Observation

Mappings

Page 48: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 49: Publishing consuming Linked Sensor Data meetup Cuenca

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"

Page 50: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 51: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 52: Publishing consuming Linked Sensor Data meetup Cuenca

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 ?

Page 53: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 54: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 55: Publishing consuming Linked Sensor Data meetup Cuenca

Algebra construction

55Sensors, Mappings and Queries

timed,sp_wind

π

ω

σ sp_wind>10

5 Hour

wan7

windsensor1

windsensor2

Page 56: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 57: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 58: Publishing consuming Linked Sensor Data meetup Cuenca

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

Page 59: Publishing consuming Linked Sensor Data meetup Cuenca

Conclusions

Ingredients for Linked Sensor DataCore ontology

Domain ontologiesGuidelines for identifiersAPIs

Query processing engines

Work in progress & examples

Challenges: generate & consume LSD

Page 60: Publishing consuming Linked Sensor Data meetup Cuenca

Thanks!

Questions, please.

[email protected]

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)