# Applying Knowledge Inference on Event-Conjunction for Automatic Control in Smart Building
## 4 Proposal and Experiment
### Knowledge Database  
Spatial and functional relationships inside buildings could be considered as being graphical. In this research, our goal is not to develop a new ontology for modeling the building structure, but to show how IoT collaboration platforms in smart buildings leveraging semantic technologies could implement some global knowledge inference functions for automatic control. Therefore, to comply with and take full advantage of existing standard works in this field, the Building Topology Ontology (BOT) was imported. The BOT is an OWL-DL ontology [23] for defining both the physical and semantic relationships of the sub-components inside a building. It was used to describe the semantic schema such as the physical relationships, functionality parameters inside the building, of whom the data set was static. As shown in Figure 4a, high-level concepts of node hierarchies have been defined by BOT. It was composed of: classes (e.g., Building, Space, etc.) for representing a spatial entity; properties (e.g., has_storey, has_space, interface_of, etc.) for representing the relations between entities; rules (e.g., wall could be modeled as an interface of two rooms; door within a wall could be modeled as a tuple of <wall, has_element, door>). According to the BOT ontology, the corresponding triplets (representing the entities and relationships) of our building have been created. We referred the classes of BOT, i.g, site, building, zone, space, element, etc. The details have been described as follows. * Site: An area contains one or more buildings, that further could be used in the field of city area computing. * Building: Building node assembles all the sub-nodes within the building. Thus the whole context inside the building could be referenced through the building node. * Storey: A level/floor part of the building. * Zone: Elevator and stairwells are modeled as a Zone, used as links of multiple storeys through the BOT:intersectsZone relation. * Space: A part of a storey, whose 3D spatial extent is bounded actually or theoretically. In general, it represents a common space, e.g., a room, an elevator hall, toilet, corridor, and so on. The space node assembles all the elements (i.g., sensor, actuator, device) located within it. * Element: Sensor, actuator, device were defined as element nodes deployed in space. For each element, an identifier of 'ucode' has been assigned for associating the dynamic sensor observations through the unified API. \begin{table}
\begin{tabular}{l l} \hline \hline Sensor/device & The meaning of binary state value (1/0) \\ Human detector & human-detected; otherwise \\ Light & on; off \\ Fan & on; off \\ Air conditioner & on; off \\ Elevator\_potion & 3F, 2F, 1F, B1F, B2F \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Data value examples of the unified API. As shown in Figure 4b, aiming to interconnecting heterogeneous devices for further efficient reasoning and heuristics, the model was hierarchically structured along with the building architecture. We consider the graph-based hierarchical structure of the model fits the building structure for the reasoning strategy because the indoor users' motion trace follows the features and layouts of the building. The model that is on representing hierarchy in the building and it fits bottom-up data collection and decomposition. Also, the model follows ordinary building designs that make it practicable for almost all the common buildings. RDF Data Store and Sparql Query Language  
We separated the static ontology and dynamic sensing data into RDF store and relational database store. Spatial relationships were constructed by a BOT graph. Meanwhile, sensor nodes (which were described as Element in the BOT) are continuously submitting data in real-time that causes the data store to be large and get updated frequently. We chose a relational database to store the sensor data. Those two data stores were associated with the unique identification of 'ucode'.