# MEBN-RM: A Mapping between Multi-Entity Bayesian Network and Relational Model
## 2 Background
### Relational Model  
In 1969, [PERSON] proposed the Relational Model (RM) as a database model based on first-order predicate logic [41; 42; 43]. The RM is the most popular database model. A relational database (RDB) is a database that uses the RM to describe and organize data. In the RM, data are organized as a collection of relations. A relation is an abstract definition of a class of entities or a relationship that can hold between classes of entities. An instance of a relation is depicted as a table in which each column is an attribute of the relation and each row, also called a tuple, contains the value of each attribute for an individual entity of the class represented by the relation. An entry in the table, called a cell, is the value of the attribute associated with the column for the entity associated with the row. A key for a relation is one or more attributes that uniquely identify a particular domain entity or row. A primary key uniquely identifies the individual entities in the relation. A foreign key points to the primary key in another relation. The cardinality of a relation is the number of rows in the table, i.e., the number of unique entities of the type represented by the relation. The degree of the relation is the number of columns in the table, i.e., the number of attributes of entities of the type represented by the relation. Figure 2 shows an illustrative example of an RDB. In the example RDB, there are three relations: _Vehicle_, _Region_, and _VehicleLocation_. We could imagine different situations, each with different vehicles, regions, etc. Each particular situation, such as the one depicted in Figure 2, corresponds to an instance of this relational model. The instance is represented as a table for each of the relations as shown Figure 2, where the columns represent attributes of the relation and the rows represent the attribute values for specific entities. For example, the relation _Vehicle_ has two attributes: _VehicleID_, which uniquely identifies each individual vehicle, and _VehicleClass_, which indicates whether the vehicle is tracked or wheeled. The relation _VehicleLocation_ has three attributes: _LocatingVehicleID_, _LocatingTimeID_, and _Location_. The attribute _LocatingVehicleID_ in the relation _VehicleLocation_ is a foreign key pointing to the primary key of the relation _Vehicle_. A row of the relation _VehicleLocation_ represents a vehicle being located in a region at a point in time. Attributes that are part of the primary key of the relation (e.g., _LocatingVehicleID_ and _LocatingTimeID_ in the relation _Location_) are denoted by bold, italicized, and underlined letters, while foreign keys which are not part of the primary key of the relation in which  
Figure 2: Part of Script MTheory for Danger Assessment. the foreign keys are used (e.g., Location in the relation _VehicleLocation_) are denoted by underlined letters. A relation without instances or data--that is, an empty table - is called the _relation schema_. Hereinafter, for MEBN-RM, we define the elements of RM formally. **Definition 5** (Relation schema). : _A relation schema, \(RS[A_{1}\):\(D_{1}\), \(A_{2}\):\(D_{2}\),..., \(A_{n}\):\(D_{n}\), is a set of pairs \(A_{i}\):\(D_{i}\), where \(A_{1}\)\(\
eq\)...\(\
eq\)\(A_{n}\) are attribute names, and \(D_{i}\) is a set called the domain for an attribute \(i\)._  
For example, the relation schema of _Vehicle_ in Figure 2 is [_VehicleID_:{v1, v2,...}, VehicleClass:{wheeled, tracked}], where _VehicleID_ and VehicleClass are attributes with domains {v1, v2,...} and wheeled, tracked, respectively. Please note that we denote the domain of the attribute by inserting the colon, \":\", between the name of the attribute and the name of the domain. This ancillary information can be omitted for brevity (e.g., [_VehicleID_, VehicleClass]).