sensors, mappings and queries in the semantic web

28
Date: 06/07/2011 Sensors, Mappings and Queries (from a Semantic Web perspective) Jean-Paul Calbimonte Ontology Engineering Group. Facultad de Informática, Universidad Politécnica de Madrid. [email protected] OEG – Charlas de Grupo

Upload: jean-paul-calbimonte

Post on 14-Jan-2015

1.033 views

Category:

Education


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Sensors, Mappings and Queries in the Semantic Web

Date: 06/07/2011

Sensors, Mappings and Queries(from a Semantic Web perspective)

Jean-Paul CalbimonteOntology Engineering Group.

Facultad de Informática, Universidad Politécnica de Madrid.

[email protected]

OEG – Charlas de Grupo

Page 2: Sensors, Mappings and Queries in the Semantic Web

Outline

2Sensors, Mappings and Queries

• Previous work• Sensor data• Sensor metadata• Semantic Web representation• Mapping sensor streams• Query observations• Data integration

Page 3: Sensors, Mappings and Queries in the Semantic Web

Previously on …

3Sensors, Mappings and Queries

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

We are getting high waves

around here!

Live sensor data

Continuous queries

Page 4: Sensors, Mappings and Queries in the Semantic Web

Previously on…

4Sensors, Mappings and Queries

SELECT ?waveheightFROM STREAM <www.ssg4env.eu/SensorReadings.srdf> [FROM NOW -10 MINUTES TO NOW STEP 1 MINUTE]WHERE { ?WaveObs a sea:WaveHeightObservation; sea:hasValue ?waveheight; }

Query translation

Query ProcessingC

lient

Stream-to-Ontology mappings

SPARQLStream

[tuples]

Sensor Network

Data translation[triples]

SNEEql

conceptmap-def WaveHeightMeasurement virtualStream <http://ssg4env.eu/Readings.srdf> uri-as concat('ssg4env:WaveSM_', wavesamples.sensorid,wavesamples.ts) attributemap-def hasValue operation constant has-column wavesamples.measured dbrelationmap-def isProducedBy toConcept Sensor joins-via condition equals has-column sensors.sensorid has-column wavesamples.sensorid

conceptmap-def Sensor uri-as concat('ssg4env:Sensor_',sensors.sensorid) attributemap-def hasSensorid operation constant has-column sensors.sensorid

S2O Mappings

SELECT measured FROM wavesamples [NOW -10 MIN]

Page 5: Sensors, Mappings and Queries in the Semantic Web

Previously on …

5Sensors, Mappings and Queries

• Mapping data streams to ontologies

• Use ontological schemas to write queries over streaming data sources

• Rewriting SPARQL-Stream queries into declarative stream queries (e.g. SNEEql)

s:windsamples

sensorid: int PKts: datetime PKspeed: float

t:sensors

sensorid: int PKsensorname: st

WindSpeedMeasurement

Sensor

isProducedBy

xsd:int

hasSpeed

conceptmap-def WindSpeedMeasurement virtualStream <http://ssg4env.eu/Readings.srdf> uri-as concat('ssg4env:WindSM_', windsamples.sensorid,windsamples.ts) attributemap-def hasSpeed operation constant has-column windsamples.speed dbrelationmap-def isProducedBy toConcept Sensor joins-via condition equals has-column sensors.sensorid has-column windsamples.sensorid

conceptmap-def Sensor uri-as concat('ssg4env:Sensor_',sensors.sensorid) attributemap-def hasSensorid operation constant has-column sensors.sensorid

xsd:float

hasSensorid

OntologiesStreams S2O Mapping

Calbimonte, J-P., Corcho O., Gray, A. Enabling Ontology-based Access to Streaming Data Sources. In ISWC 2010.

Page 6: Sensors, Mappings and Queries in the Semantic Web

Keep on working

• Other streaming technologies?

• Other query languages?

• Hundreds of sensors?

• Integrating heterogeneous data?

6Sensors, Mappings and Queries

Beyond SSG4Env Streaming Data Services

Other than SNEEql: CQL-like, Service calls

Not only toy-like streams

Many sources from different providers, schemas

Page 7: Sensors, Mappings and Queries in the Semantic Web

A little help from our friends

• FP7 Network of Excellence

• Swiss Experiment

7Sensors, Mappings and Queries

GeoResearcher

Environmental and GeoScience researchSwiss Alps

...

...

...

Real-time data

Snow,Wind,Radiation.Lot of stuff

I want data to create my pretty

models and compare

I want to win a best paper

award

Page 8: Sensors, Mappings and Queries in the Semantic Web

SwissEx

8Sensors, Mappings and Queries

• Global Sensor Networks, deployment for SwissEx.

• Distributed environment: GSN Davos, GSN Zurich, etc.• In each site, a number of sensors available• Each one with different schema

• Metadata stored in wiki• Federated metadata management:• Jeung H., Sarni, S., Paparrizos, I., Sathe, S., Aberer, K., Dawes, N., Papaioannus, T.,

Lehning, M.Effective Metadata Management in federated Sensor Networks.  in SUTC, 2010

Sensor observations

Sensor metadata

Page 9: Sensors, Mappings and Queries in the Semantic Web

Sensor Metadata

9Sensors, Mappings and Queries

station

location

model

sensors

properties

Page 10: Sensors, Mappings and Queries in the Semantic Web

Sensor Metadata

• What properties are measured

• Which sensors available

• Where are they located

• How are they configured

• Who is responsible

10Sensors, Mappings and Queries

Page 11: Sensors, Mappings and Queries in the Semantic Web

Sensor Data: Observations

11Sensors, Mappings and Queries

Heterogeneity

Integration

Page 12: Sensors, Mappings and Queries in the Semantic Web

A model to bind them all

• W3C SSN Ontology

12Sensors, Mappings and Queries

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 13: Sensors, Mappings and Queries in the Semantic Web

SSN Ontology

13Sensors, Mappings and Queries

ssn:OperatingRange

ssn:SensingDevice

ssn:hasOperatingRange

ssn:Device

ssn:Sensor

ssn:MeasurementCapability

ssn:Sensing

ssn:System

ssn:Deployment

ssn:Platform

ssn:hasDeployment

ssn:deployedOnPlatformssn:implements

ssn:hasMeasurementCapability

ssn:onPlatform

Page 14: Sensors, Mappings and Queries in the Semantic Web

So Far

14Sensors, Mappings and Queries

qQuery

translation

q’Query

Processing

Data translation

dd’

Clie

nt

mappings

[tuple][tuple]

[triple]

Ontology-based sensor query service

SPARQLStream

Target query Se

nso

r Ne

two

rks

SSN Onto

logy

???

Page 15: Sensors, Mappings and Queries in the Semantic Web

Creating Mappings

15Sensors, Mappings and Queries

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 16: Sensors, Mappings and Queries in the Semantic Web

R2RML

• RDB2RDF W3C Group, R2RML Mapping language:• http://www.w3.org/2001/sw/rdb2rdf/r2rml/

16Sensors, Mappings and Queries

: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 17: Sensors, Mappings and Queries in the Semantic Web

So Far

17Sensors, Mappings and Queries

qQuery

translation

q’Query

Processing

Data translation

dd’

Clie

nt

mappings

[tuple][tuple]

[triple]

Ontology-based sensor query service

SPARQLStream

Target query Se

nso

r Ne

two

rks

SSN Onto

logy

R2RM

L

GSN

???

Page 18: Sensors, Mappings and Queries in the Semantic Web

Data Access

• GSN Web Services• GSN URL API

• Compose the query as a URL:

18Sensors, Mappings and Queries

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 19: Sensors, Mappings and Queries in the Semantic Web

Algebra expressions

19Sensors, Mappings and Queries

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 20: Sensors, Mappings and Queries in the Semantic Web

Algebra construction

20Sensors, Mappings and Queries

timed,sp_wind

π

ω

σ sp_wind>10

5 Hour

wan7

windsensor1

windsensor2

Page 21: Sensors, Mappings and Queries in the Semantic Web

Static optimization

21Sensors, 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 22: Sensors, Mappings and Queries in the Semantic Web

Getting things done

• Transformed wiki metadata to SSN instances in RDF• Generated R2RML mappings for all sensors• Implementation of Ontology-based querying over

GSN• Fronting GSN with SPARQL-Stream queries• Numbers:

• 28 Deployments• Aprox. 50 sensors in each deployment• More than 1500 sensors• Live updates. Low frequency• Access to all metadata/not all data

22Sensors, Mappings and Queries

Page 23: Sensors, Mappings and Queries in the Semantic Web

Ugly little demo

• Problems• Too many sensors• Too Heterogeneous

• Any sensors available in this region?• Sensors that measure wind speed?• How about getting the data?

23Sensors, Mappings and Queries

Page 24: Sensors, Mappings and Queries in the Semantic Web

Playing with it

24Sensors, Mappings and Queries

Page 25: Sensors, Mappings and Queries in the Semantic Web

Playing with it

25Sensors, Mappings and Queries

Page 26: Sensors, Mappings and Queries in the Semantic Web

Conclusions

• Thou shalt use the SSN Ontology !• Using R2RML mappings• We can apply the approach to different technologies• We can translate to query languages and APIs• Algebra expressions are cool• Scale to hundreds of sensors

26Sensors, Mappings and Queries

Page 27: Sensors, Mappings and Queries in the Semantic Web

TODO

• Make things usable• Combine with LD generation• Integrate with stored RDF data• Streaming/Dynamic RDF vocabularies• Apply to other environments

• MonetDB• OGC SOS Services• Pachube

27Sensors, Mappings and Queries

Page 28: Sensors, Mappings and Queries in the Semantic Web

Thanks!

• Questions, please.

28Sensors, Mappings and Queries