Keywords

1 Introduction

The WoT Thing Description [9] is a key specification for the W3C Web of Things [6]. A Thing Description describes the metadata and interfaces of Things to participate in the WoT. However, in order to use a Thing, its Thing Description first has to be stored and obtained. A WoT Thing Description Directory (WoT TDD) [1] allows the registration, management, and search of a database of Thing Descriptions and allows authenticated and authorized entities to find WoT Thing Descriptions satisfying a set of criteria, such as being in a certain location, or having certain semantics, or containing certain interactions. This can be achieved using the W3C WoT discovery embedded in the Thing Description Directory. IoT consumers should be able to send semantic queries to the WoT discovery. For instance, an IoT service provider would like to know the set of devices related to smart space heating in a given apartment or room of a building. Semantic interoperability eases the scalable development of energy efficiency IoT applications and services. The WoT discovery requires a common ontology to semantically annotate Thing Descriptions in order to allow their semantic querying from the WoT Thing Description Directory. However, there is a lack of ontologies integrating the WoT into smart buildings. To achieve WoT discovery, the domOS Common ontology integrates the WoT ecosystem in smart buildings. The contributions of this paper are: (i) The domOS Common Ontology (dCO) ontology, as a common information model to allow semantic discovery in the WoT. (ii) An open-source implementation of the WoT semantic discovery capability to allow a context-based search of the IoT devices and their metadata in the WoT.

2 Example Use Case

In this section, we present a use case related to semantic discovery. We consider a space heating service, which aims to reduce the energy required for a residential house located in the demonstrator site of Sion, Switzerland. The house contains a heat pump appliance, which heats a water tank. An electricity meter measures the consumed energy by the heat pump. The water from the tank is pumped to the heating pipes of the house floor to ensure space heating. A temperature sensor measures the ambient temperature of a given room. A thermostat enables and disables heating for each room. The space heating service algorithm computes the optimal temperature needed in each room based on the input measurements from the ambient sensors. The heating service achieves energy efficiency when automatically turning off the heater. This house also contains other services which require other devices such as sensors and actuators. One of the main challenges of IoT ecosystems in smart buildings is to enable IoT consumers to search for the right IoT devices without having any prior knowledge about them. Therefore, IoT consumers need a semantic discovery capability in the Web of Things. We present the following user stories are example of the semantic discovery capability for the space heating service use case: The IoT service provider wants to know the list of sensors and heating controllers related to the space heating service in a given apartment; The IoT service provider wants to know the temperature sensors measuring a temperature above 26 \(^\circ \)C in the rooms heated by the space heating. These user stories, would not be possible to answer their related semantic queries if the relevant metadata of IoT devices are not stored in a semantic knowledge base to allow their discovery. Therefore, in this work, we propose the domOS Common Ontology to semantically annotate Thing Descriptions and store them in a semantic knowledge base to ensure the WoT Discovery in the context of WoT ecosystems.

3 Ontology Design and Competency Questions

Conforming to the NeOn ontology engineering methodology [10], we identified a set of competency questions (CQs) as part of our ontology requirement specification document (ORSD). The ORSD was made in collaboration with our partners from 5 demonstration sites of the H2020 EU domOS project (https://www.domos-project.eu/). The purpose of the dCO is to integrate the WoT Thing Descriptions with smart buildings. We have identified the following use cases of dCO: (i) Semantic annotation of Thing Descriptions, which are JSON-LD files that describe the metadata of a WoT Thing. (ii) WoT Semantic discovery in smart buildings. Both the CQs and the ORSD can be found in our GitHub repository (https://github.com/AmirLaa/TDD). We integrate an ontology FAIRification activity into the NeOn methodology following the best practices for implementing FAIR principles in ontologies introduced by Garijo et al. [3]. Based on the CQs, the ontology should both support the WoT and the IoT domain in order to allow the WoT discovery of IoT devices and their metadata in smart buildings. Therefore, dCO integrates the SAREF [4] core ontology with SAREF4ENER, the Thing Description ontology, IoT devices, Units of Measurements Ontology and Building Topology Ontology (BOT) [8].

4 Ontology Construction and Evaluation

Figure 1 shows the main classes and properties of dCO, which is based on a modular design to enhance the maintainability of the ontology and facilitate its integration in other projects.

Fig. 1.
figure 1

dCO design overview

We depict the graphical representations of the modules in the dCO documentation (https://w3id.org/dco/). dCO should be used for the semantic annotation of the JSON-LD Thing Descriptions (cf. dCO documentation). A Thing Description can be annotated using a device term (e.g., dco:temperatureSensor), its location (e.g., dco:Apartment01), its interaction affordances (e.g., dco:temperaturePropertyAffordance), and the units of measurements (e.g., dco:celsius).

The dCO core module reuses the SAREF core ontology [4] and allows the integration of the other modules to ensure WoT discovery queries in smart buildings. This module is integrated with the Thing description module and the device module using a subsumption relationship. The core module is integrated with the building description module, the units of measurement module, respectively, using the property vicinity:isLocatedAt and saref:isMeasuredIn.

The devices module represents the set of devices in an IoT ecosystem. Devices are structured in categories, that reflect different types of devices (e.g., ssn:sensor, saref:meter).

The units of measurements module represents all the units of measurements of the IoT devices. This module reuses the Units of Measurement Ontology. A saref:measurement is a measurement using a unit of measurement.

The thing description module integrates the W3C WoT Things Descriptions ontology [2] with the core module. A td:Thing subsumes a ssn:device. A td:Thing inherits properties of a saref:device. A td:Thing can be related to one or more ssn:tasks and associated to one or more td:actionAffordances, td:eventAffordances, and td:propertyAffordances.

The building description module contains the representation of building-related metadata and building topology. We reuse concepts from the W3C Building Topology Ontology (BOT) [8]. We define four types of spaces: bot:building, dogont:floor, dco:apartment, and iottaxolite:room.

Ontology Evaluation: To ensure that the concepts correctly implement the ontology requirements and CQs, we created several SPARQL queries to answer the CQs. We have also evaluated dCO using Description Logic (DL) reasoners for satisfiability, incoherence, and inconsistency. We have validated dCO using the OOPS! (OntOlogy Pitfall Scanner!) [7] tool. This tool detects the most common pitfalls appearing when developing ontologies. We assessed and validated the FAIRness of dCO using a tool called FOOPS! [5], which assesses the compliance of ontologies against 24 different checks distributed across the FAIR principles.

5 WoT Thing Description Directory Implementation

To enable the WoT Discovery, Thing Descriptions should be stored in a Thing Description Directory. This directory allows CRUD operations of Thing Descriptions, their syntactic validation, and WoT discovery using an API interface. We implemented a WoT Discovery service and made it available using a Swagger API (https://herald.aau.dk/docs/). We made the implementation of the Thing Description Directory and the WoT Discovery available for the WoT community on GitHub (https://github.com/AmirLaa/TDD). Things Descriptions are synchronously stored, updated, and deleted from a document database and a triple store. The document database (MongoDB) allows the CRUD operation of the JSON-LD Thing Descriptions. The RDF triple store (Apache Jena Fuseki) stores the RDF transformation of the JSON-LD Things Description in order to allow WoT semantic discovery via a SPARQL endpoint. An example of an RDF Thing Description is available in the dCO ontology documentation. Things Descriptions have to be semantically annotated to allow their WoT Discovery via the Thing Description Directory. To validate our implementation of the WoT discovery capability, we converted the user stories of the space heating use case and CQs into SPARQL queries. We used the WoT discovery API interface to query the semantic knowledge. We have also concluded that the queries return the expected results. Moreover, we have implemented the Thing and Building Description Directory in 5 demonstrator sites across Europe of the domOS project. We have tested and validated the implementation in an agile development process in collaboration with our stakeholders.

In future work, we will consider making a building description JSON-LD file for the WoT, which will contain all metadata of a building itself, building topology, and IoT services metadata. The building description should be integrated into the semantic discovery of the Thing Description Directory in order to allow more advanced SPARQL queries in the WoT.