# MEBN-RM: A Mapping between Multi-Entity Bayesian Network and Relational Model
## 2 Background
### Multi-Entity Bayesian Network
A node in a common BN represents a single random variable, whereas a node in an MFrag represents a collection of RVs: those formed by replacing the ordinary variables with identifiers of entity instances that  
Figure 1: Danger Assessment MTheory. satisfy the context conditions. To emphasize the distinction, we call the resident nodes MEBN nodes, or MNodes. MNodes correspond to predicates (for true/false RVs) or terms (for other RVs) of FOL. An MNode is written as a predicate or a term followed by a parenthesized list of ordinary variables as arguments. **Definition 2** (**MNode**). : _An MNode \(N\), or MEBN Node, is a random variable N(ff) corresponding to an n-ary function or predicate of FOL, a list of n arguments consisting of ordinary variables, a set of mutually exclusive and collectively exhaustive possible values, and an associated CLD. The special values true and false are the possible values for predicates, but may not be possible values for functions._  
The RVs associated with the MNode are constructed by substituting domain entities for the \(n\) arguments of the function or predicate. The CLD specifies how to define local distributions for these RVs. For example, the node _VehicleClass(obj)_ in Figure 1 is an MNode corresponding to the FOL function _VehicleClass(obj)_. It has two possible values (i.e., Wheeled and Tracked). This MNode is associated with the class local distribution \(L^{C}\) in Listing 1. The MNode is used as a template for the distributions of instance RVs created when an SSBN is constructed from the MFrag associated with the MNode. These instances are formed by substituting identifiers of vehicle objects for the ordinary variable _obj_. **Definition 3** (**MTheory**). : _An MTheory M, or MEBN Theory, is a collection of MFrags that satisfies conditions given in [48] ensuring the existence of a unique joint distribution over its RVs._  
An MTheory is a collection of MFrags that defines a consistent joint distribution over RVs describing a domain. The MFrags forming an MTheory should be mutually consistent. To ensure consistency, conditions must be satisfied, such as _no-cycle_, _bounded causal depth_, _unique home MFrags_, and _recursive specification condition_[48]. No-cycle means that the generated SSBN will contain no directed cycles. Bounded causal depth means that depth from a root node to a leaf node of an instance SSBN should be finite. Unique home MFrags means that each random variable has its distribution defined in a single MFrag, called its home MFrag. Recursive specification means that MEBN provides a means for defining the distribution for an RV depending on an ordered ordinary variable from previous instances of the RV. The _IsA_ random variable is a special RV representing the type of an entity. IsA is commonly used as a context node to specify the type of entity that can be substituted for an ordinary variable in an MNode. **Definition 4** (**IsA Random Variable**). : _An IsA random variable, IsA(ov, tp), is an RV corresponding to a 2-argument FOL predicate. The IsA RV has value true when its second argument tp is filled by the type of its first argument ov and false otherwise._  
For example, in the MFrag _Danger_ in Figure 1, _IsA(obj, VEHICLE)_ is an IsA_ RV. Its first argument _obj_ is filled by an entity instance and its second argument is the type symbol Vehicle. It has value true when its first argument is filled by an object of the type Vehicle.