
6c46c62e8043a72c74c67ffc910666c5.ppt
- Количество слайдов: 31
A CASE Tool for Designing XML Views Yabing Chen, Tok Wang Ling, Mong Li Lee May, 2002
Contents 1. 2. 3. 4. 5. 6. 7. Introduction Preliminaries Architecture of the CASE tool An illustrating example Related work Conclusion Q&A
Part 1. Introduction
Introduction n XML – e. Xtensible Markup Language XML Views An introduction to the CASE tool – XVS
Introduction XML – e. Xtensible Markup Language n n XML – originally a document markup language. XML – now standard for publishing and exchanging data on the web. XML – enforces explicit structuring. XML – suitable for express more structured data.
Introduction XML Views n XML views are analogous to Relational views. n n n They provide logical data independence that masks changes in the conceptual schemas. They also increase the flexibility of a database that allows multiple users to see the data in different ways. XML Views are implemented as an mediator on top of the database. n n Rlational database, such as Oracle 9 i, SQL Sever. Native XML database, such Software AG Tamino.
Introduction An introduction to the CASE tool - XVS n n n XVS – XML Views System. a novel case tool for designing XML views. Provides for a graphical views design facility. Validates all designed views. Stores XML data in an object-relational database.
Part 2. Preliminaries
Preliminaries n n ORA-SS data model View Definition Language
Preliminaries ORA-SS data model n n n ORA-SS – Object-Relationship-Attribute Semi Structured data model. Three basic concepts: object classes, relationship types and attributes. Object class – an entity type in ER diagram or an element in XML. Relationship type – indicate existing semantic relationships among object classes. Attributes – properties, may belong to object classes or relationship types.
Preliminaries ORA-SS data model (cont. ) n n n An object class – a labeled rectangle. A relationship type – (name, n, p, c) An attribute – a labeled circle.
Preliminaries ORA-SS data model (cont. ) n ORA-SS – A semantically rich data model. n n n Reflects nested structure of semistructured data. Distinguishes between object classes, relationship types and attributes. Distinguishes between attributes of relationship types and attributes of object classes. Such semantics is essential for designing valid XML views and efficient storage. However, existing data model cannot support such semantics.
Preliminaries View Definition Language n n W 3 C standard – XQuery. We adopt FLWR expression to define views. FLWR expression – For, Let, Where and Return clauses. We also adopt XQuery as the query language to query views.
Part 3. Architecture of the CASE tool
Architecture of the CASE tool Figure 3. The Architecture of the CASE tool
Architecture of the CASE tool Modules of our system n Transform/Enrich ORA-SS. n n n Design graphical view schema. n n This module takes an XML document and generates the corresponding ORA-SS graphical schema diagram. It also allows users to enrich the ORA-SS schema diagram to add necessary semantic information for XML views design. This module allows users to graphically design views over source schema. Generate view definition. n This module generates a view definition in FLWR expression from the graphical view schema.
Architecture of the CASE tool Modules of our system (cont. ) n Query Rewrite n n Generate XML result n n n This module rewrite a XQuery over the view into SQL query over the source database. This module tags the resulting table returned by SQL query. Then it generates the resulting XML document. Materialize view n This module executes the XQuery expression in the view definition and generates the view documents.
Part 4. An illustrating example
An illustrating example 1. 2. 3. Mapping XML document to ORA-SS schema diagram Defining views Rewriting XQuery
An illustrating example 1. Mapping XML document to ORA-SS schema diagram n Transform an XML document to ORA-SS <db> <project jno=”j 001”> <supplier sno=“s 001”> <part pno=“p 001”> <price> 100</price> </part> </supplier> <supplier sno=“s 002”> <part pno=“p 001”> <price> 100</price> </part> </supplier> </project> </db> Figure 4. An XML document on project, supplier and part Figure 5. The ORA-SS schema diagram of the XML document
An illustrating example 1. Mapping XML document to ORA-SS schema diagram n Enrich the ORA-SS schema with semantics. Figure 5. The ORA-SS schema diagram of the XML document Figure 6. The ORA-SS schema diagram enriched with semantics
An illustrating example 2. Defining views n Designing a view by selecting, dropping or restructuring on the ORA-SS schema.
An illustrating example 2. Defining views (cont. ) n Mapping the view schema to a view definition in XQuery expression. Create View As swap-supplier-part For $j In document("spj. xml")//project Return <project jno={$j/@jno}> { for $pn In distinct($j//part/@pno) Return <part pno={$pn}> { For $s In $j/supplier[part/@pno=$pn] Return <supplier sno={$s/@sno}> { For $p In $s/part[@pno=$pn] Return <price> {$p/price/text()} </price> } </supplier> } </part> } </project> Figure 10. The View definition in XQuery expression The mapping process may be divided into two steps: • Mapping the view schema to an intermediary view definition, which is generated according to the operation on the view schema. • Mapping the intermediary definition to the view definition in XQuery expression.
An illustrating example 3. Rewriting XQuery n n Users may issue an XQuery on the views. The following query retrieves all suppliers that supply part “p 001” in project “j 001” For $s In view(“swap-supplierpart”)//project[@jno=”j 001”]/part[@pn o=”p 001”]/supplier Return <supplier sno={$s/@sno}> {$s/price} </supplier> Figure 11. An XQuery on the view Select supplier. sno supplier_part. price From supplier, supplier_part , spj Where spj. jno=’j 001’ and spj. pno=’p 001’ and supplier. sno=spj. sno and supplier_part. sno=supplier. sno and supplier_part. pno=’p 001’ Figure 12. The rewritten SQL query
An illustrating example 3. Rewriting XQuery (cont. ) n n We will first get the resulting table shown in figure 12. After tagging, we will get the XML document shown in figure 13. Sno price S 001 100 S 002 100 tagging <result> <supplier sno="s 001"> <price>100</price> </supplier> <supplier sno="s 002"> <price>100</price> </supplier> </result> Figure 12. The result in table form Figure 13. The result in XML form
Part 5. Related Work
Related Work Active. Views system & MIX system n Active. Views system. n n MIX system. n n n Adopt XML as the data model to define view. Every view is presented as an object. A view includes not only data, but also method. It provides a virtual view of underlying heterogeneous sources. It adopts XML DTD as the data model. Most other works export relational data as XML views, such as XPERANTO, etc, .
Related Work Comparison Active. Views system [AAC+99] MIX system [BGL+99] XVS (our system) Data model XML DTD ORA-SS Storage O 2 system N/A ORDBMS View definition language OQL-style language XMAS language XQuery language Lorel language XMAS language XQuery language No No Yes No No Yes Validation of views Support projection, join and restructuring of views Support graphical views design
Part 6. Conclusion
Conclusion n n A CASE tool for XML views – XVS Preliminaries n n n Novel features n n n ORA-SS as the data model. XQuery as the view language. More flexible XML views. More operation such as projection, join and restructuring. Validating XML views. Future work n n Query optimization View update
Q&A
6c46c62e8043a72c74c67ffc910666c5.ppt