# MEBN-RM: A Mapping between Multi-Entity Bayesian Network and Relational Model
###### Abstract
PR-OWL, a semantic web language associated with probability, can be used as a common language for the Internet of Things (IoT) [38] and the Web of Things (WoT) [39]. IoT is a network composed of a group of physical systems that interact with each other over the Internet using sensors, actuators, and computing devices. WoT is an extension of IoT by including virtual systems (i.e., the Internet Web) to deliver services to stakeholders. [PERSON] et al. [40] used PR-OWL as a representation formalism specifically representing watering system situations in a WoT architecture. The paper showed that the sensor data obtained through IoT can be used to predict the humidity of the ground to support decision making of watering. This paper focuses on the _RM_, from which MEBN theories can be partially constructed. The Relational Model (RM) [41; 42; 43] is the most popular database model. While non-relational databases, called _NoSQL_, are receiving increasing attention [44], our focus in this work is on RM because so much of the available data is stored in relational databases. A _Relational Database_ (RDB) uses RM to describe and organize data. An RDB stores data in the form of multiple relations. A _relation_ is composed of a _relation schema_ and a _relation instance_. The relation schema represents a class of entities and its attributes. A relational database schema or _relational schema_ is a collection of relation schemas. An MEBN model, called an _MTheory_, consists of a set of _MFrags_. An MFrag is composed of _Context nodes_, _Input nodes_, _Resident nodes_, a _fragment graph_, and a set of _Local Distributions_. To construct an MTheory from an RDB, we need a way to map from relations to MFrags. In this paper, we introduce a mapping between a relational schema and a partial MTheory. This mapping is called MEBN-RM mapping (or _MEBN-RM_). MEBN-RM contains four levels of mapping from elements of a relational database to elements of an MTheory. The first level maps a relation schema to an entity in an MTheory. The second level maps attributes of a relation schema to resident nodes of an MFrag. The third maps a relation schema to an MFrag is defined. The fourth level maps a relational database to an MTheory. Furthermore, MEBN-RM forms the basis for a _MEBN-RM mapping algorithm_ takes a relational database as input and produces a partial MTheory as output. The main contribution of this paper is to introduce the set of mapping definitions and the MEBN-RM mapping algorithm, which can be the basis for developing MEBN theories in manual approaches (e.g., [37]) or automatic approaches (e.g., [45; 46; 47]). In addition, we present an MEBN-RM open-source software tool that is implemented in the Java programming language and performs MEBN-RM. The remainder of the paper is organized as follows. Section 2 provides background knowledge of MEBN and RM. Section 3 defines MEBN-RM and presents the mapping algorithm. Section 4 introduces the MEBN-RM open-source software tool and an experiment for MEBN-RM algorithm performance in terms of the mapping time and accuracy. Section 5 presents two use cases in which the tool is applied to construct a partial MTheory. The final section presents conclusions and future research directions.