Line 72: | Line 72: | ||
why? | why? | ||
− | * | + | * <math>\text{FOL}(M_2) \equiv \forall S, C, U \ \Big[ S_2.\text{Erasmus}(S, C, U) \ \Rightarrow \ \exists \ P, U' \ : \ \text{EuropeanStudent}(S)</math> <math>\ \land \ \text{EnrolledInCourse}(S,C) \ \land \ |
− | \text{PartOf}(C,P) | + | \text{PartOf}(C,P)</math> <math>\ \land \ \text{OfferedBy}(P,U) |
− | \ \land \ \text{EuropeanUniversity}(U)$ $\ \land \ \text{RegisteredTo}(S, U') \ \land \ U \neq U' \Big] | + | \ \land \ \text{EuropeanUniversity}(U)$ $\ \land \ \text{RegisteredTo}(S, U') \ \land \ U \neq U' \Big]</math> |
* so, from fact $S_2.\text{Erasmus}(s, v_2, v_3)$ it follows that $\exists \ s, U' \ : \ \text{RegisteredTo}(s,U')$ | * so, from fact $S_2.\text{Erasmus}(s, v_2, v_3)$ it follows that $\exists \ s, U' \ : \ \text{RegisteredTo}(s,U')$ | ||
* $\exists \ s \ : \ \text{RegisteredTo}(s, x)$, where $x$ is fixed is strictly weaker | * $\exists \ s \ : \ \text{RegisteredTo}(s, x)$, where $x$ is fixed is strictly weaker | ||
Line 153: | Line 153: | ||
* $r_1$ is not a valid rewriting of $Q$ | * $r_1$ is not a valid rewriting of $Q$ | ||
* expand $r_1$: | * expand $r_1$: | ||
− | ** | + | ** <math>\begin{array}{l l} |
− | \begin{array}{l l} | + | |
\text{Exp} \big[ r_1(x) \big] \leftarrow & \text{NonEuropeanStudent}(s), \text{Program}(v_1), \\ | \text{Exp} \big[ r_1(x) \big] \leftarrow & \text{NonEuropeanStudent}(s), \text{Program}(v_1), \\ | ||
& \text{EnrolledInProgram}(s,v_1), \text{OfferedBy}(v_1,x), \\ | & \text{EnrolledInProgram}(s,v_1), \text{OfferedBy}(v_1,x), \\ | ||
Line 163: | Line 162: | ||
& \text{Program}(v_4), \text{OfferedBy}(v_4,v_3), \\ | & \text{Program}(v_4), \text{OfferedBy}(v_4,v_3), \\ | ||
& \text{OfferedBy}(v_5,v_3), \text{MasterProgram}(v_5) \\ | & \text{OfferedBy}(v_5,v_3), \text{MasterProgram}(v_5) \\ | ||
− | \end{array} | + | \end{array}</math> |
− | + | ||
* Now check the containment: | * Now check the containment: | ||
* the following is the canonical database $D_{r_1(x)}$ for $\text{Exp} \big[ r_1(x) \big]$ | * the following is the canonical database $D_{r_1(x)}$ for $\text{Exp} \big[ r_1(x) \big]$ | ||
Line 177: | Line 175: | ||
The final result is | The final result is | ||
* the union of all valid rewritings | * the union of all valid rewritings | ||
− | |||
Line 188: | Line 185: | ||
== Sources == | == Sources == | ||
− | * Web Data Management book | + | * [[Web Data Management (book)]] |
[[Category:Data Integration]] | [[Category:Data Integration]] |
This is an approach for query rewriting used in LAV Mediation
3 steps
A atom $G$ of global query $Q$ is satisfied by local data if
A matching between $G$ and atom $R_j$ of some mapping $M_i$ says
Need some extra constraints to guarantee that $G$ can be logically inferred:
Consider this LAV mapping:
Global Query:
$Q(x) \leftarrow \underbrace{\text{RegisteredTo}(s, x)}_\text{(1)}, \underbrace{\text{EnrolledInProgram}(s, p)}_\text{(2)}, \underbrace{\text{MasterProgram}(p)}_\text{(3)}.$
Consider an atom $G \equiv (1)$
For example, $M_3$
Consider mapping $M_2$
why?
Bucket($G$, $Q$, $M$):
Theorem:
Example
Obtain candidates
Expanding a rewriting $R$:
Validation Algo:
We obtained these rewritings:
Validation
The final result is