Publishing consuming Linked Sensor Data meetup Cuenca


Published on

  • Be the first to comment

  • Be the first to like this

Publishing consuming Linked Sensor Data meetup Cuenca

  1. 1. 1st Latin American Linked Data Meetup Cuenca, EcuadorPublishing and Consuming Linked Sensor Data Jean-Paul Calbimonte Ontology Engineering Group. Facultad de Informática, Universidad Politécnica de Madrid. Date: 01/12/2011
  2. 2. Linked Sensor Data 101Motivation Ingredients Linked Sensor Data GenerateConsume 2
  3. 3. MotivationFrom Sensor Networks… … to the Sensor Web/ Internet of Things… … to Semantic Sensor Web and … Linked Sensor Data 3
  4. 4. Sensors (t9, a1, a2, ... , an) (t8, a1, a2, ... , an) Streaming (t7, a1, a2, ... , an)• Cheaper Data ... ...• Ubiquitous (t1, a1, ... a2, ... , an)• Robust ...• Routing • Noisy • Processing • Memory • Energy (Limited) 4
  5. 5. Background – Querying Relational Data Streams Streaming Data STREAM Aurora/Borealis Cougar Query engines e1 WINDOW [tnow-2 TO tnow] SLIDE 1 TinyDB SNEE e1 e2 CQL SNEEql Query languages TinyQL e1 e2 e3 Transform infinite sequence e1 e2 e3 e4 of tuples to bounded bagt t+1 t+2 t+3 t+4 t+5SELECT attribute FROM stream [NOW -10 MIN] ... 5
  6. 6. Sensor NetworksSource: Antonis Deligiannakis
  7. 7. An example: SmartCitiesEnvironmental sensors Parking sensors 7 SmartSantander Project
  8. 8. Who are the end users of Sensor Networks?The climate change expert, or a simple citizenSource: Dave de Roure
  9. 9. Not only environmental, but many others…Weather Sensors GPS Sensors Sensor Dataset Satellite Sensors Camera SensorsSource: H Patni, C Henson, A Sheth 9
  10. 10. The Sensor Web Universal, web-based access to sensor dataSource: Adapted from Alan Smeaton’s invited talk 10 ESWC2009 at
  11. 11. Make sensors more accessible?Source: SemsorGrid4Env consortium 11
  12. 12. Should we care as computer scientists? “Grand Challenge” CS issues: • Heterogeneity • Scale • Scalability • Autonomic behaviour • Persistence, evolution • Deployment challenges • Mobility Anything left for Semantic Web research?Source: Dave de Roure
  13. 13. Data from the Web Flood risk alert:South East England Emergency I have to make planner sense out of all this data wave data Environmental forecasts defenses Sensors, Mappings and Queries 13
  14. 14. Semantic Sensor Web / Linked Sensor Data (LSD)A representation of sensor data followingthe standards of Linked Data But what is Linked Data?
  15. 15. What is Linked Data?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 15
  16. 16. The four principles (Tim Berners Lee, 2006)Use URIs as names of thingsUse HTTP URIsProvide useful information when URI is dereferencedLink to other URIs 16
  17. 17. Linked Open Data2011 17
  18. 18. Semantic Sensor Web / Linked Sensor Data (LSD) A representation of sensor data following the standards of Linked Data• 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.
  19. 19. Let’s check some examples• Meteorological data in Spain: automatic weather stations •• Live sensors in Slovenia •• Channel Coastal Observatory in Southern UK •• And some more from DERI Galway, Knoesis, CSIRO, etc. 19
  20. 20. AEMET Linked Data Sensors Observations20
  21. 21. JSI Sensors21
  22. 22. Coastal Channel Observatory and other sources• Work with Flood environmental sensor data.• SemSorGrid4Env project Wind Speed Wave Height Tidal Observations 22
  23. 23. Motivation Flood risk alert: Wave, South East Real-time Wind, RDF England data Tide RDDF Ontology Emergency Meteorological RDF forecasts planner Flood defences data RDF ... ... 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” SPARQLEnabling Ontology-based Access to Streaming Data Sources 23
  24. 24. Ingredients for Linked Sensor DataCore ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
  25. 25. Sensor Metadata station location sensors model propertiesSensors, Mappings and Queries 25
  26. 26. Sensor Metadata • What properties are measured • Which sensors available • Where are they located • How are they configured • Who is responsibleSensors, Mappings and Queries 26
  27. 27. Sensor Data: Observations Heterogeneity IntegrationSensors, Mappings and Queries 27
  28. 28. Sensor Network Ontologies Since aprox. 2005: Several proposals  Project specific  Reuse?  Alignment?  Best practices? 2009-2011: W3C SSN-XG incubator group  SSN Ontology:
  29. 29. SSN ontology modules System OperatingRestriction Deployment Device Process PlatformSiteData Skeleton MeasuringCapability ConstraintBlock
  30. 30. Overview of the SSN ontologiesDeployment deploymentProcesPart only System OperatingRestriction hasSubsystem only, some hasSurvivalRange only SurvivalRange DeploymentRelatedProcess hasDeployment only System OperatingRange Deployment deployedSystem only hasOperatingRange only deployedOnPlatform only Process inDeployment only Device hasInput only InputPlatformSite onPlatform only Device Process Platform Output attachedSystem only hasOutput only, someData Skeleton isProducedBy some implements some Sensor Sensing hasValue some sensingMethodUsed only SensorOutput detects only SensingDevice observes only ObservationValue SensorInput isProxyFor only Property includesEvent some isPropertyOf some observedProperty only observationResult only observedBy only hasProperty only, some Observation FeatureOfInterest featureOfInterest only MeasuringCapability ConstraintBlock hasMeasurementCapability only forProperty only inCondition only inCondition only MeasurementCapability Condition
  31. 31. SSN Ontology: Measurement CapabilitiesSkeleton Property MeasuringCapability Communication hasMeasurementProperty only MeasurementCapability MeasurementProperty Accuracy Resolution Selectivity Frequency Precision Latency DetectionLimit Drift ResponseTime Sensitivity MeasurementRange OperatingRestriction EnergyRestriction Core ontological model hasOperatingProperty only OperatingRange OperatingProperty EnvironmentalOperatingProperty MaintenanceSchedule OperatingPowerRange hasSurvivalProperty only SurvivalRange SurvivalProperty EnvironmentalSurvivalProperty SystemLifetime BatteryLifetime
  32. 32. A model to bind them all• W3C SSN Ontology ssn:isProducedBy ssn:SensorOutput ssn:Sensor ssn:observedBy ssn:observationResult ssn:hasValue ssn:Observation ssn:ObservationValue ssn:observes ssn:featureOfInterest quantityValue ssn:observedProperty ssn:FeatureOfInterest xsd:datatype ssn:Property ssn:hasProperty 32
  33. 33. Exampleswissex:Sensor1 rdf:type ssn:Sensor; ssn:onPlatform swissex:Station1; ssn:observes [rdf:type sweetSpeed:WindSpeed].swissex:Sensor2 station 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
  34. 34. Exampleswissex: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 ; WindSpeed : 6.245 At: 2011-10- 26T21:32:52 34
  35. 35. Usage: SSN & Domain OntologiesUpper DOLCE SWEET UltraLiteSSG4Envinfrastructure SSN Schema ServiceExternal FOAF Ordnance SurveyFlood domain Role Coastal Additional Defences Regions 35
  36. 36. AEMET Ontology Network• 83 classes• 102 object properties• 80 datatype properties• 19 instances Additional domain ontologies
  37. 37. Examples: AWS, qu, Sweet• aws Observed Properties• Features of Interest• Types of Sensors Units of Measurement Time 37
  38. 38. Ingredients for Linked Sensor DataCore ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
  39. 39. Good practices in URI DefinitionSorry, no clearpractices yet…
  40. 40. 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: when sensor property
  41. 41. Ingredients for Linked Sensor DataCore ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
  42. 42. Sensor High-level APISource: K. Page & Southampton’s team at SemsorGrid4Env
  43. 43. Sensor High-level APISource: K. Page & Southampton’s team at SemsorGrid4Env
  44. 44. Ingredients for Linked Sensor DataCore ontological modelAdditional domain ontologiesGuidelines for generation of identifiersSensor Web programming interfacesQuery processing engines
  45. 45. Swiss-Experiment • FP7 Network of Excellence Environmental and GeoScience research Swiss Alps GeoResearcher ... Snow, Real-time Wind, ... data ... Radiation. Lots of stuff I want data to create my•How much snow is lost to evaporation? models and•Snow redistribution by wind compare• Wind erosion of sand• ... 45
  46. 46. Where is the Data? GSN server instance .. wan7 sensor1 sensor2 timed: datetime PK GSN sensor3 sp_wind: float … timed sp_wind 1 3.4 Queries 2 5.6 3 11.2 4 1.2 5 3.1 .. …SELECT sp_wind FROM wan7 WHERE sp_wind >10SELECT sp_wind FROM wan7 [NOW -5 HOUR] WHERE sp_wind >10 I want SPARQL! 46
  47. 47. Where is the Data?GSN server instance .. wan7 sensor1 sensor2 timed: datetime PK GSN sensor3 sp_wind: float … Mappings ssn:Observation 47
  48. 48. Creating Mappings ssn:observedProperty ssn:Observation ssn:Property ssn:observationResult Wan7/WindSpeed/Observation{timed} sweetSpeed:WindSpeed wan7 ssn:SensorOutputtimed: datetime PK float ssn:hasValue Wan7/ WindSpeed/ ObsOutput{timed} ssn:ObservationValue qudt:numericValue Wan7/WindSpeed/ObsValue{timed} xsd:decimal sp_wind 48
  49. 49. R2RML• RDB2RDF W3C Group, R2RML Mapping language: • :Wan4WindSpeed a rr:TriplesMapClass; rr:tableName "wan7"; rr:subjectMap [ rr:template "{timed}"; rr:class ssn:ObservationValue; rr:graph ssg:swissexsnow.srdf ]; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate ssn:hasQuantityValue ]; rr:objectMap[ rr:column "sp_wind" ] ]; .< >a ssn:ObservationValue< >ssn:hasQuantityValue " 4.5" 49
  50. 50. Queries to Sensor DataSNEEqlRSTREAM SELECT id, speed, direction FROM wind [NOW];Streaming SPARQLPREFIX fire: <>SELECT ?WindSpeedFROM STREAM <http://…/SensorReadings.rdf> WINDOW RANGE 1 MS SLIDE 1 MSWHERE { ?sensor fire:hasMeasurements ?WindSpeed FILTER (?WindSpeed<30)}C-SPARQL SPARQL-StreamREGISTER QUERY WindSpeedAndDirection ASPREFIX fire: <>SELECT ?sensor ?speed ?directionFROM STREAM <http://…/SensorReadings.rdf> [RANGE 1 MSEC SLIDE 1 MSEC]WHERE { … 50
  51. 51. Query translation SELECT ?waveheight FROM STREAM <> [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
  52. 52. Data Access• GSN Web Services• GSN URL API • Compose the query as a URL: :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 ? 52
  53. 53. Algebra expressionsπ timed, :22001/ multidata ?vs [0]= wan7 & field [0]= sp_wind & from =15/05/2011+05:00:00& to =15/05/2011+10:00:00& sp_wind c_vs [0]= wan7 & c_field [0]= sp_wind & c_min [0]=10σ sp_wind>10ω 5 Hour SELECT sp_wind FROM wan7 [NOW -5 HOUR] WHERE sp_wind >10wan7 53
  54. 54. Using the Mappings π timed, sp_windSELECT ?waveheight σFROM STREAM <>[NOW – 5 HOUR TO NOW] sp_wind>10WHERE { ?WaveObs a ssn:ObservationValue; qudt:numericalValue ?waveheight; ω 5 Hour FILTER (?waveheight>10) } wan7 wan7 ssn:ObservationValue timed: datetime PK qudt:numericalValue Wan7/WindSpeed/ObsValue{timed} sp_wind: float xsd:datatype sp_wind 54
  55. 55. Algebra construction π timed, sp_windwindsensor1windsensor2 σ sp_wind>10 ω 5 Hour wan7Sensors, Mappings and Queries 55
  56. 56. Static optimization π timed, π timed, π timed, sp_wind windvalue windvalue σ sp_wind>10 σ windvalue>10 σ windvalue>10 ω 5 Hour ω 5 Hour ω 5 Hour wan7 windsensor1 windsensor2Sensors, Mappings and Queries 56
  57. 57. Querying the ObservationsSELECT ?waveheightFROM STREAM <>[NOW -10 MINUTES TO NOW STEP 1 MINUTE]WHERE { ?WaveObs a sea:WaveHeightObservation; sea:hasValue ?waveheight; } :22001/ multidata ?vs [0]= wan Query field [0]= sp_wind translation GSN SPARQLStream API Client Mappings Query Processing Sensor Network [tuples] Data [triples] translation R2RML Mappings Query processing engines 57
  58. 58. 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
  59. 59. ConclusionsIngredients for Linked Sensor Data Core ontology Domain ontologies Guidelines for identifiers APIs Query processing enginesWork in progress & examplesChallenges: generate & consume LSD
  60. 60. Thanks!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 (AlasdairGray, 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) Questions, please. 60