260 likes | 328 Views
Building the Environment for the Things as a Service. Semantics in BETaaS GWS 2014 – Aalborg Belén Martínez (TECNALIA). Context Manager. Semantic in BETaaS is implemented by the Context Manager: OSGi component. Goal :
E N D
Building the Environment forthe Things as a Service Semantics in BETaaS GWS 2014 – Aalborg BelénMartínez (TECNALIA)
Context Manager • Semantic in BETaaS is implemented by the Context Manager: OSGi component. • Goal: • Unify the information that comes from heterogeneous resources and applications. • Infer knowledge from raw data in a context-aware fashion. • How: • Build a network of ontologies based on existing ontologies that fit our requirements: BETaaS Ontology. • Create the network of ontologies reusing ontologies that: • are relevant in their domains. • model the 2 BETaaS scenarios: Home Automation and Smart City. • Ontologydevelopment ApacheJena, an Open SourceSemantic Web frameworkfor Java
Context Manager • To promote standardization, the BETaaS ontology is populated with WordNetsynsets whenever possible: • WordNet offers an Open Source online service for linguistic applications • WordNet groups English words into Synsets (sets of synonyms) • BETaaS uses synsets to: • Define the requirements of manifest files of applications • To add contextual information to the new things connected to BETaaS • Synsets are identified by their WordNet identifier • Disambiguation: • In the case of words with different meanings represented by different WordNetsynsets
Context Manager • A GUI is shown to the user with the definitions of all the WordNetsynsets of the term • Disambiguation example: • park#1- a large area of land preserved in its natural state as public property • park#6- a gear position that acts as a parking brake • WordNet organization is based on semantic relationships among synsets (hypernymy, hyponymy, holonymy and meronymy). • All synsets inserted in the BETaaS ontology are stored following these relationships: SKOS • A common data model to organize clasifications in a hierarchical way. • Based on RDF
Context Manager • skos:concept - <http://www.betaas.com#room> • skos:notation – 04112987 • skos:prefLabel- “room”@EN • skos:definition– an area within a building enclosed by walls, floor and ceiling • skos:conceptScheme - <http://www.betaas.com#area> • skos:inScheme - <http://www.betaas.com#area> • skos:narrower- <http://www.betaas.com#kitchen> • <http://www.betaas.com#bathroom>
BETaaS things ontology • IoT-A Domain Model: common vocabulary • SSN: to model sensors and actuators • OWL-Time: to model temporal concepts • CF: for the representation of climatic and forecast data • MUO: to model the units of the measurements taken • Populated with instances of UCUM ontology
BETaaS things ontology • Phenonet: representation of sensor and actuator types • Populated with SKOS collections containing instances of the ontology, which are represented by Wordnetsynsets. • SKOS collection: representation of a thing by different words of the same family. • e.g. moistness, humidity and wetness, have different synsets(moistness: 14559507, humidity: 14559245, wetness: 14558298) but belong to the same WordNet cluster or family they can be stored together in a SKOS collection • When anew thing is connected and its type is defined, how is it added to Phenonet?: • Disambiguation by the user, in case it is needed. • If the term is not found in the ontology, its WordNet family is analyzed. • If the family exists, the term is added to the SKOS collection. • If the family doesn´t exist, a new SKOS collection is added to the ontology.
Context definition • Contextin BETaaS: the circumstances of the things that can affect their behaviour • Battery level • Available computing capacity • Communication protocol used • Location: four parameters are possible • Geographicalcoordinates: for outdoor scenarios only. • City name:automatically calculated from GPS coordinates, by GeoNames. • A keyword (a WordNetsynset) describing the location generally (e.g. street). • A descriptive text (e.g. the name of the street). • BETaaS is able to adaptto the changing context of the Things by means of the Trust Manager and the Context Manager
BETaaS context ontology • IoT-A Domain Model: common vocabulary • FIPA: to model the capabilities of the things • GeoSPARQL: to model geographical coordinates. • GeoNames: to model city names. • SSN: • To model keywords and descriptive texts about locations • To model the battery level
Context: location keywords • Wordnetsynsetsclassified in SKOS hierarchies aligned with the SSN ontology (dul:hasLocation) • If keywordfor a location of a thing is created, how is it added to SSN?: • Disambiguation by the user, in case it is needed. • If the term is not found in the ontology, WordNet is used to analyze the semantic relationships of this new term. • Determine if the term is represented by a broader term of a SKOS hierarchy • Hypernymsand holonymsof the term are analyzed • e.g. Kitchen has room as hypernym and home as holonym • If a related term is found: it is inserted in the SKOS hierarchy • If not, it is inserted in a new SKOS hierarchy formed by the term and its hypernyms and holonyms, if any. • To ease the implementation, the 2 scenarios have been pre-charged in SKOS
Semantic implementation • Every gateway has its own Context Manager • There is one BETaaS ontology and one semantic parser per gateway • There is a direct communication between Context managers in order to infer information when needed
How to unify information Services Layer • Resources in the Physical Layer expose their data in different formats (e.g. XML, raw data). • The Adaptation Layer takes this data that may include some contextual information. • More contextual information is introduced by the user by GUI means. • A set of parameters is created per thing. • The set of parameters is translated into JSON format • The semantic parser translates the JSON file to an appropriate semantic format (RDF) and inserts the data into the ontology. Context Manager BETaaS ontology RDF Semantic parser JSON Adaptation layer INSERT CONTEXT UAL INFORMATION Physical layer
JSON parameters • Output: true (sensor), false (actuator). • Digital: true (digital device), false (analogic device). • MaximumResponseTime: maximum response time (milliseconds). • MemoryStatus: available memory (percentage). • BatteryLevel: battery level (percentage). • Measurement: measurement taken by the thing. • Protocol: the values considered are modelled by instances of the FIPA Device ontology. • DeviceID: identifier of a device, each identifier is unique within a gateway. A device can be composed by more than one thing. • ThingID: identifier of a thing, each identifier is unique within a gateway. • Type: type of the thing (a keyword). The possible values are classified in families (SKOS collections) e.g. moistness, humidity, wetness are not synonyms but belong to the same WordNet family. • Unit: units of the measurement taken. Possible values are modelled by instances of the MUO ontology. • Environment: type of scenario where the thing is used: public/private. • Latitude: outdoor location of the thing . Only relevant when environment=public. • Longitude: idem. • Altitude: idem. • Floor: indoor location of the thing (e.g. 1). Only relevant when environment=private. • LocationKeyword: relevant information about the location of a thing (a keyword) e.g. street, park, car… Possible values are disambiguated by means of WordNetsynsets (sets of cognitive synonyms) Keywords are classified in generic classifications (SKOS hierarchies ) • LocationIdentifier: identifier of the location of the thing. Not mandatory. Free text e.g. Oxford, Regency, John1…
Thing Services • Paradigmdefined to representthefunctionalitiesexposedbythedifferentdevices: • One Thing Service is created for each of the things that are connected to a gateway. • For devices formed by N things: N Thing Services are created per device. • Applications interact with Thing Services: there is no direct interaction between applications and things. • Thing Services are useful for application developers, in order to deduce what type of functionalities are available in a gateway. • When a thing is connected, its associated Thing Service is promoted to upper layers.
Thing Services • A naming convention has been defined to represent the Thing Services within a BETaaS gateway. • Thefollowingparameters are used: • Output: true(sensorget), false(actuatorset) • LocationIdentifier • LocationKeyword • Type • DeviceID • GWID setLocationidentifierLocationkeywordType_DeviceID_GWID getLocationidentifierLocationkeywordType_DeviceID_GWID
Examples • Apresence sensoris installed in the mainbathroom of a house, which is located in the first floor. The presence sensor is part of an alarm system, but it is also connected to a gateway (GWID=0002) that belongs to a private BETaaSinstance. The sensor is identified by DeviceID=0001 within this gateway. • Output=true (it is a sensor) • Measurement=true/false • DeviceID=0001 • Type=Presence • Unit=- • Environment=Private • Latitude=- • Longitude=- • Altitude=- • Floor=1 • LocationKeyword=Bathroom • LocationIdentifier=Main • Thing service createdgetMainBathroomPresence_0001_0002
Examples • A GPS receptor is installed in a public bus. The bus number is 15. When the GPS receptor is turned on, it starts sending the position to a preinstalled BETaaS GW (GWID=0003) that belongs to a public BETaaSinstance. The GPS receptor is identified by DeviceID=0054 within this gateway. • Output= true (it is a sensor) • Measurement=- • DeviceID=0054 • Type=Location • Unit=Degrees • Environment=Public • Latitude=X • Longitude=Y • Altitude=Z • Floor=- • LocationKeyword=Bus • LocationIdentifier=15 • Thing service createdget15BusLocation_0054_0003
Examples • A traffic sensor provided by a 3rd party is installed in Via del Brennero street in the city of Pisa. As the traffic sensor supports public and private systems, it is also connected to a GW (GWID=0004) that belongs to a public BETaaSinstance. The traffic sensor is identified by DeviceID=0100 within this gateway. • Output= true (it is a sensor) • Measurement=intensity (e.g. 506) • DeviceID=0100 • Type=Traffic • Unit=cars/hour • Environment=Public • Latitude=X • Longitude=Y • Altitude=Z • Floor=- • LocationKeyword=Street • LocationIdentifier=Via del Brennero • Thing service createdgetViaDelBrenneroStreetTraffic_0100_0004
Examples • One temperature sensor and one humidity sensor offered by the same device are installed in the kitchen of a house, the kitchen located in the first floor. Both sensors are connected to a gateway (GWID=0002) that belongs to a private BETaaSinstance. The device is identified by DeviceID=0005 within this gateway. • Output=true (it is a sensor) • Measurement=degrees (e.g.20) • DeviceID=0005 • ThinID=0001 • Type=Temperature • Unit=Celsius • Environment=Private • Latitude=- • Longitude=- • Altitude=- • Floor=1 • LocationKeyword=Kitchen • LocationIdentifier=- Thing services createdgetKitchenTemperature_0005_0002 getKitchenHumidity_0005_0002 • Output=true (it is a sensor) • Measurement=humidity (e.g.60) • DeviceID=0005 • ThingID=0002 • Type=Humidity • Unit=- • Environment=Private • Latitude=- • Longitude=- • Altitude=- • Floor=1 • LocationKeyword=Kitchen • LocationIdentifier=-
Knowledgeinferencebythe CM • Different moments: • When analyzing the features of a new thing connected to BETaaS • When analyzing the requirements of the manifest fileof an application • At the time of executionof applications • The CM uses mechanisms based both on WordNet and on semantic rules, to infer knowldege. • Recapitulation of mechanisms based on WordNetto infer knowledge: • Disambiguationof terms with different meanings: • A GUI showing the definitions of all the WordNetsynsets of the term • Useful to disambiguate: • the metadata that describes a thing connected to BETaaS • the resources needed by an application
Knowledgeinferencebythe CM • Families of types of things: • A family of synsets is classified in the same SKOS collection. • CM uses WordNetin order to infer if synsets with different meanings belong to the same family. • Useful to: • Classify the type of a new thing connected to BETaaS: • e.g. if there is a collection formed by moistness and humidity, the CM would infer that a thing that measures humidity belongs to the family although all the terms have different synsets. • Determine the type of things that an application is demanding: • e.g. if an application demands moistness, things classified as humidity sensors are valid. • Relationships among locations: • The CM uses relationships among WordNetsynsets, expressed by means of SKOS classifications, to deduce relationships among locations.
Knowledgeinferencebythe CM • Useful to: • Classify the location of a new thing connected to BETaaS: • Hypernymsand holonymsare analyzed to determine if the term is represented by a broader concept present in the ontology • e.g. kitchen has room as hypernym, and home as holonym • Determine which locations are valid for an application demanding information • Hyponyms and meronymsare analyzed to determine if the term is represented by any narrower concept present in the ontology • e.g. The term home has condominium as hyponym and kitchen as meronym. If an application needs the temperature at home, a temperature sensor installed in the kitchen is valid.
Knowledgeinferencebythe CM • Mechanisms based on semantic rules to infer knowledge: • The scenarios have been analyzed to detect the rules to be applied • Semantic rules have been defined in the CM to detect: • Equivalent Thing Services (associated to things of the same type in the same location) • e.g. two temperature sensors in the garden of a house would offer Equivalent Thing Services • The operatorto be applied when different Thing Services have to be combined • e.g. If an application demands the presence at home, BETaaS would combine info from presence sensors installed in the kitchen, the bedroom and the toilet. • Rules are executed by a semantic reasoner(Jena Rule Reasoner)