160 likes | 288 Views
INFORMATION INTEGRATION. Presenter: Namrata Buddhadev (104_224_21.6.1-21.6.7) Professor: Dr T Y Lin. Index. 21.6 Local-as-View Mediators 21.6.1 Motivation for LAV Mediators 21.6.2 Terminology for LAV Mediators 21.6.3 Expanding Solutions
E N D
INFORMATION INTEGRATION Presenter: Namrata Buddhadev (104_224_21.6.1-21.6.7) Professor: Dr T Y Lin
Index • 21.6 Local-as-View Mediators 21.6.1 Motivation for LAV Mediators 21.6.2 Terminology for LAV Mediators 21.6.3 Expanding Solutions 21.6.4 Containment of Conjunctive Queries 21.6.5 Why the Containment-Mapping Test Works 21.6.6 Finding Solutions to a Mediator Query 21.6.7 Why the LMSS Theorem Holds
Local-as-ViewMediators • GAV: Global as view mediators are like view, it doesn’t exist physically, but piece of it are constructed by the mediator by asking queries • LAV: Local as view mediators, defines the global predicates at the mediator, but we do not define these predicates as views of the source of data • Global expressions are defined for each source involving global predicates that describe the tuple that source is able to produce and queries are answered at mediator by discovering all possible ways to construct the query using the views provided by sources
Motivation for LAV Mediators • LAV mediators help us to discover how and when to use that source in a given query Example: Par(c,p)-> GAV of Par(c,p) gives information about the child and parent but does not give information of grandparents • LAV Par(c,p) will help to get information of chlid-parent and even grandparent • Sometimes the relationship between what the mediator should provide and what the sources provide is more subtle.
Terminology for LAV Mediation • It is in form of logic that serves as the language for defining views. • Datalog is used which will remain common for the queries of mediator and source which is known as Conjunctive query. • LAV has global predicates which are the subgoals of mediator queries • Conjunctive queries defines the views which has unique view predicate and that view has Global predicates and associated with particular view.
Example: Par(c,p)->Global predicate view defined by conjunctive query: • V1(c,p)<- Par(c,p) • Another source produces: V2(c,g)<-Par(c,p) AND Par(p,g) • Query at the mediator ask for great grandparents facts: • Q(w,z)<-Par(w,x) AND Par(x,y) AND Par(y,z) • Or Q(w,z)<-V1(w,x) AND V2(x,z) • Or Q(w,z)<-V2(w,y) AND V1(y,z)
ExpandingSolutions • Query Q, Solution S, Sub goals : V(a1,a2,..,an)[can be same] V(b1,b2,..,bn)<-B (Entire Body)[distinct], we can replace V(a1,..an) in solution S by a version of body B that has the sub goals of B with variables possibly altered. Rules: • Find local variables of B which are there in the body but not in the head, we can replace any local variables within the conjunctive query if it does not appear elsewhere in the conjunctive query.
If there are any local variables of B that appear in B or in S, replace each one by a distinct new variable that appears nowhere in V or in S. • In the body B, replace each bi, by ai, for i=1,2,..n. • Example: V(a,b,c,d)<-E(a,b,x,y) AND F(x,y,c,d) here for V, x and y are local so, x, y->e, f so, V(a,b,c,d)<-E(a,b,e,f) AND F(e,f,c,d) a,d ->x, b->y and c->1 V(x,y,1,x) has two subgoals E(x,y,e,f) and F(e,f,1,x).
Containment of Conjunctive Queries • Conjunctive query S be the solution to the mediator Q, Expansion of S->E, produces same answers that Q produces, so, E subset Q. • A containment mapping from Q to E is function Γ(x) is the ith argument of the head E. • Add to Γ the rule that Γ(c) =c for any constant c. IF P(x1,x2,..xn) is a subgoal of Q, then P(Γ(x1), Γ(x2),.., Γ(xn)) is a subgoal of E.
Example: • Queries: P1: H(x,y)<-A(x,z) AND A(z,y) P2: H(a,b)<-A(a,c) AND A(c,d) AND A(d,b) consider Γ(x)=a and Γ(y)=b, first subgoal A(x,z) can only map to A(a,c) of P2. 1. Γ(z) must be C as A(x,z) can map A(a,c) of P2. 2. Γ(z) must be d as Γ(y)=b, subgoal A(z,y) of P1 becomes A(d,b) in P2. So, no containment mapping from P! and P2 exists.
Complexity of the containment Mapping Test : It is NP-complete to decide whether there is an containment mapping from one conjunctive query to another. • Importance of containment mappings is expressed by the theorem: If Q1 and A2 are conjunctive queries, then Q2 is subset or equal to Q1, if and only if there is a containment mapping from Q1 and Q2.
WhyContainmentMappingTestWorks: • Questions: • If there is containment mapping, why must there be a containment of conjunctive queries? • If there is containment, why must there be a containment mapping?
FindingSolutionstoaMediatorQuery • Query Q, solutions S, Expansion E of S is contained in Q. “If a query Q has n subgoals, then any answer produced by any solution is also produced by a solution that has at most n subgoals. This is known by LMSS Theorem If the conjunctive query that defines a view V has in its body a predicate P that doesn’t appear in the body of the mediator query, then we need not consider any solution that uses V.
Example: • Q1: Q(w,z)<-Par(w,x) AND Par(x,y) AND Par(y,z) S1: Q(w,z)<-V1(w,x) AND V2(x,z) S2: Q(w,z)<-V1(w,x) AND V2(x,z) AND V1(t,u) AND V2(u,v) by LMSS, E2: Q(w,z)<-Par(w,x) AND Par(x,p) AND Par(t,u) AND Par(u,q) AND Par(q,v) and E2 is subset or equal to E1 using containment mapping that sends each vairable of E1 to the same variable in E2.
Why the LMSS Theorem Holds • Query Q with n subgoals and S with n subgoals, E of S must be contained in query Q, E is expansion of Q. • S’ must be the solution got after removing all subgoals from S those are not the target of Q. • E subset or equal to Q and also E’ is the expansion of S’. • So, S is subser of S’ : identity mapping. • Thus there is no need for solution s among the solution S among the solutions to query Q.