A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra...

63
A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay , Frédérique Laforest, Jean-Marc Petit Laboratoire d’InfoRmatique en Image et Systèmes d’information Université de Lyon, INSA-Lyon, LIRIS – UMR 5205 CNRS 7 avenue Jean Capelle, F-69621 Villeurbanne, France http://liris.cnrs.fr 25 th March 2010

Transcript of A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra...

Page 1: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

A Simple (yet Powerful) Algebrafor Pervasive Environments

EDBT 2010

Yann Gripay, Frédérique Laforest, Jean-Marc Petit

Laboratoire d’InfoRmatique en Image et Systèmes d’informationUniversité de Lyon, INSA-Lyon, LIRIS – UMR 5205 CNRS

7 avenue Jean Capelle, F-69621 Villeurbanne, Francehttp://liris.cnrs.fr

25th March 2010

Page 2: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Pervasive Environments

The Computer for the 21st Century, Mark Weiser, 1991“The most profound technologies are those that disappear. Theyweave themselves into the fabric of everyday life until they areindistinguishable from it.”

network

CharacteristicsDynamicDistributedHeterogeneousLinked to the physical worldetc.

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 2 / 29

Page 3: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Pervasive Applications

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 3 / 29

Page 4: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Pervasive Applications

RessourcesDonnées

Fonctionnalités

Flux de Données

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 3 / 29

Page 5: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Pervasive Applications

!

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 3 / 29

Page 6: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Pervasive Applications

?

X

??

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 3 / 29

Page 7: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Issues of Pervasive Application Development

Interacting with distributed dynamic resourcesHeterogeneity• Data• Functionality

Dynamicity• Dynamic data• Availability of resources

Number of resourcesRemote access

Proposition: the SoCQ data modelService-oriented Continuous Queries

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 4 / 29

Page 8: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Issues of Pervasive Application Development

Interacting with distributed dynamic resourcesHeterogeneity• Data• Functionality

Dynamicity• Dynamic data• Availability of resources

Number of resourcesRemote access

Proposition: the SoCQ data modelService-oriented Continuous Queries

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 4 / 29

Page 9: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

SoCQ Data ModelData-oriented declarative approach for pervasive environments

At the interface of two domainsPrinciples of databasesRequirements of pervasive environments

An additional level of abstraction⇒ Declarative approachUnified logical representationDeclarative query languageEnabling optimization

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 5 / 29

Page 10: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Outline

1 Introduction

2 Data Model Structure

3 Data Model Language

4 Implementation

5 Conclusion

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 6 / 29

Page 11: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Outline

1 Introduction

2 Data Model Structure

3 Data Model Language

4 Implementation

5 Conclusion

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 7 / 29

Page 12: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Abstraction of Functionality

Stable structure / Dynamic instancesMiddleware (SOA, SODA, Real World Internet, etc.)• Services with methods and events

Decoupling• Functionality⇒ stable metadata: prototype• Implementations⇒ dynamic instances: services

ωi ωj

Méthodes

Flux de données

Données stockées

Webcam Capteur E-mail Messagerieinstantanée

ω ServicesFlux RSS

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 8 / 29

Page 13: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Abstraction of Functionality

Stable structure / Dynamic instancesMiddleware (SOA, SODA, Real World Internet, etc.)• Services with methods and events

Decoupling• Functionality⇒ stable metadata: prototype• Implementations⇒ dynamic instances: services

ωi ωj

Méthodes

Flux de données

Données stockées

Webcam Capteur E-mail Messagerieinstantanée

ω ServicesFlux RSS

ω

temperatureNotifications

getTemperature

sendMessage

ω

ω

ω

ωω ω

ω

ω ω

ωω

ω

ω

ω

ω

PROTOTYPES

SERVICES

ω

ω

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 8 / 29

Page 14: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Data vs Functionality

In the literature: binding pattern of a relation R(Ab, Bf )

“which attributes of a relation must be given values whenaccessing a set of tuples” [D. Florescu et al., SIGMOD’99]Explicit mismatch between logical and physical views

Prototype ≈ binding patternInput/Output attributes• sendMessage ( address, message ) : ( sent )• getTemperature ( ) : ( temperature )

Services ≈ relational datasourcesImpact or not on the environment• actuators vs sensors

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 9 / 29

Page 15: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Extended Dynamic Relation (XD-Relation)

sendMessage(address,message):(sent)

email jabber

[email protected]

[email protected]

Franç[email protected]

Name Address Messenger Message SentNicolas [email protected] email * *Carla [email protected] email * *

François [email protected] jabber * *

sendMessage [ Messenger ] ( Address, Message ) : ( Sent )

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 10 / 29

Page 16: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Extended Dynamic Relation (XD-Relation)

sendMessage(address,message):(sent)

email jabber

[email protected]

[email protected]

Franç[email protected]

Name Address Messenger Message SentNicolas [email protected] email * *Carla [email protected] email * *

François [email protected] jabber * *

sendMessage [ Messenger ] ( Address, Message ) : ( Sent )

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 10 / 29

Page 17: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 18: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 19: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperaturesensor01 office *sensor03 roof *

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 20: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *sensor18 office *

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 21: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *sensor18 office *

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 22: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperature

sensor01 office *sensor03 roof *sensor17 office *sensor18 office *

Infinite XD-RelationPhotos

camera location photo

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 23: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperature

sensor01 office *sensor03 roof *sensor17 office *sensor18 office *

Infinite XD-RelationPhotos

camera location photo

camera01 garden

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 24: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperature

sensor01 office *sensor03 roof *sensor17 office *sensor18 office *

Infinite XD-RelationPhotos

camera location photo

camera01 garden

camera01 garden

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 25: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperature

sensor01 office *sensor03 roof *sensor17 office *sensor18 office *

Infinite XD-RelationPhotos

camera location photo

camera01 garden

camera01 garden

camera01 garden

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 26: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperature

sensor01 office *sensor03 roof *sensor17 office *sensor18 office *

Infinite XD-RelationPhotos

camera location photo

camera01 garden

camera01 garden

camera01 garden

camera01 garden

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 27: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Relational Pervasive Environment

XD-RelationsSchema = real & virtual attributes + binding patternsTuples over real attributes onlyFinite / infinite

Finite XD-RelationSensors

sensor location temperature

sensor01 office *sensor03 roof *sensor17 office *sensor18 office *

Infinite XD-RelationPhotos

camera location photo

camera01 garden

camera01 garden

camera01 garden

camera01 garden. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 11 / 29

Page 28: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Outline

1 Introduction

2 Data Model Structure

3 Data Model LanguageSerena algebraQuery Equivalence

4 Implementation

5 Conclusion

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 12 / 29

Page 29: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebra

Decomposition of pervasive applicationsGeneric elementary operations⇒ algebra operatorsExtension of relational algebra & CQL (STREAM Project)

One-shot and continuous operators⇒ Service-enabled algebra

Serena algebra operators over XD-RelationsSet operators ∪, ∩, −Relational operators π, σ, ρ, ./Stream operators (CQL)• WindowW[size] over a stream• Streaming S[event] over a relation

+ operators to interact with services

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 13 / 29

Page 30: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

sensor01 office 24.5sensor02 corridor 21.0sensor03 roof 13.5

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 31: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

sensor01 office 24.5sensor02 corridor 21.0sensor03 roof 13.5

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 32: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 33: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 34: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 35: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

sensor02 corridor 21.0. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 36: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

sensor02 corridor 21.0sensor01 office 24.5sensor02 corridor 21.5

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 37: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

⇓sensor location temperature

sensor02 corridor 21.0sensor01 office 24.5sensor02 corridor 21.5

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 38: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor02 corridor 21.0sensor01 office 24.5sensor02 corridor 21.5

. . . . . . . . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 39: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena algebraRealization operators

Realization: virtual attributes⇒ real attributesAssignment αA≡B(r) or αA≡c(r)Binding β〈ψ,S〉(r)

β〈getTemp,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

sensor01 office 24.5sensor03 roof 13.5sensor17 office 22.0

β〈tempNotif,sensor〉(sensors)

sensor location temperaturesensor01 office *sensor03 roof *sensor17 office *

⇓sensor location temperature

. . . . . . . . .sensor01 office 24.0sensor03 roof 13.0sensor17 office 23.5

. . . . . . . . .Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 14 / 29

Page 40: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraService discovery operator

Service discovery ξ〈S,Aφ,Ψφ〉Managing service dynamicity• One tuple per available service

Service interface (+ attribute S) 7→ finite XD-Relation• Description attributes Aφ• Implemented prototypes Ψφ

Discovery of temperature sensorsξ〈sensor,{location},{getTemperature,temperatureNotifications}〉

. . .

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 15 / 29

Page 41: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraService discovery operator

Service discovery ξ〈S,Aφ,Ψφ〉Managing service dynamicity• One tuple per available service

Service interface (+ attribute S) 7→ finite XD-Relation• Description attributes Aφ• Implemented prototypes Ψφ

Discovery of temperature sensorsξ〈sensor,{location},{getTemperature,temperatureNotifications}〉

sensor

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 15 / 29

Page 42: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraService discovery operator

Service discovery ξ〈S,Aφ,Ψφ〉Managing service dynamicity• One tuple per available service

Service interface (+ attribute S) 7→ finite XD-Relation• Description attributes Aφ• Implemented prototypes Ψφ

Discovery of temperature sensorsξ〈sensor,{location},{getTemperature,temperatureNotifications}〉

sensor location

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 15 / 29

Page 43: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraService discovery operator

Service discovery ξ〈S,Aφ,Ψφ〉Managing service dynamicity• One tuple per available service

Service interface (+ attribute S) 7→ finite XD-Relation• Description attributes Aφ• Implemented prototypes Ψφ

Discovery of temperature sensorsξ〈sensor,{location},{getTemperature,temperatureNotifications}〉

sensor location . . .

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 15 / 29

Page 44: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraService discovery operator

Service discovery ξ〈S,Aφ,Ψφ〉Managing service dynamicity• One tuple per available service

Service interface (+ attribute S) 7→ finite XD-Relation• Description attributes Aφ• Implemented prototypes Ψφ

Discovery of temperature sensorsξ〈sensor,{location},{getTemperature,temperatureNotifications}〉

sensor location temperature

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 15 / 29

Page 45: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraService discovery operator

Service discovery ξ〈S,Aφ,Ψφ〉Managing service dynamicity• One tuple per available service

Service interface (+ attribute S) 7→ finite XD-Relation• Description attributes Aφ• Implemented prototypes Ψφ

Discovery of temperature sensorsξ〈sensor,{location},{getTemperature,temperatureNotifications}〉

sensor location temperaturesensor01 office *sensor02 corridor *sensor03 roof *

getTemperature [sensor] ( ) : ( temperature )temperatureNotifications [sensor] ( ) : ( temperature ) STREAMING

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 15 / 29

Page 46: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraQueries

Send “Bonjour!” to all,except to “Carla”β〈sendMessage,messenger〉

↑αmessage≡"Bonjour!"

↑σname6="Carla"

↑contacts

Send notifications to all whentemperature exceeds 35.0°C

S[insertion]

↑β〈sendMsg,msger〉

↑αmessage≡location

↑./

↗ ↖σtemp>35.0 contacts

↑W[1]

↑β〈tempNotif,sensor〉

↑sensors

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 16 / 29

Page 47: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraQueries

Send “Bonjour!” to all,except to “Carla”β〈sendMessage,messenger〉

↑αmessage≡"Bonjour!"

↑σname6="Carla"

↑contacts

Send notifications to all whentemperature exceeds 35.0°C

S[insertion]

↑β〈sendMsg,msger〉

↑αmessage≡location

↑./

↗ ↖σtemp>35.0 contacts

↑W[1]

↑β〈tempNotif,sensor〉

↑sensors

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 16 / 29

Page 48: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Serena AlgebraQueries

Send “Bonjour!” to all,except to “Carla”β〈sendMessage,messenger〉

↑αmessage≡"Bonjour!"

↑σname6="Carla"

↑contacts

Send notifications to all whentemperature exceeds 35.0°C

S[insertion]

↑β〈sendMsg,msger〉

↑αmessage≡location

↑./

↗ ↖σtemp>35.0 contacts

↑W[1]

↑β〈tempNotif,sensor〉

↑ξ〈sr,{loc},{getTemp,tempNotif}〉

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 16 / 29

Page 49: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Query Equivalence

ActionsActive or passive prototypes (binding patterns)• Impact on the environment (actuators)• Or not (sensors)

Actions of a query• Interactions through active binding patterns• Passive binding patterns are ignored

Equivalence of two queries(see paper for details)Intuitively• Same result and same actions

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 17 / 29

Page 50: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Query Rewriting

With active binding patternβ〈sendMessage,msger〉

↑αmessage≡"Bonjour!"

↑σname 6="Carla"

↑contacts

≡β〈sendMessage,msger〉

↑σname6="Carla"

↑αmessage≡"Bonjour!"

↑contacts

6≡σname 6="Carla"

↑β〈sendMessage,msger〉

↑αmessage≡"Bonjour!"

↑contacts

With passive binding patternβ〈getT emperature,sensor〉

↑σlocation="office"

↑sensors

≡σlocation="office"

↑β〈getT emperature,sensor〉

↑sensors

A step toward query optimizationNotion of equivalenceChoice of active/passive tag

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 18 / 29

Page 51: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Query Rewriting

With active binding patternβ〈sendMessage,msger〉

↑αmessage≡"Bonjour!"

↑σname 6="Carla"

↑contacts

≡β〈sendMessage,msger〉

↑σname6="Carla"

↑αmessage≡"Bonjour!"

↑contacts

6≡σname 6="Carla"

↑β〈sendMessage,msger〉

↑αmessage≡"Bonjour!"

↑contacts

With passive binding patternβ〈getT emperature,sensor〉

↑σlocation="office"

↑sensors

≡σlocation="office"

↑β〈getT emperature,sensor〉

↑sensors

A step toward query optimizationNotion of equivalenceChoice of active/passive tag

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 18 / 29

Page 52: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Query Rewriting

With active binding patternβ〈sendMessage,msger〉

↑αmessage≡"Bonjour!"

↑σname 6="Carla"

↑contacts

≡β〈sendMessage,msger〉

↑σname6="Carla"

↑αmessage≡"Bonjour!"

↑contacts

6≡σname 6="Carla"

↑β〈sendMessage,msger〉

↑αmessage≡"Bonjour!"

↑contacts

With passive binding patternβ〈getT emperature,sensor〉

↑σlocation="office"

↑sensors

≡σlocation="office"

↑β〈getT emperature,sensor〉

↑sensors

A step toward query optimizationNotion of equivalenceChoice of active/passive tag

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 18 / 29

Page 53: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Outline

1 Introduction

2 Data Model Structure

3 Data Model Language

4 ImplementationPrototypeExperimentation

5 Conclusion

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 19 / 29

Page 54: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Prototype

PEMS (Pervasive Environment Management System)Managing a Relational Pervasive Environment• Managing dynamic data and distributed services• Executing one-shot and continuous queries

Java/OSGi + UPnP

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 20 / 29

Page 55: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ExperimentationTemperature Surveillance

ServicesMessengers• E-mail• SMS• Jabber (instant messaging)

Temperature sensors• Physical sensors: Thermochron iButton, SunSPOT• Simulated sensors (with control GUI)

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 21 / 29

Page 56: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ExperimentationTemperature Surveillance

XD-RelationsConfiguration: TemperatureSurveillance

Area Manager Threshold AlertMessage

roof Xavier 45.0 Alert: roof on fire!corridor Yann 35.0 Do not run in the corridor!office Zoé 32.0 Too hot in the office...

Discovery of sensors: SensorsSensor Location Temperature

sensor01 office *sensor02 corridor *sensor03 roof *sunspot08 office *

getTemperature [Sensor] ( ) : ( Temperature )temperatureNotifications [Sensor] ( ) : ( Temperature ) STREAMING

Contact list: EmployeesName Address Message Messenger Sent

Xavier [email protected] * jabber4 *Yann [email protected] * email5 *Zoé 336982##### * sms6 *sendMessage [Messenger] ( Address, Message ) : ( Sent )

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 22 / 29

Page 57: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ExperimentationTemperature Surveillance

Main query (Serena SQL)

SELECT Area,Manager,Threshold,Temperature,SentSTREAMING UPON insertionFROM Sensors, TemperatureSurveillance, EmployeesWITH Message := AlertMessageWHERE Location = AreaAND Temperature > ThresholdAND Manager = Name

USING temperatureNotifications [1], sendMessage ;

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 23 / 29

Page 58: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ExperimentationTemperature Surveillance – Scenario Execution

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 24 / 29

Page 59: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

Outline

1 Introduction

2 Data Model Structure

3 Data Model Language

4 Implementation

5 Conclusion

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 25 / 29

Page 60: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ConclusionContributions: A Relational Pervasive Environment

SoCQ Data Model (Service-oriented Continuous Queries)

Structure• Prototypes & Services• XD-Relations (eXtended Dynamic Relations)

Language• Serena (Service-enabled) algebra• Query equivalence

Pervasive Environment Management System (PEMS)Managing dynamic data and servicesExecuting one-shot and continuous queries• Serena SQL (+ DDL/DML)

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 26 / 29

Page 61: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ConclusionIssues⇒ Solutions

Interacting with distributed dynamic resourcesHeterogeneity⇒ XD-RelationsDynamicity⇒ XD-Relations / Service discovery ξNumber of resources⇒ at the data levelRemote access⇒ Services

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 27 / 29

Page 62: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

ConclusionPerspectives

SoCQ FrameworkExtension of the SoCQ Data Model• Services providing data relations• Aggregation, Spatial data, etc.

Evaluation (Experimentation⇒ Benchmark)P2P PEMS

ApplicationsNews notifications (RSS feeds)Object surveillance (movement sensors)Energy consumption monitoring in “intelligent buildings”

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 28 / 29

Page 63: A Simple (yet Powerful) Algebra for Pervasive Environments ... · A Simple (yet Powerful) Algebra for Pervasive Environments EDBT 2010 Yann Gripay, Frédérique Laforest, Jean-Marc

Introduction Structure Language Implementation Conclusion

THANK YOU FOR YOUR ATTENTION!

SoCQ Project Web Sitehttp://liris.cnrs.fr/socq/

Yann Gripay – http://liris.cnrs.fr/yann.gripay EDBT 2010 – SoCQ Data Model 29 / 29