=Paper=
{{Paper
|id=Vol-1401/paper-08
|storemode=property
|title=Demo Paper: Helping IoT Application Developers with Sensor-based Linked Open Rules
|pdfUrl=https://ceur-ws.org/Vol-1401/paper-08.pdf
|volume=Vol-1401
|dblpUrl=https://dblp.org/rec/conf/semweb/GyrardBB14
}}
==Demo Paper: Helping IoT Application Developers with Sensor-based Linked Open Rules==
Demo Paper: Helping IoT Application Developers with Sensor-based Linked Open Rules Amelie Gyrard, Christian Bonnet, and Karima Boudaoud Eurecom, Sophia Antipolis, France {gyrard,bonnet}@eurecom.fr Laboratoire I3S-CNRS/UNSA, Sophia Antipolis, France karima@polytech.unice.fr Abstract. Domain-specific Internet of Things (IoT) applications are becoming more and more popular. They process data coming from sen- sor measurements. Adding semantic annotations to the sensory observa- tions and measurements can allow to reason on data via logical rules. Stemming from Linked Open Data and Linked Open Vocabularies, we have designed sensor-based Linked Open Rules (S-LOR). S-LOR allows exploiting, reusing and combining rules to help developers design and combine cross-domain IoT applications. A proof-of-concept of S-LOR is available online at http://www.sensormeasurement.appspot.com/?p=swot template Keywords: Semantic Web of Things (SWoT), Linked Open Rules, Linked Open Vocabularies, Sensor, Domain ontologies, Semantic Sensor Net- works, Machine-to-Machine (M2M), Internet of Things (IoT), Semantic Web. 1 Introduction Semantic annotations are applied to sensor in more than 200 ontology-based projects1 in specific domains such as health care, smart home, tourism, trans- portation and agriculture. If all the semantic models and data representations for these works were published online, we would be able to reuse the smart rea- soning methods to exploit, reuse and combine rules. If the rules are designed and implemented in a uniform way, it would be easy to automatically extract rules to build Sensor-based Linked Open Rules (S-LOR). As a first step, we built manu- ally S-LOR to show its benefits: (1) rules are reused since they have already been designed and implemented by domain experts and (2) rules are interlinked with each other to combine domains to build smart IoT applications. For example, the rule if foggy then switch on fog lamp combines the weather domain thanks to the foggy concept and the transportation domain thanks to the fog 1 http://www.sensormeasurement.appspot.com/?p=ontologies lamp concept. Sheth et al. [1] and Wei et al. [2] are the early works that propose the idea to reason on semantic sensor data (e.g., to deduce potentially icy, bliz- zard, freezing concepts). Khandelwal et al. [3] propose Rule Interchange Format (RIF) as a standard format for the ’Linked Rules’. Seye el al. [4] implement a tool to convert RIF rules into SPARQL CONSTRUCT rules and design a RIF validator. RIF2 is designed by the W3C to unify various rule languages: SWRL, RuleML (Rule Markup Language), R2ML (REWERSE Rule Markup Language), F-logic but we did not find any RIF-based tools that are already implemented to extract rules. None of these works propose to reuse and extract rules already implemented in ontology-based IoT projects. In this paper we present S-LOR to help developers integrate a smart reasoning in their IoT applications. Developers easily find rules related to sensor observations designed by domain experts which are represented in an unified way and are interoperable with each others since rules are designed according to the Machine-to-Machine (M3) ontology3 . M3 is an extension of the W3C SSN4 ObservationValue concept and describes sensors, measurements, units and domains to provide a basis for reasoning that can ease the development of advanced applications. 2 Sensor-based Linked Open Rules (S-LOR) Automatic extraction of the linked rules is a challenging task due to heteroge- neous terminologies or rule formats and syntaxes: – Frequently, domain experts use popular ontology editor tools to design owl:Restriction rules. Unfortunately, these rules are not designed in the same way. In S-LOR, we convert them into SWRL, implemented with the Jena5 framework and define an owl:Restriction template compatible with the M3 ontology. – The rules are implemented with various ontology editors such as Protege, OWL API, SWOOPS, Hozo, TopBraid, OWL DL ed2, Neon but do not have the same syntax. Protege proposes at least 7 different plugins to write SWRL rules. – The syntax of the rules is not the same according to the inference engine used, the rules cannot be inferred by another reasoner such as Jena, Pellet, Jess, Racer. – The rules are not published online, we extract them manually from research articles (e.g., explanations, screenshots). – Some rules are implemented with the SPARQL Inferencing Notation (SPIN)6 language. SWRL rules can have equivalent rules written with SPIN language (SPARQL CONSTRUCT). 2 http://www.w3.org/2005/rules/wiki/RIF FAQ 3 http://www.sensormeasurement.appspot.com/m3# 4 http://www.w3.org/2005/Incubator/ssn/ssnx/ssn 5 http://jena.apache.org/ 6 http://spinrdf.org/ – Different terms are used to describe sensor measurements and inferred con- cepts. We are working with ontology mapping tools such as LogMap and Aroma to automatically align concepts described in different ways such as etymology (e.g., rain/rainy), synonyms (e.g., precipitation/rain), different entities (e.g., driver’s state defined as concepts or as properties). – Redundant rules are not inserted in S-LOR, but we cite the author’s work. – Divergence in rules. We observe that if one work defines 16 rules related to wind speed and another work only 5 rules, we detect that the values are incompatible. The more rules are defined by domain experts, the more precise they will be. We update S-LOR according to the most precise work. For these reasons, we manually extracted rules to build S-LOR. It would be possible to automate rule extraction if they are implemented as owl:Restriction with Protege or OWL API and following our M3 template. To design a rule-based IoT application, developers get rules related to sen- sor data through S-LOR. S-LOR has been designed to be compliant with the Machine-to-Machine (M3) ontology [5] and the Jena inference engine7 . The M3 ontology is an intermediary step while waiting for the adoption of better prac- tices. By integrating M3, new IoT applications are becoming highly valued since domains are combined and rules reused. S-LOR has been used to design three IoT applications to link domains with each other: (1) transportation & weather8 to suggest safety devices according to the weather (e.g., if snowy then safety devices are snow-chains, ABS, ESP), (2) tourism & weather9 to suggest ac- tivities or clothes according to the weather, and (3) health care, weather & food with the naturopathy application10 to suggest ingredients or recipes ac- cording to the user’s emotional state, season, weather, etc. A sample of rules in S-LOR is depicted in Figure 1, m3:Sensor subclasses are displayed in the drop-down list. By choosing a sensor (e.g., m3:Precipitation), all rules re- lated to this sensor are displayed such as NoPrecipitation or HeavyRain and the origins of the rules (e.g. Kofler, ThinkHome 2011 or Staroch 2013 as de- picted in Figure 1). Rules are implemented according to the Jena rule syn- tax as following: [HeavyRain: (?measurement rdf:type m3:Precipitation) (?measurement m3:hasValue ?v) (?measurement m3:hasUnit m3:MilimeterPerHour) greaterThan(?v,20) lessThan(?v,50) -> (?measurement rdf:type weather-dataset:HeavyRain) ] IoT developers can reuse the M3 ontology11 and sensor-based Jena rules12 published online. To evaluate S-LOR, an evaluation form has been set up13 to be filled by IoT developers. This process is ongoing. 7 http://jena.apache.org/documentation/inference/ 8 http://www.sensormeasurement.appspot.com/?p=transport 9 http://www.sensormeasurement.appspot.com/?p=tourism 10 http://www.sensormeasurement.appspot.com/?p=naturopathy 11 http://www.sensormeasurement.appspot.com/m3# 12 http://www.sensormeasurement.appspot.com/RULES/LinkedOpenRules.txt 13 https://docs.google.com/forms/d/1HR2I4VbkHyAyKM1ElJp3bON- Y3kk94YP2cIQDnxdCPU/viewform Fig. 1. Sensor-based Linked Open Rules We designed Sensor-based Linked Open Rules (S-LOR) to extract, reuse and combine rules to help developers design smart rule-based IoT applications. S- LOR is integrated in our M3 framework to ease the reasoning on sensor data in IoT. Future works are to automatically extract rules and rewrite it to be compliant with M3 rules. Acknowledgments. The authors would like to thank colleagues/friends/students for fruitful discussions, valuable feedback or help for the implementation. This work is supported by the Com4Innov Platform of Pole SCS14 . References 1. Sheth, A., Henson, C., Sahoo, S.: Semantic sensor web. Internet Computing, IEEE 12(4) (2008) 78–83 2. Wei, W., Barnaghi, P.: Semantic annotation and reasoning for sensor data. Smart Sensing and Context (2009) 66–76 3. Khandelwal, A., Jacobi, I., Kagal, L.: Linked rules: principles for rule reuse on the web. In: Web Reasoning and Rule Systems. Springer (2011) 108–123 4. Seye, O., Faron-Zucker, C., Corby, O., Follenfant, C.: Bridging the gap between rif and sparql: Implementation of a rif dialect with a sparql rule engine. AImWD 2012 (2012) 19 5. Gyrard, A., Bonnet, C., Boudaoud, K.: Enrich machine-to-machine data with se- mantic web technologies for cross-domain applications. In: WF-IOT 2014, World Forum on Internet of Things, 6-8 March 2014, Seoul, Korea, Seoul, KOREA, RE- PUBLIC OF (03 2014) 14 http://www.pole-scs.org/