{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Publish Smart Home Sensor Data using SWT\n", "Lecturer: **Georg Ferdinand Schneider**, [RG](https://www.researchgate.net/profile/Georg_Schneider3) \n", "\n", "### Problem Description\n", "\n", "Smart home systems are increasingly used in residential flats and buildings. Mostly these systems increase the comfort of a home either by improving indoor air quality, thermal comfort or integrate multimedia applications in the system. A tremendous amount of data is produced by these systems and it is difficult to integrate data from different systems, as typically vendors and communication protocols differ.\n", "\n", "Linked Building Data (LBD) may provide a remedy to the interoperability problems stemming from this multi-vendor, multi-protocol and multi-domain setting. In this coding challenge you will research what possibilities exist to integrate sensor data obtained from smart home systems with other data using Semantic Web Technologies.\n", "\n", "### Research Questions\n", "\n", "* RQ1: What possibilities exist to publish observations of sensors using SWT?\n", "* RQ2: How can the sensor data be linked to additional data sources available on the web (e.g. weather services)?\n", "* RQ3: What best practices and recommendations exist for the storage of large amounts time series data in SWT?\n", "\n", "### Dataset\n", "\n", "The Open Smart Home data set [1] is a data set obtained from a real smart home. It is composed of static data describing a real residential flat situated in Nürnberg, Germany and dynamic data, i.e. time series, obtained from real sensors and actuators placed in the residential flat.\n", "\n", "A number of ontologies exist in the smart home domain, which may serve as a starting point [3,4]. Also a strong set of recommended standards to publish sensor and acutator data on the web exists [5].\n", "\n", "### Tools\n", "\n", "Check the influx DB [https://www.influxdata.com/](https://www.influxdata.com/), which is a database specifically design to store time series data or the RDF to relational data bases (R2RDB) mapping [6] as implemented in the Ontop tool [https://github.com/ontop/ontop](https://github.com/ontop/ontop).\n", "\n", "### References\n", "\n", "[1] Schneider, G. F., Rasmussen, M. H., Bonsma, P., Oraskari, J., & Pauwels, P. (2018). *Linked building data for modular building information modelling of a smart home*. In 11th European Conference on Product and Process Modelling (pp. 407-414). CRC Press.\n", "\n", "[2] Schneider, G. F., Rasmussen, M. H., Bonsma, P., Oraskari, J., & Pauwels, P. (2019). *Open Smart Home Data Set*. DOI: [10.5281/zenodo.1244602](https://doi.org/10.5281/zenodo.1244602) [https://github.com/TechnicalBuildingSystems/OpenSmartHomeData](https://github.com/TechnicalBuildingSystems/OpenSmartHomeData), Last accessed: 11 May 2019.\n", "\n", "[3] G. F. Schneider. *Chapter 2.4.2 - Ontology-based Modelling of Building Automation Systems* in Semantic Modelling of Control Logic in Automation Systems - Knowledge-Based Support of the Engineering and Operation of Control Logic in Building and Industrial Automation Systems. Fakultät für Maschinenbau, Karlsruher Institut für Technologie (KIT), Karlsruhe, DOI: [10.5445/IR/1000092405](https://doi.org/10.1016/10.5445/IR/1000092405).\n", "\n", "[4] P. Pauwels, S. Zhang, and Y.-C. Lee. *Semantic web technologies in AEC industry: A literature overview*. Automation in Construction, 73:145–165, 2017, DOI: [10.1016/j.autcon.2016.10.003](https://doi.org/10.1016/j.autcon.2016.10.003)\n", "\n", "[5] A. Haller, J. Krzystof, S. Cox, D. le Phuoc, K. Taylor, and M. Lefrancois. Semantic\n", "Sensor Network Ontology. Permanent URL: [https://www.w3.org/TR/vocab-ssn/](https://www.w3.org/TR/vocab-ssn/), 2017. Recommendation, World Wide Web Consortium (W3C), Cambridge, USA.\n", "\n", "[6] Calvanese, D., Cogrel, B., Komla-Ebri, S., Kontchakov, R., Lanti, D., Rezk, M., ... & Xiao, G. (2017). *Ontop: Answering SPARQL queries over relational databases*. Semantic Web, 8(3), 471-487." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You may have a glimpse on the data within this notebook. All CSV files containing the time series of measuremens can be obtained [here](https://github.com/TechnicalBuildingSystems/OpenSmartHomeData/tree/master/Measurements).\n", "\n", "For instance the sensor reading of the brightness sensor placed to a wall in the bathroom is stored in file **Bathroom_Brightness.csv** starting with the following readings:\n", "\n", "```\n", "1489017527\t0\n", "1489041538\t0.92\n", "1489042143\t2.75\n", "1489042749\t5.49\n", "1489043354\t10.07\n", "```\n", "\n", "For instance the first reading has been measured at the following date converted from UNIX time:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "At 2017-03-08 23:58:47 a value of 0 lux is measured by the brightness sensor in the bathroom\n" ] } ], "source": [ "import time\n", "\n", "convertedTime = time.strftime( \"%Y-%m-%d %H:%M:%S\", time.localtime( 1489017527 ) )\n", "\n", "print( \"At \" , convertedTime , \" a value of 0 lux is measured by the brightness sensor in the bathroom\" )\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }