Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by: Kai Zhu Professor: Dr. T.Y. Lin Class ID: 220

Similar presentations


Presentation on theme: "Presented by: Kai Zhu Professor: Dr. T.Y. Lin Class ID: 220"— Presentation transcript:

1 Presented by: Kai Zhu Professor: Dr. T.Y. Lin Class ID: 220
Chapter Information Integration Wrappers in Mediator-Based Systems Presented by: Kai Zhu Professor: Dr. T.Y. Lin Class ID: 220

2 Intro Templates for Query patterns Wrapper Generator Filter

3 More complicated than that in most data warehouse system.
Wrappers in Mediator-based Systems More complicated than that in most data warehouse system. Able to accept a variety of queries from the mediator and translate them to the terms of the source. Communicate the result to the mediator.

4 How to design a wrapper? Classify the possible queries that the mediator can ask into templates, which are queries with parameters that represent constants. Simplest way to see a wrapper is like a translator.

5 Templates for Query Patterns:
Use notation T=>S to express the idea that the template T is turned by the wrapper into the source query S.

6 Example 1 Dealer 1 Cars (serialNo, model, color, autoTrans, navi,…)
For use by a mediator with schema AutoMed (serialNo, model, color, autoTrans, dealer)

7 We denote the code representing that color by the parameter $c, then the template will be:
SELECT * FROM AutosMed WHERE color = ’$c’; => SELECT serialNo, model, color, autoTrans, ’dealer1’ FROM Cars WHERE color=’$c’; (Template T => Source query S)

8 There will be total 2n templates if we have the option of specifying n attributes.

9 Wrapper Generators The wrapper generator creates a table holds the various query patterns contained in the templates. The source queries that are associated with each.

10 A driver is used in each wrapper, the task of the driver is to:
Accept a query from the mediator. Search the table for a template that matches the query. The source query is sent to the source, again using a “plug-in” communication mechanism. The response is processed by the wrapper.

11 Filter Not always possible to have a wrapper that can translate a query into another query to get exact results Filters can then be used on a bigger result set to only return wanted results.

12 Example 2 If wrapper is designed with more complicated template with queries specify both model and color. SELECT * FROM AutosMed WHERE model = ’$m’ AND color = ’$c’; => SELECT serialNo, model, color, autoTrans, ’dealer1’ FROM Cars WHERE model = ’$m’ AND color=’$c’;

13 Now we suppose the only template we have is color
Now we suppose the only template we have is color. However the wrapper is asked by the Mediator to find “blue Gobi model car.”

14 Solution: 1. Use template with $c=‘blue’ find all blue cars and store them in a temporary relation: TemAutos (serialNo, model, color, autoTrans, dealer) 2.The wrapper would then return to the mediator the desired set of automobiles by executing the local query(filter): SELECT* FROM TemAutos WHERE model= ’Gobi’;

15 Thank you


Download ppt "Presented by: Kai Zhu Professor: Dr. T.Y. Lin Class ID: 220"

Similar presentations


Ads by Google