## 4 Semantic Super-Peer Data Cloud
### Semantic Data Exchange Between SPs  
Semantic data exchange between super-peers is the problem of taking a data structure under a source schema of a \(\textit{TLD}_{\alpha}\) and creating an instance of a target schema of a \(\textit{TLD}_{\beta}\) that reflects the source data as accurately as possible. A semantic data exchange setting \((S_{\alpha},T_{\beta},\sum_{st},\sum_{t})\) consists of a source schema \(\mathsf{S}_{\alpha}\), a target schema \(\mathsf{T}_{\beta}\), a set of source-to-target dependencies \(\sum_{st}\), and a set of target dependencies \(\sum_{t}\). \(\sum_{st}\) is a _tuple-generating dependency_ (tgd). This is a super-peer semantic schema mapping assertion between \(\textit{TLD}_{\alpha}\) and \(\textit{TLD}_{\beta}\), described as Formula (2) in Section 4.2. Moreover, each target dependency in \(\sum_{t}\) is either a _tuple-generating dependency_ (tgd) or an _equality-generating dependency_ (egd) [18]. Let \(\sum\) be a set of tgds over a fixed schema. A set of tgds is _weakly acyclic_ if the dependency graph hasno cycle going through dot-line special edges (see Figures 3 and 4). This guarantees that the chase (or query) from target and source schemas will be terminated in polynomial time.  
One of the source-to-target dependencies \(\sum_{st}\) from the source schema of personal flight information to the target schema of personal medical information is described as follows (see Figure 3):  
A source-to-target dependency:  
\[\begin{split}\sum_{st}=\{\texttt{PersonalFlightInfo}(?\texttt{n},? \texttt{na},?\texttt{a},?\texttt{p},?\texttt{pa},?\texttt{f})\longrightarrow \\ \exists\texttt{D}\,\exists\,\texttt{I}\,\exists\,\texttt{D}_{ \texttt{o}}\,\exists\,\texttt{M}.\texttt{PersonalMedicalInfo}(?\texttt{n},? \texttt{na},\texttt{D},\texttt{I},\texttt{D}_{\texttt{0}},\texttt{M})\\ \wedge\exists\,\texttt{IRN}\,\exists\,\texttt{IRT}.\texttt{ InformedRecord}(\texttt{D}_{\texttt{o}},\texttt{IRN},\texttt{IRT})\}\end{split} \tag{3}\]  
A target dependency:  
\[\begin{split}\sum_{t}=\{\texttt{InformedRecord}(?\texttt{do},? \texttt{irn},?\texttt{irt})\longrightarrow\\ \exists\,\texttt{N}\,\exists\,\texttt{N}\,\exists\,\texttt{D}\, \exists\,\texttt{I}\,\exists\,\texttt{M}.\texttt{PersonalMedicalInfo}(N,\texttt{ Na},\texttt{D},\texttt{I},?\texttt{do},\texttt{M}),\\ \texttt{PersonalMedicalInfo}(?\texttt{n},?\texttt{na},?\texttt{d},? \texttt{i},?\texttt{do},?\texttt{m})\longrightarrow\\ \exists\,\texttt{IRN}\,\exists\,\texttt{IRT}.\texttt{ InformedRecord}(?\texttt{do},\texttt{IRN},\texttt{IRT})\}\end{split} \tag{4}\]  
A set of weakly acyclic target dependencies \(\sum_{t}\) from the target schema of InformedRecord to the target schema of PersonalMedicalInfo is shown as (see Figure 4):  
Figure 3: A source-to-target dependency \(\sum_{st}\) is defined from the source schema of personal flight information to the target schema of medical information.  
In Section 3.1, we have proposed a pandemic investigation scenario, in which Taiwan CDC officers enforced national security laws to trace the original source of H1N1 carriers, who possibly took inbound flights from a recent pandemic area. We first query the target schema of a personal medical information ontology using Formula (4). It is weakly acyclic; thus, the chase procedure for personal medical information with H1N1 disease will be terminated in polynomial time. Then, we query the instances of personal flight information at the source schema through the source-to-target dependency \(\sum_{st}\) described by Formula (3). Semantic data exchange services ensure that both semantic data interoperability and law-compliant criteria are satisfied at the virtual legal domain created for the super-peer \(sp_{\alpha\cap\beta}\), where a law-aware guardian \(agent_{\alpha\cap\beta}\) at the \(sp_{\alpha\cap\beta}\) is empowered by unifying the semantic legal policies offered by \(agent_{\beta}\) and \(agent_{\alpha}\) from their respective \(sp_{\beta}\) and \(sp_{\alpha}\) nodes. For more details see Section 6.