1 / 16

SilkRoute: A Framework for Publishing Relational Data in XML

SilkRoute: A Framework for Publishing Relational Data in XML. Mary Fernández , AT&T Labs - Research Dan Suciu, Univ. of Washington Yada Kadiyska, Univ. of Washington Atsuyuki Morishima, Univ. of Tsukuba Wang-Chiew Tan, Univ. of Pennsylvania. XML-Relational Middleware.

Download Presentation

SilkRoute: A Framework for Publishing Relational Data in XML

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. SilkRoute: A Framework for Publishing Relational Data in XML Mary Fernández, AT&T Labs - Research Dan Suciu, Univ. of Washington Yada Kadiyska, Univ. of Washington Atsuyuki Morishima, Univ. of Tsukuba Wang-Chiew Tan, Univ. of Pennsylvania

  2. XML-Relational Middleware • XML: Standard, flexible syntax for exchanging data • Lingua franca of B2B Applications • Industry defines common XML vocabulary • Document Type Descriptions (DTDs) or XML Schema • Contract between data producers & consumers • Reflects application domain • XML-Relational Middleware • Key business data in RDBMS • Glue between existing business data & application • Characteristics: General, dynamic, efficient • SilkRoute : A Reference Framework

  3. XML Data Management API or Query Legacy Database XML XML XML Persistent Database XML Producer XML Consumer XML Documents & Schemas Publish XML XML Interfaces Store XML

  4. Clothing Supplier & Reseller • Shared XML Schema element supplier { element company, element product* } element company { xs:string } element product { element name, element category, element retail, element sale?, element reports* } element name { xs:string } element category { xs:string } element retail { attribute cur { xs:string }, xs:float } element sale { xs:float } <supplier> <company>ACME Clothing</company> <product> <name>Suede jacket</name> <category>outerwear</category> <retail cur=“USD”>325.00</retail> <sale cur=“USD”>225.00</sale> </product> <product> <name>Rain boots</name> <category>outerwear</category> <retail cur=“USD”>45.00</retail> <sale cur=“USD”>22.50</sale> <report code=“defective”>leaks in heel</sale> <report code=“defective”>heel separates</sale> </product> </supplier>

  5. Viewing and Querying XML Application Query ? ? • Most data in relational database • Suppliers’ goal: Define XML view of data • General: support many XML Schemas • Efficient: leverage relational database Public Query = ( ) ? Supplier Database Application

  6. Viewing and Querying XML ? ° ? = ? ? ? ? • Brokers’ goal: Uniform access Dynamic: Access up-to-date, minimal result = ( ) Supplier database Application ) ( =

  7. SilkRoute Framework • General, declarative view-definition language • Public Query in XQuery Maps relational data to public XML view + Support many output XML Schemas • Dynamic querying of XML views • Application Query in XQuery Maps public XML data to application’s view • Query composition algorithm + Underlying storage should be transparent to user + Access up-to-date, minimal result • Efficient use of relational engine • Query decomposition algorithm Selects query execution plan (one or more SQL queries) Uses relational engine’s cost estimates to guide search + Leverage power of relational query engine

  8. Canonical XML View <Clothing> <Tuple> <pid>001</pid> <item>Suede jacket</item> <category>outerwear</category> <description>Hip length</description> <price>325.00</price> <cost>175.00</cost> </Tuple> <Tuple> <pid>002</pid> <item>Rain boots</item> <category>outerwear</category> <description>Ankle height</description> <price>45.00</price> <cost>19.99</cost> </Tuple> </Clothing> Clothing(pid, item, category, description, price, cost) : { <001, “Suede Jacket”, “outerwear”,”Hip length”, 325.00, 175.00>, <002, “Rain boots”, “outerwear”, “Ankle height”, 45.00, 19.99> } Discount(pid, discount) : { <001, 0.70>, <002, 0.50> } • Oracle 9i XSQL Canonical XML View Use XSLT (out of engine) to transform canonical XML

  9. Canonical & Public Views <supplier> <company>ACME Clothing</company> <product> <name>Suede jacket</name> <category>outerwear</category> <retail cur=“USD”>325.00</retail> <sale cur=“USD”>225.00</sale> </product> <product> <name>Rain boots</name> <category>outerwear</category> <retail cur=“USD”>45.00</retail> <sale cur=“USD”>22.50</sale> <report code=“defective”>leaks in heel</sale> <report code=“defective”>heel separates</sale> </product> </supplier> <Clothing> <Tuple> <pid>001</pid> <item>Suede jacket</item> <category>outerwear</category> <description>Hip length</description> <price>325.00</price> <cost>175.00</cost> </Tuple> <Tuple> <pid>002</pid> <item>Rain boots</item> <category>outerwear</category> <description>Ankle height</description> <price>45.00</price> <cost>19.99</cost> </Tuple> </Clothing>

  10. XQuery • Strongly typed, functional XML query language • Large-scale database access • Must guarantee safety/correctness of operations on data • Compositional: XML to XML • Q1(Q2(D)) = (Q1 o Q2)(D) • XQuery 1.0 = XPath 2.0 (path, arithmetic, logical expressions) + for-let-where-orderby-return (FLWOR) XML construction + User-defined (recursive) functions + Strong typing

  11. Public View Query ? • Public view query expressed in XQuery • Includes all XQuery expressions Except recursive functions, features that depend on document order <supplier><company>ACME Clothing</company> { for $c in $CanonicalView/Clothing/Tuple where $c/category = “outerwear” return <product> <name>{ data($c/item) }</name> <category>{ data($c/category) }</category> <retail cur=“USD”>{ data($c/price) }</retail> </product> { for $d in $CanonicalView/Discount/Tuple where $d/pid = $c/pid return <sale cur=“USD”>{ $d/discount * $c/price } </sale> } } </supplier> • Type checking guarantees view conforms to public schema

  12. Application Query ? • Application query expressed in XQuery for $s in $PublicView/supplier return <supplier> <name>{ data($s/name) } </name> <discounted> { for $p in $s/product where $p/sale < 0.5 * $p/retail return <product>{ data($p/name) }</product> } </discounted> </supplier> • Type checking guarantees application query correct w.r.t. public schema

  13. SilkRoute Architecture ? ? ? ? ? ? Internet/Intranet SilkRoute Relational Engine XML Generator Application View Forest Composer View Forest Decomposer • All modules process view forests Representation of all views: canonical, public, application Maps relational data to XML document

  14. Query Decomposition ? ? for$c in $CanonicalView/Clothing/Tuple where $c/category = “outerwear” return <product> <name>{ data($c/item) }</name> <category>{ data($c/category) }</> <retail>{ data($c/price) }</retail> </product> <product> <name>item</name> <category>category</category> <retail>price</retail> </product> SELECT $c.pid as pid, $c.item as item, $c.category as category, $c.price as price FROMClothing $c WHERE $c.category = “outerwear” • View query may decompose into multiple SQL queries • Use greedy algorithm (with help from RDBMS) to choose decomposition

  15. Related Systems • Commercial Systems • Oracle 9i – canonical mapping • IBM DB2 XML Extender – annotated schema • Microsoft SQL Server – universal relation, annotated schema (To date), none support full XQuery SQL Server supports XPath • (Quasi) Research Systems • Xperanto (IBM Almaden) – now a product • Rolex, PRATA (Bell Labs)

  16. Summary • XML Publishing Systems • Workhorses of B2B applications • Key characteristics: General, dynamic, efficient • Commercial Systems • Oracle, IBM DB2, Microsoft SQL Server • Some, but not all, of key characteristics • SilkRoute : A Reference Framework • General, declarative mappings from relations to XML • Query composition & decomposition • Establishes link between XQuery & SQL • Prototype (re-)implementation (JDBC-compliant database)

More Related