1 / 21

Wrappers in Mediator-Based Systems

Wrappers in Mediator-Based Systems. Chapter 21.3 Information Integration Presented By Annie Hii Toderici. Outline. Templates for Query Patterns Wrapper Generators Filters Other Operations at the Wrapper. Extractors in Data Warehouse. Extractors (wrapper) consist of:

Download Presentation

Wrappers in Mediator-Based Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Wrappers in Mediator-Based Systems Chapter 21.3 Information Integration Presented By Annie Hii Toderici

  2. Outline • Templates for Query Patterns • Wrapper Generators • Filters • Other Operations at the Wrapper

  3. Extractors in Data Warehouse • Extractors (wrapper) consist of: • Predefined queries that are executed at the source to produce data for the warehouse • Suitable communication mechanisms • Pass specific queries to the source • Receive responses from the source • Pass information to the warehouse

  4. user query result Warehouse Combiner Extractor Extractor Source 1 Source 2

  5. Wrappers in Mediator Systems • Mediator systems require more complex wrappers than warehouse systems • Must be able to accept a variety of queries from the mediator and translate any of them to the terms of the source

  6. query result Mediator query result query result Wrapper Wrapper query result query result Source 1 Source 2

  7. Wrapper • Wrapper connects a mediator to a source • Wrapper (aka “adapter”) translates incoming queries and outgoing answers • Wrappers are defined by templates • The wrapper generator creates tables of all possible templates • The driver and tables constitute the wrapper

  8. Templates for Query Patterns • Design a wrapper • Classify the possible queries that the mediator can ask into templates • Templates are queries with parameters that represent constants (e.g., red) • Uses the notation T=>S • Template T is turned by the wrapper into the source query S

  9. Templates • Suppose we want to build a wrapper for the source of Dealer 1 • Dealer 1 • Cars(serialNo, model, color, autoTrans, navi, …) • Mediator • AutosMed(serialNo, model, color, autoTrans, dealer)

  10. Template: cars of a given color ($c) • SELECT * FROM AutosMed WHERE color = ‘$c’; => • SELECT serialNo, model, color, autoTrans, ‘dealer1’ FROM Cars WHERE color = ‘$c’;

  11. Templates • Other templates would be needed to deal with other queries • Type of models: parameter $m • Type of transmission: parameter $t • Seat type: parameter $s • N attributes, 2n possible templates • Number of templates could grow unreasonably large, it is possible to simplify

  12. Wrapper Generators • A collection of templates is given to the wrapper generator (WG) • WG creates a table that holds the various query patterns contained in the templates, and the source queries that are associated with each

  13. Queries from mediator Results Templates Driver Table Wrapper generator Queries Result Source

  14. Task of the driver • Accept a query from the mediator • Search the table for a template that matches the query • The source query is sent to the source • The response is processed by the wrapper, and then returned to the mediator

  15. Filters • Not always realistic to write a template for every possible form of query • To have the wrapper filter the results of queries that it poses to the source • The wrapper has a template that returns a superset of what the query wants, then filter the returned tuples at the wrapper and pass only the desired tuples to the mediator

  16. Example Filter: blue Civic SELECT * FROM AutosMed WHERE color = ‘$c’; => SELECT serialNo, model, color, autoTrans, ‘dealer1’ FROM cars WHERE color = ‘$c’; Set $c = ‘blue’ TempAutos(serialNo, model, color, autoTrans, dealer) SELECT * FROM TempAutos WHERE model = ‘Civic’;

  17. Other Operations at the Wrapper • To transform data in other ways • Columns may be projected out of the tuples before transmission to the mediator • To take aggregations or joins at the wrapper and transmit the result to the mediator

  18. Mediator: find blue Civic and retrieve serial #, transmission type and dealers SELECT * FROM AutosMed WHERE color = ‘$c’; => SELECT serialNo, model, color, autoTrans, ‘dealer1’ FROM cars WHERE color = ‘$c’; Set $c = ‘blue’ TempAutos(serialNo, model, color, autoTrans, dealer) SELECT serialNo, autoTrans, dealer FROM TempAutos WHERE model = ‘Civic’;

  19. Examples • Mediator: find dealers s.t there are two red cars of the same model, one manual and one automatic • Query from mediator to wrapper: SELECT A1.model A1.dealer FROM AutosMed A1, AutosMed A2 WHERE A1.model = A2.model AND A1.color = ‘red’ AND A2.color = ‘red’ AND A1.autoTrans = ‘no’ AND A2.autoTrans = ‘yes’;

  20. Example (Continued) • RedAutos(serialNo, model, color, autoTrans, dealer) • SELECT * FROM AutosMed WHERE color = ‘red’; • SELECT DISTINCT A1.model, A1.dealer FROM RedAutos A1, RedAutos A2 WHERE A1.model = A2.model AND A1.autoTrans = ‘no’ AND A2.autoTrans = ‘yes’;

  21. Thank You! • The End!

More Related