## 4 Semantic Management Component
### Get MappingSuggestion Service
For the operations within the mapping process, a graph theory apparatus is used, which allows handling nodes (called vertices) and relationships (called edges). For further convenience, the term \"concept\" is used as equivalent to \"node\" (a graph DB term) and \"vertices\" (a graph theory term), and \"relationship\" is used as equivalent to \"edges\" (a graph theory term). Before applying [PERSON]'s algorithm, we need to formulate concept pairs. In other words, ordered pairs of concepts are built from subsets A and B in order to set source (subset A) and target (subset B) concepts for path finding. To perform mapping between the origin data model and the target data model, a Cartesian product between the origin data model, defined as set A containing elements \(\{a_{1},\,a_{2},\,...,\,a_{\text{m}}\}\), and the target data model, defined as set B with elements \(\{b_{1},\,b_{2},\,...,\,b_{\text{m}}\}\), is built. The Cartesian product for origin and target data models gives:  
\[A\times B=\{(a,\,b)\mid a\in A,\,b\in B\}, \tag{2}\]  
_i.e., \(A\times B=\{(a_{1},\,b_{1}),\,(a_{1},b_{2}),\ldots,(a_{1},b_{n}),(a_{2},\,b_{ 1}),(a_{2},b_{2}),\ldots,(a_{2},\,b_{n}),\ldots,(a_{m},b_{1})  
path \(p\in P\) from \(a_{1}\) to \(b_{1}\) in \(G\) is a list of edges ((\(V_{0}\), \(V_{1}\)), (\(V_{1}\), \(V_{2}\)),..., (\(V_{k-1}\), \(V_{k}\))), where \(V_{0}=(a_{1})\) and \(V_{k}=(b_{1})\), and \(k\) is the total number of concepts that are part of the path (see illustration in Figure 4). The resulting weight of the path is the sum of the weights of all relationships and is calculated as follows [46]:  
\[w(p)=\sum_{i=0}^{k-1}w(v_{i},\ v_{i+1}). \tag{7}\]  
The number of resulting paths can vary, but for the current implementation, we have chosen four for each concept in the origin submodel. Each path built from origin to target concept is called a suggestion. As only four suggestions are required, the resulting graph includes a maximum of four subgraphs, based on the distance parameter. In the theory of semantics, this parameter can be described as the semantic distance and defined as the shortest path connecting two concepts. For instance, for \(a_{1}\) and \(b_{1}\)[47]:  
\[d(a_{1},b_{1})=\min\{w(p):p=((v_{0},v_{1}),(v_{1},v_{2})\,\ldots,(v_{k-1},v_{k})),\ \forall i:(v_{i-1},v_{i})\in e,a_{1}=v_{0},b_{1}=v_{k}\}. \tag{8}\]  
Thus, after the mapping process is accomplished, the result can be represented through a graph that consists of a set of subgraphs representing the suggestions for each of the origin concepts  
\[G=(G_{a_{1}},G_{a_{2}},\ldots,G_{a_{m}}), \tag{9}\]  
where \(m\) is the number of origin concepts, and \(G_{a_{1}},G_{a_{2}},\ldots,G_{a_{m}}\) are the graphs containing suggested paths for the corresponding origin concepts. The suggestions or suggested paths contain the set of concepts, relationships, and weights  
\[G_{a_{1}}=(V_{a_{1}},\ E_{a_{1}},\ w_{a_{1}}),\ G_{a_{2}}=(V_{a_{2}},\ E_{a_{2}},\ w_{a_{2}}),\ldots,\ G_{a_{m}}=(V_{a_{m}},\ E_{a_{m}},\ w_{a_{m}}). \tag{10}\]  
(Note: if no path exists between the source and target concepts, the result is nil.) If the service getMappingSuggestions is called again, and the input is the same as in the previous time or contains some common connected vertices, the weight of the relationship between the inputs decreases. This enables a dynamic approach to evaluate the semantic distance, compared to [11], for instance, where the authors also consider a semantic distance, but the value of each relationship is static and equal to 1. The static weight of a relationship means that the semantic distance cannot vary regarding the number of cases in which the concept was used with the related counterpart. Instead, we consider that the importance or \"closeness\" between interrelated concepts grows with each run of the getMappingSuggestion service with repeated relationships inside the input. An example can be coffee and cake.