# SemKoRe: Improving Machine Maintenance in Industrial IoT with Semantic Knowledge Graphs
## 6 SemKoRe Implementation
### Implementation Details  
To demonstrate the feasibility of the SemKoRe approach, we developed a proof-of-concept (Figure 7) using the following technologies:  
* GraphDB: We used GraphDB [29] as triplestore in the cloud and in the gateway. It provides high performance and scalability in addition to the reasoning capabilities. * Node-Red : Node-Red was used to develop all above-mentioned services for the SemKoRe Server and the SemKoRe Agent. Node-Red is a flow-based development tool for visual programming originally developed by IBM for wiring together hardware devices, APIs (Application Programming Interfaces) and online services as part of the Internet of Things [30]. Node-Red is gaining popularity for rapid application development in Schneider's Industrial Automation business. * Microsoft Azure: The SemKoRe Server services are hosted on Microsoft Azure, which provides high-performance cloud services. The server uses Azure IoT Hub [31] to connect the IoT devices to the cloud using several communication protocols, including the MQTT (Message Queuing Telemetry Transport) messaging protocol [32], which we used to simplify the data flow transmission between our SemKoRe agent and server services. For the edge, the Azure IoT Edge service was used to easily connect the edge gateways to the cloud via Azure IoT Hub as shown in Figure 7.
* Docker: This is a popular container-based virtualization [33] tool. Docker supports many operating systems and hardware architectures, and allows self contained applications to be packaged and executed with a high level of portability and reproducible results [34]. We used Docker to package all of the services of SemKoRe Server and SemKoRe Agent. In reality SemaKoRe agent will reside with many other components. Docker allows us to have the flexibility of deploying different components easily and manage/extend them without impacting others. As we are still in early stage, we were not able to implement the SemKoRe in real conditions with SemKoRe Agent running on Industrial Gateways connected to real machines. The main obstacle was that the current hardware available for this work had ARM architecture and so it would require a significant effort to port the triplestore and other software components. That effort was beyond the scope of our work. However, after the successful PoC, the business team decided to use an industrial PC as a gateway with enough RAM (8 GB), processing (Intel Atom) and storage (64 GB) capability. The next iteration of this work will use this industrial PC when it is ready for commercialization. In the meantime, we evaluated our implementation by simulating many virtual SemKoRe Agent instances on a PC equipped with an Intel(R) Core(TM) i7-7820 HQ processor, and 16 Gb of RAM. We used a single GraphDB server to manage separate triplestores for all the SemKoRe Agent instances. We randomly defined a set of three machine types [Packaging Machine, Palletizing Machine, Pasteurization Machine]  
Figure 7: SemKoRe implementation setup. Simulated virtual edge gateways with SemKoRe Agents managed by a SemKoRe server instance hosted on the Microsoft Azure cloud. that we associated to the active SemKoRe Agents. Each machine type was associated with at least two SemKoRe Agent instances which were then connected to the cloud SemKoRe Server. Our current implementation choices will facilitate an easy transition to industrial PCs in future. We generated random machine failure data by defining a set of potential failures for each machine type. Each failure was then associated to a set of potential characteristics: symptoms, impacts, root causes and solving procedures. For each machine failure occurrence, we randomly picked one of the potential failures of the machine, and then picked a random number of the failure characteristics from the predefined sets. We were able to demonstrate that the failure data were collected by each SemKoRe Agent and successfully shared with the SemKoRe Server.