XPERANTO: A Middleware for Publishing Object-Relational Data as XML Documents Michael Carey Daniela Florescu Zachary Ives Ying Lu Jayavel Shanmugasundaram Eugene Shekita Subbu Subramanian
Outline Motivation XPERANTO Architecture Query Processing Conclusion
XML Example Addison-Wesley Timbuktu
What is the big deal about XML? Elegantly models complex, hierarchical/ graph-structured data Domain-specific tags (unlike HTML) Simple! Fast emerging as dominant standard for data exchange on the WWW
Why Object-Relational Data? Most business data stored in object-relational databases Unlikely to change in the near future –Scalability, Reliability, Performance, Tools Need flexible and efficient way to publish object-relational data as XML
Book BookIdBookName 1843 Selfish Ev.. Author BookId FirstNameLastName 1843 CharlesDarwin 1843RichardDawkins Publisher PubId PubName 20 Addison-Wesley 39Prentice-Hall Address Timbuktu USA PubId Ice Station AlistarMcLean Price
XML View for Partners Addison-Wesley Prentice-Hall
Allow Partners to Query View Get books written by Darwin WHERE Darwin ELEMENT_AS $b IN BooksXMLView CONSTRUCT $b
The Problem O-R DBMS The Internet Queryable XML Views XML QueryXML Results
Outline Motivation XPERANTO Architecture Query Processing Conclusion
What is XPERANTO? Xml Publishing of Entities, Relationships ANd Typed Objects Middleware providing queryable XML views over any object-relational database
XPERANTO Guiding Principles Future web application developers may not adore SQL like we do (unbelievable!!!) Allows them to create and use XML views in pure XML terms –Default XML view of ORDBMS –Can create more complex views using XML query language
Book BookIdBookName 1843 Selfish Ev.. Author BookId FirstNameLastName 1843 CharlesDarwin 1843RichardDawkins Publisher PubId PubName 20 Addison-Wesley 39Prentice-Hall Address Timbuktu USA PubId Ice Station AlistarMcLean Price
Default XML View 1843 Selfish Evolution Ice Station Zebra … … …
Creating an XPERANTO View CREATE VIEW BooksXMLView As WHERE $bid $bname $pid $bprice IN DefaultXMLView CONSTRUCT {WHERE $pid $pname IN DefaultXMLView CONSTRUCT $pname } {WHERE $bid $fn $ln IN DefaultXMLView CONSTRUCT }
Query Processing in XPERANTO ORDBMS Query Parser Query Rewrite SQL Translation XML Tagging Query over XML ViewXML Result XQGM SQL Query Relational result XPERANTO
Outline Motivation XPERANTO Architecture Query Processing –XQGM –View composition –SQL generation –Data/Meta-data querying Conclusion
XQGM Xml Query Graph Model General language neutral representation –Replacing XML-QL with Quilt should be easy (we think!) Extension of DB2’s QGM
Why extend QGM? Many query language operations are the same (e.g., select, join, aggregation) Can support sophisticated SQL functionality (e.g., universal quantification) Borrow existing techniques from industrial strength system Natural translation to SQL
QGM Extensions New types for XML elements and attributes New functions to create and navigate them –CreateXMLElement Tag name Attribute list Sub-element list –GetXMLSubElements XML element
Outline Motivation XPERANTO Architecture Query Processing –XQGM –View composition –SQL generation and Tagging –Data/Meta-data querying Conclusion
View Composition Eliminate unnecessary XML element and attribute construction Done using equivalences Example: GetSubElements(CreateElement(tags, atts, subelems)) = subelems
Outline Motivation XPERANTO Architecture Query Processing –XQGM –View composition –SQL generation and Tagging –Data/Meta-data querying Conclusion
SQL Generation and Tagging Use “Sorted Outer Union” approach –Shown to be efficient and stable [VLDB 2000] Generate single SQL query to get the content in document order Tag in constant space inside/outside the engine All computation/memory intensive processing done inside ORDBMS
Outline Motivation XPERANTO Architecture Query Processing –XQGM –View composition –SQL generation and Tagging –Data/Meta-data querying Conclusion
Addison-Wesley BookIdBookName 1843 Selfish Ev.. Author BookId FirstNameLastName 1843 CharlesDarwin 1843RichardDawkins Price AlistarMcLean Discount 10% Prentice Hall BookIdBookName 6509 Ice Station.. Price 9.00 Tax 5%
XML View for Partners Addison-Wesley Prentice-Hall
Query over XML View Send me books written by publishers A-D WHERE $pn ELEMENT_AS $b, “A” < $pn, $pn < “D” IN BooksXMLView CONSTRUCT $b
Outline Motivation XPERANTO Architecture Query Processing –XQGM –View composition –SQL generation and Tagging –Data/Meta-data querying Conclusion
Important to provide queryable XML views over object-relational DBMSs XPERANTO is middleware providing this functionality –Pure XML philosophy (“Look Ma, no SQL!”) –Data/Meta-data query support –Harnesses ORDBMS query engine
Future Work Constructing recursive structures Extensions for order Updateable/insertable views
Related Work SilkRoute [Fernandez et. al.] –Concurrent project –Middleware providing queryable XML views Differences –Pure XML philosophy –Query data/meta-data –Pushing processing inside relational engine –Object-relational structures
XPERANTO Architecture Views XML Schema O-R Database SQL Query Processor Stored TablesSystem Catalog Metadata Services View Services Type & Table Services Query Translation XQGM XML-QL Parser XQGM Query Rewrite SQL Translation XML Schema Generator Catalog Info XML Tagger Data Tuples Table & Type Info SQL Queries