Semantic Interoperability and Open IoT APIs for Smart Cities Applications

. As the percentage of the total population living in urban regions is increasing, new challenges for the cities of the future arise. Smart Cities emerged as a solution to these challenges building on the strength of intelligent information, communication technologies and Internet of Things. In this work, we discuss the importance of semantic technologies as well as open IoT APIs for the future Smart Cities applications. Through an illustrative application, we demonstrate that both of the aforementioned technologies ease the computational burden of implementation, foster programming sustainability and create the necessary conditions so as to rapidly harness the available information and extract knowledge out of it. At the same time, the application’s implementation lies in accordance with the latest IoT architectural recommendations such as Visual Programming interfaces for Service Composition, conformance with Big Data technologies and the latest IoT programming paradigms.


Introduction
The percentage of the total population living in urban regions is increasing rapidly, and is estimated to reach % in , according to a demographic estimate by the United Nations [ ]. This growing mass movement of people to urban areas engenders various challenges for the cities of the future with regard to human health, air pollution, traffic congestion, waste management, etc. [ ]. Intelligent information and communication technology (ICT) can tackle these challenges by making use of data from myriads of (end-user) devices connected to the Internet of Things (IoT), as well as existing data sources, with the goal to combine and analyze this data and use the results as a basis for future guidelines and decisions.
By integrating all the aforementioned technologies, the notion of "Smart City" aims at optimizing "the efficiency of city operations and services and connect to citizens" [ ]. Nonetheless, while the Smart City innovation brings value to the citizens by fostering sustainability and safeguarding environmental concerns, it creates various research challenges such as interoperability and cross-platform implementation. To enforce interoperability across heterogeneous systems and cross-platform implementations, IoT standards and semantic technologies have been proposed as a solution to simplify interoperability.
In this paper, a Smart City application is introduced, implemented in a way that conforms with the recent trends in IoT interoperability and Smart Cities applications. In parallel, through this application applications, an attempt is made to shed more light on the importance of semantic technologies as well as open IoT APIs for realizing a sustainable Systems-of-Systems ecosystem. The rest of this paper is structured as follows: Section introduces the key enabling technologies for Smart Cities and discusses the role that semantic technologies and IoT standards will have to play in future IoT. Section outlines a specific class of applications that we consider prototypical to illustrate the challenges. Section presents the approach and Section provides the implementation details. Finally, Section closes the paper sketching future work.

Related Work
Santana et al. [ ] have identified four main enabling technologies that are pervasive across all the state-of-the-art Smart Cities platforms. Specifically, they have identified: a) Internet of Things [ , ], as a network of physical devices and smart objects that will serve as data sources for the various Smart Cities applications; b) Big Data [ ] to facilitate the storage and processing of the vast amount of data received by the cities; c) Cloud Computing [ ], offering elastic computing capabilities for the plethora of services and data; d) Cyber-Physical Systems [ , ], that enable the interaction between the various systems and the city environment. Nonetheless, for sustaining an open innovation ecosystem for Smart Cities which would build upon the System-of-Systems paradigm, several authors [ , , , ] have argued that semantic technologies and open IoT standards constitute one of the catalytic factors that will permit the success and further development of Smart Cities' applications and services. Semantic technologies as well as open IoT communication protocols and data formats ensure an interoperable communication across heterogeneous systems of systems, and constitute a key facilitator for IoT [ , ].

Scenario Overview
The application under consideration is to provide a system that recommends citizens a number of places ("points of interest"(POI)) that have better environmental conditions compared to the places where they are currently located. Such a point of interest may, for instance, have higher temperature and lower humidity on a cold winter day and therefore constitutes a better environment for the citizen. The scenario's business value lies in its potential for generalization. Points of interest may also be inferred by taking traffic data into account to identify congested areas. Furthermore, the notion can be extended to areas of interest, warning citizens for instance, of particularly polluted regions or acute security threats. The approach and implementation method we present in this work can also be applied to support these applications.
From a technological perspective, this scenario illustrates how the different enabling technologies that were identified in Section can be used to provide solutions to the various Smart Cities challenges. Figure illustrates an overview of the proposed solution. We describe the processing steps by introducing the following scenario: An end user is interested in finding POIs with better environmental conditions. For that reason, she/he subscribes to implemented Smart City application and accepts to send her/his geo-coordinates (step on Figure ). In the next step, the application receives the user data, and in parallel requests for local environmental data (temperature and humidity) and POIs near the region where the user is currently on (steps and on Figure ). Based on the retrieved data, the application infers the local environmental conditions for the POIs and the user locations (step on Figure ), and sends back the result to the user (step on Figure ).
This simplistic scenario can be further be extended to include different kinds of data sources such as traffic data, pollution data, etc. Despite its simplicity, however, it can illustrate various key aspects that Smart Cities applications face. This application scenario includes a variety of different communication transactions across different and heterogeneous data provides (that may include cyber-physical systems) and data consumers. At the same time, the amount of data that the Smart City application receives can quite easily grow significantly enough so that the use of Big Data technologies will be a non-negotiable decision.
Similarly, the end users, the environmental data as well as the POI data all provide geo-coordinates information. This raises the importance of sharing a common semantic description of this information so as to facilitate the information integration.

Approach
Visual programming languages and frameworks are increasingly used in the IoT era [ ]. One typical example is Node-RED ; an open source visual programming tool, implemented by the IBM Emerging Technology organization. Node-RED, is based on Node.js and constitutes a mature visual programming framework that has gained large attention by the IoT community. It ships with a large set of nodes ("building blocks") and allows the programing to be performed in a "drag and drop" way. Deployment of programs implemented this way ("flows") in the runtime can be performed with just a single press of a button. In our prototype implementation, Node-RED constitutes a key component of our proposed solution, that allows a browser-based visual programming of the Smart Cities applications.
However, the fact that Node-RED is based on JavaScript, restricts the type of computations that can be performed. For instance, although there are programming libraries for performing numerical computations in JavaScript such as stdlib , programming languages such as R, Python, Julia [ ] are more popular to perform various data-science related tasks. For that reason, the Node-RED environment was extended with a Python node that allows the execution of Python code inside the Node-RED environment. The node acts a proxy to well-known Python modules and libraries such as To allow for the execution of SPARQL queries to be performed in a generic and graphically coherent way, inside the Node-RED environment, we created a Node-RED node and made it publicly available . The implementation is based on the Python node and on the Python RDFlib module. In addition, we use a MongoDB database for storing the sensor data.

Implementation and Discussion
We implement the scenario described in Section for a specific use case in Lyon, focusing on temperature and humidity as the main characteristics of an individual citizen's environmental situation. To acquire temperature and humidity data for the city of Lyon, the public API of Netatmo is used. Figure illustrates the workflow as implemented in Node-RED. The nodes "Get Netatmo Token" and "Lyon Netatmo" extract temperature and humidity sensor data. To retrieve various points of interest, we make use of the Sophox service , which allows the simultaneous execution of queries both to OpenStreetMap and Wikidata. The query is illustrated in Listing .
A description of the terms used in OpenStreetMap can be found in [ ]. The process is illustrated in the node "OpenStreetMap Query" Finally, all these sensor data are stored in a MongoDB database. To get the citizen's position we use an O-MI call and parse the received response. The process is illustrated in the node "Read O-MI Node" and "Parse O-DF Message". In the next step, the geo-coordinates are extracted ("Extract Geo-coordinates" on Figure ) and the closest POIs that have better environmental position than the place that the user currently is are computed ("Find closest POIs"). The aforementioned action is achieved by running a geospatial query on the MongoDB database. Finally, the result is visualized on Node-RED and can be seen on Figure , In Section , it was briefly discussed how this Smart City application shows the importance of the various Smart Cities enabling technologies that were introduced in Section . Since the focus of this paper is on the IoT interoperability, we will focus in the rest of this section on the importance of using standardized Open APIs and Semantic technologies for the Smart City Applications. Figure already illustrated  providers to the Smart City application. To access the temperature and humidity data, the Netatmo's RESTful API was used which provided the sensor data as JSON payloads. In the case that the coverage of these data were inadequate for the user's location under consideration, more sensor solution providers should be considered by the application. The communication layer as well as the data formats of these systems would be different from the ones used by the Netatmo company. What is more, the terms as well as the semantics of these different data formats may differ too. For that reason, we have chosen to use the Open Messaging Interface as well as the Open Data Format, provided by the Open Group. These allow the application to access the user's data in a common and standardized way. At the same time, it makes the visual programming easier as the communication across different systems can be achieved with only two nodes. On the contrary, each time a new sensor provider should be taken into account special consideration should be given so as to establish the communication.
Moreover, as it was already mentioned in Section , a common semantic layer between the different data payloads is extremely important so as to establish a common understanding. For instance, using different terminology and formatting while representing latitude, longitude and altitude information requires an additional programming effort so as to transform them in a common representation. In parallel, semantically annotated data allow for advanced inferencing and for complex queries across different data sources, as it was illustrated in Listing . It is important to also note that the key enabler that allowed the information fusion between the knowledge graphs of OpenStreetMap and Wikidata was the common way of representing the geo-coordinates information.

Conclusion and Outlook
Semantic and IoT technologies are among the key enabling technologies to tackle the challenges of future citizens, caused by increasing population in urban areas. In this paper, we presented an approach and documented the implementation of a Smart City application, using a visual programming framework and leveraging heterogeneous data sources that conform to open IoT and semantic Web standards. The application allows evaluating the benefits of these technologies in an IoT context. In our future work we will further validate the approach by covering more advanced applications and data sources, including extensive experimentation and evaluation.