4. Data Warehouse Architecture Data source Data source Data source (Relational?) database (warehouse) User queries OLAP / Decision support/ Data mining Extract, Transform, Load (ETL)
5. (Virtual) Mediator Architecture Data source wrapper Data source wrapper Data source wrapper Sources can be: relational, hierarchical (IMS), structured files, web sites. Mediator: User queries Mediated schema Data source catalog Reformulator Optimizer Execution engine
11. Languages for Schema Mapping Modeling Mediated Schema Source Source Source Source Source GAV Q Q’ Q’ Q’ Q’ Q’ LAV GLAV
12.
13.
14.
15.
16.
17.
18. Query Reformulation in GAV: Example (cont.) Q(t, l, s) Movie(t, x, ‘comedy’, y), Plays(t, l, s), s > 20h Q(t, l, s) S1.Movie(MID, t), S1.MovieDetails(MID, x, ‘comedy’, y) , Plays(t, l, s), s > 20h Q(t, l, s) S1.Movie(MID, t), S1.MovieDetails(MID, x, ‘comedy’, y), S2.Cinemas(l, t, s) , s > 20h unfolding F 1 unfolding F 2
19. Query Reformulation in LAV: Example Movie(MID, title,year,genre) Director(MID, director) Actor(MID, actor) Mediated Schema S1.Comedies(m,t,y) …… Movie(m, t, y, ‘comedy’), …… y ≥ 1950 S2.Diractors(m,d) ……. Director(m, d), Actor(m, d) Q(t,y,d) Movie(m,t,y, ‘comedy’), y ≥ 1950, Director(m,d), Actor(m,d) Q’(t,y,d) S1.Comedies(m,t,y), S2.Diractors(m,d) Answering Queries Using Views Algorithm
20.
21.
22.
23.
24.
25. Bucket Algorithm: Example View atoms that can contribute to g 1 : V 1 (ID,year), V 2 (ID,A’), V 4 (ID,D’,year) g 1 g 2 g 3
26. Bucket Algorithm: Example (cont.) V 3 (ID,amount) cannot contribute to g 2 : amount ≥ $200M amount $50M V 4 (ID,D’,year) V 2 (ID,amount) V 2 (ID,A’) V 4 (ID,Dir,Y’) V 1 (ID,Y’) V 1 (ID,year) g 3 g 2 g 1
27. Bucket Algorithm: Example (cont.) V 1 and V 4 are mutually disjoint… V 4 (ID,D’,year) V 2 (ID,amount) V 2 (ID,A’) V 4 (ID,Dir,Y’) V 1 (ID,Y’) V 1 (ID,year) g 3 g 2 g 1
28.
29. The Inverse Rules Algorithm: Example Q(D,A) Director(T, D), Actor(T, A) V 1 (T, Y, D) Movie(T, Y, ‘comedy’), Director(T, D) V 2 (T, A) Movie(T, Y, G), Actor(T, A) f1(T, A) , f2(T, A) : Skolem functions Movie(T, Y, ‘comedy’) V 1 (T, Y, D) Director(T, D) V 1 (T, Y, D) Movie(T, f 1 (T, A) , f 2 (T, A) ) V 2 (T, A) Actor(T, A) V 2 (T, A) Q’ = Q
30. Global-Local-as-View (GLAV) S7 Movies ( MID , title ) MovieDetais ( MID , dir, year ) Q 1 G (t,d,y) Movie(t, d, ‘comedy’, y), y ≥ 1970 Q S7 (t,d,y) Movies(i, t), MovieDetais(i, d, y) Movie: title, director, year, genre Q S7 (t,d,y) Q 1 G (t,d,y)
31.
32.
33.
34. Validation of Mappings between Schemas Guillem Rull Carles Farré Ernest Teniente Toni Urpí
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46. Example 1 referential constraint employee emp-id category happiness-degree category cat-id salary Schema A emp id salary Schema B queries: qA ( E , S ) employee ( E , C , H ) category ( C , S ) qB ( E , S ) emp ( E , S ) qA qB
47.
48.
49. Example 2: Map. Lossleness in terms of Query Liveliness Mapping M is lossless with respect to Q if and only if map_loss is not lively on this schema. Deductive rules: map_loss p ( X ) ¬ p' ( X ) p ( E ) employee ( E , C , H ) qA ( E , S ) employee ( E , C , H ) H > 5 category ( C , S ) qB ( E , S ) emp ( E , S ) p' ( E ) employee' ( E , C , H ) qA' ( E , S ) employee' ( E , C , H ) H > 5 category' ( C , S ) DR A DR B DR A ' Constraints : employee ( E , C , H ) S category ( C , S ) employee' ( E , C , H ) S category' ( C , S ) qA ( X , Y ) qA' ( X , Y ) qA' ( X , Y ) qA ( X , Y ) qA ( X , Y ) qB ( X , Y ) IC A IC A ' IC L IC M