Presentation is loading. Please wait.

Presentation is loading. Please wait.

LegoDB XML-to-Relational Mapping using LegoDB Dustin Anderson CSC560 a way to map XML Schema structures to relational tables.

Similar presentations


Presentation on theme: "LegoDB XML-to-Relational Mapping using LegoDB Dustin Anderson CSC560 a way to map XML Schema structures to relational tables."— Presentation transcript:

1 LegoDB XML-to-Relational Mapping using LegoDB Dustin Anderson CSC560 a way to map XML Schema structures to relational tables

2 Rewrite as P-Schema p-schemaRewrite the XML Schema more simply, but syntactically equivalent : p-schema P-schemas contain data statistics which can be mapped into relations, and allow the XML-to-relational mappings to take place

3 Stratify Types stratifyUsing a grammar, stratify the types (this allows LegoDB to work with structured & semistructured data in the same way) TypeRepresentationStratification Physical Singleton elements, nested singleton elements, optional types Mapped to columns != null OptionalOptional nested elements Mapped to columns null Named Only named types to ensure regex do not contain nested elements Only used for foreign key generation & to keep track of child- parent relationships

4 Map P-Schemas map them to relationsNow that the physical types are stratified, map them to relations: 1. Create one relation for each element 2. For each relation, create a key that will store the identifiers of all parent elements 3. For each relation, create an attribute for each inlined subelement 4. If the element is optional, then the corresponding column can contain a null value

5 Generate New P-Schemas XML-to-XML transformationsLegoDB uses a subset of p-schemas that are derived from XML-to-XML transformations: 1. Inlining/outlining 2. Repetition merge/split 3. Wildcards rewriting 4. Union factorization/distribution 5. From union to options

6 Inlining: Transformation Example type TV = seasons [ Integer ], Description, Episode* Type Description = description [ String ] type TV = seasons [ Integer ], description [ String ], Episode*

7 Selecting the “Best” over all the transformationsThe LegoDB algorithm works by exploring the space of the “interesting” possible XML-to-relational mappings over all the transformations GREEDY algorithm that looks at each potential mapping’s: »given statistics (data type sizes, minimum/maximum values, number of distinct values) »query workloads (a set of sample queries and their “importance”)

8 GREEDY LegoDB XML-to-XML 1. Any possible XML-to-XML transformation (rewriting) is applied to the p-schema, resulting in a new p-schema

9 GREEDY LegoDB XML-to-relational new 2. XML-to-relational transformations are applied to the new p-schema and resulting relational schema (mapping), on which given queries are tested and the performance estimated Keep the “best” one every step. one every step.

10 ankYou! Thank You! M.C. Escher - Relativity Philip Bohannon, Juliana Freire, Prasan Roy, Jérôme Siméon: From XML Schema to Relations: A Cost-Based Approach to XML Storage. ICDE 2002: 64-75


Download ppt "LegoDB XML-to-Relational Mapping using LegoDB Dustin Anderson CSC560 a way to map XML Schema structures to relational tables."

Similar presentations


Ads by Google