1 Automatic Generation of XQuery View Definitions from ORA-SS Views Ya Bing Chen Tok Wang Ling Mong Li Lee School of Computing National University of Singapore.

Slides:



Advertisements
Similar presentations
Ting Chen, Jiaheng Lu, Tok Wang Ling
Advertisements

Symmetrically Exploiting XML Shuohao Zhang and Curtis Dyreson School of E.E. and Computer Science Washington State University Pullman, Washington, USA.
XML Data Management 8. XQuery Werner Nutt. Requirements for an XML Query Language David Maier, W3C XML Query Requirements: Closedness: output must be.
XML: Extensible Markup Language
XML May 3 rd, XQuery Based on Quilt (which is based on XML-QL) Check out the W3C web site for the latest. XML Query data model –Ordered !
Processing XML Keyword Search by Constructing Effective Structured Queries Jianxin Li, Chengfei Liu, Rui Zhou and Bo Ning Swinburne University of Technology,
Efficient Keyword Search for Smallest LCAs in XML Database Yu Xu Department of Computer Science & Engineering University of California, San Diego Yannis.
Designing Functional Dependencies For XML Mong Li LEE, Tok Wang LING, Wai Lup LOW EDBT 2002.
Tamino – a DBMS Designed for XML Dr. Harald Schoning Presenter: Wenhui Li University of Ottawa Instructed by: Dr. Mengchi Liu Carleton University.
1 Resolving Structural Conflicts in the Integration of XML Schemas: A Semantic Approach Xia Yang Mong Li Lee Tok Wang Ling National University of Singapore.
Paper by: A. Balmin, T. Eliaz, J. Hornibrook, L. Lim, G. M. Lohman, D. Simmen, M. Wang, C. Zhang Slides and Presentation By: Justin Weaver.
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
Web-site Management System Strudel Presented by: LAKHLIFI Houda Instructor: Dr. Haddouti.
Visual Web Information Extraction With Lixto Robert Baumgartner Sergio Flesca Georg Gottlob.
XML Views El Hazoui Ilias Supervised by: Dr. Haddouti Advanced XML data management.
Query Languages Aswin Yedlapalli. XML Query data model Document is viewed as a labeled tree with nodes Successors of node may be : - an ordered sequence.
1 COS 425: Database and Information Management Systems XML and information exchange.
Inbal Yahav A Framework for Using Materialized XPath Views in XML Query Processing VLDB ‘04 DB Seminar, Spring 2005 By: Andrey Balmin Fatma Ozcan Kevin.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
Managing XML and Semistructured Data Lecture 1: Preliminaries and Overview Prof. Dan Suciu Spring 2001.
Automatic Data Ramon Lawrence University of Manitoba
CIS607, Fall 2005 Semantic Information Integration Article Name: Clio Grows Up: From Research Prototype to Industrial Tool Name: DH(Dong Hwi) kwak Date:
1 The ORA-SS Approach for Designing Semistructured Databases Xiaoying Wu, Tok Wang Ling, Mong Li Lee National University of Singapore Gillian Dobbie University.
Tok Wang Ling1 Mong Li Lee1 Gillian Dobbie2
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
4/20/2017.
OMAP: An Implemented Framework for Automatically Aligning OWL Ontologies SWAP, December, 2005 Raphaël Troncy, Umberto Straccia ISTI-CNR
1 XDO2: A Deductive Object-Oriented Query Language for XML Wei Zhang 1, Tok Wang Ling 1, Zhuo Chen 1, and Gillian Dobbie 2 School of Computing National.
XML: Extensible Markup Language FST-UMAC Gong Zhiguo.
IS432: Semi-Structured Data Dr. Azeddine Chikh. 1. Semi Structured Data Object Exchange Model.
XML-to-Relational Schema Mapping Algorithm ODTDMap Speaker: Artem Chebotko* Wayne State University Joint work with Mustafa Atay,
Cooperative Query Answering for Semistructured data Michael Barg Raymond K. Wong Reviewed by SwethaJack Christian (Absent) Chris.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
1 Designing Valid XML Views Ya Bing Chen, Tok Wang Ling, Mong Li Lee Department of Computer Science National University of Singapore.
Selective and Authentic Third-Party distribution of XML Documents - Yashaswini Harsha Kumar - Netaji Mandava (Oct 16 th 2006)
Lecture 21 XML querying. 2 XSL (eXtensible Stylesheet Language) In HTML, default styling is built into browsers as tag set for HTML is predefined and.
Lecture 6 of Advanced Databases XML Schema, Querying & Transformation Instructor: Mr.Ahmed Al Astal.
TDDD43 XML and RDF Slides based on slides by Lena Strömbäck and Fang Wei-Kleiner 1.
Database Technical Session By: Prof. Adarsh Patel.
Graph Data Management Lab, School of Computer Science gdm.fudan.edu.cn XMLSnippet: A Coding Assistant for XML Configuration Snippet.
1 On View Support for a Native XML DBMS Ting Chen, Tok Wang Ling School of Computing, National University of Singapore Daofeng Luo, Xiaofeng Meng Information.
1 Maintaining Semantics in the Design of Valid and Reversible SemiStructured Views Yabing Chen, Tok Wang Ling, Mong Li Lee Department of Computer Science.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Querying Structured Text in an XML Database By Xuemei Luo.
VLDB'02, Aug 20 Efficient Structural Joins on Indexed XML1 Efficient Structural Joins on Indexed XML Documents Shu-Yao Chien, Zografoula Vagena, Donghui.
RRXS Redundancy reducing XML storage in relations O. MERT ERKUŞ A. ONUR DOĞUÇ
Database Systems Part VII: XML Querying Software School of Hunan University
5/2/20051 XML Data Management Yaw-Huei Chen Department of Computer Science and Information Engineering National Chiayi University.
1 Le Thi Thu Thuy*, Doan Dai Duong*, Virendrakumar C. Bhavsar* and Harold Boley** * Faculty of Computer Science, University of New Brunswick, Fredericton,
[ Part III of The XML seminar ] Presenter: Xiaogeng Zhao A Introduction of XQL.
Web-site Building Methodologies Current Research.
XML and Database.
1 M ATERIALIZED V IEW M AINTENANCE FOR THE X ML D OCUMENTS Yuan Fa, Yabing Chen, Tok Wang Ling, Ting Chen Yuan Fa, Yabing Chen, Tok Wang Ling, Ting Chen.
1 Resolving Schematic Discrepancy in the Integration of Entity-Relationship Schemas Qi He Tok Wang Ling Dept. of Computer Science School of Computing National.
Dec. 13, 2002 WISE2002 Processing XML View Queries Including User-defined Foreign Functions on Relational Databases Yoshiharu Ishikawa Jun Kawada Hiroyuki.
1 A Semantic Approach to Rewriting Queries for Integrated XML Data Xia Yang 1, Mong Li Lee 1, Tok Wang Ling 1, Gillian Dobbie 2 1 School of Computing,
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
1 Storing and Maintaining Semistructured Data Efficiently in an Object- Relational Database Mo Yuanying and Ling Tok Wang.
Data Resource Management Data Concepts Database Management Types of Databases Chapter 5 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
1 Efficient Processing of Partially Specified Twig Queries Junfeng Zhou Renmin University of China.
Wenyue Du, Mong Li Lee, Tok Wang Ling Department of Computer Science School of Computing National University of Singapore {duwenyue, leeml,
1 Representing and Reasoning on XML Documents: A Description Logic Approach D. Calvanese, G. D. Giacomo, M. Lenzerini Presented by Daisy Yutao Guo University.
Conceptual Modeling for XML Data
XML: Extensible Markup Language
Chapter 2 Database System Concepts and Architecture
Databases and Information Management
SilkRoute: A Framework for Publishing Rational Data in XML
Databases and Information Management
Databases and Information Management
Presentation transcript:

1 Automatic Generation of XQuery View Definitions from ORA-SS Views Ya Bing Chen Tok Wang Ling Mong Li Lee School of Computing National University of Singapore

2 Outline Introduction ORA-SS Data Model Motivating Example Generation of XQuery View Definitions Conclusion

3 Part 1. Introduction

4 Introduction to XML XML  Publish data on the Web  Exchange data for Internet-based business applications XML Views  Secure the source data  Provide application-specific views of the source data

5 Related Works SilkRoute [14]  Export relational data into XML  Complex – two different languages to define and query XML views over relational data respectively XPERANTO [6]  Export relational data into XML and evaluate XML queries over XML views of relational data  Ignore semantics in defining XML views Xyleme [11]  Define XML views over XML data based on DTD with selection and join operators, etc,.  Do not support complex XML views such as involving swap operators ActiveView [3]  Define views with active features (method calls & triggers) over XML repository  Do not support semantics checking

6 Related works Major commercial databases Oracle 9i [22] Export relational data to materialized XML views using SQLX, XSQL or XML SQL Utility (XSU) Microsoft SQL Server [21] Create XML view of existing relational data using XML Schema IBM DB2 [23] (XTABLE – derived from XPERANTO [6]) Define XML views of relational tables with XQuery  Difficult to write view definitions

7 Motivation In related works  Ignore semantics in source data  Useful for validate XML views  Difficult to use languages to define XML views  Long and complex  Hard to understand A novel approach proposed in this paper  Adopt a semantically-rich data model – ORA-SS  Automatically generate view definitions in query expression from ORA-SS views

8 Part 2. ORA-SS Data Model

9 Concepts Object class  An entity type in Entity-Relationship  An element in XML documents Relationship type  Relationship among object classes Attribute  Property of object class or relationship type  Key attribute, single-value attribute, multi-value attribute, etc,.

10 Features of ORA-SS Distinguish between object class, attribute and relationship type Differentiate attributes of object class and relationship type Enable us to design valid XML views  That is, the views do not violate semantics in source data (Example) (Example) Other data model such as OEM, Dataguide cannot support all the semantics above

11 Our previous works Extract ORA-SS schema from XML data Enrich ORA-SS schema with necessary semantics Design valid XML views based on ORA-SS Selection, drop, join & swap operators

12 Part 3. Motivating Example

13 Motivating example Use XQuery to express XML views  Long and complex  Hard to understand The following example illustrates this Figure 5. A source XML file swap

14 Motivating example (cont.) Swap operator will keep the relationship set’s attributes in the current position For each part, we retrieve all suppliers that supply this part Instance diagrams swap

15 Motivating example (cont.) User can write the XQuery expression for the view. 1. let $pno_set := 2. let $sno_set := 3. return 4. for $p_no in $pno_set 5. let $p := 6. return 7. {for $s_no in $sno_set 8. where some $p1 in $in//part 9. satisfies ( and 10. ) 11. let $s 12. return } Figure 10. XQuery expression for the view swap User need to know price is an attribute of relationship type sp

16 Motivating example (cont.) XQuery expression for ORA-SS view  Complex and hard to understand  Prone to making error  User need to know where to put the related relationship attribute in the correct position in the view! Solution:  Design views using view operators based on ORA-SS  Guarantee the designed view is valid in terms of semantics  Automatically generate XQuery expression for ORA-SS view

17 Part 4. Generation of XQuery View Definitions Main ideas Analyzing vpath Generate where conditions

18 Main ideas 1. Generate query expression of each object class in an ORA-SS view A FLWOR expression: For, Let, Where, Order by and Return clausesFLWOR Often used for restructuring data 2. Combine query expressions of all object classes together according to the tree structure of the view

19 Main ideas (cont.) It is straightforward to automatically generate For/Let and Return clauses for an object class in the view However, it is not a trivial task to generate the condition constrains in Where clause for an object class in the view  Many different object classes in source schema may determine the values of a given object class in the view.  Therefore, it is important to know all the relevant object classes in source schema for a given object class in the view.

20 Main ideas (cont.) Intuitively, the values of an object class in a view can only be determined by the values of object classes in the path from the root to the object class in the view. Definition 1. For any object class o in an ORA-SS view, the path from the root of the view to o is called the vpath (viewpath) of o. The object classes that occur in the vpath of o may influence the values of o in the view.

21 Analyzing vpath Three types of object classes in the vpath of an object class o in an ORA-SS view  Type I: originate from the ancestors or descendants of o in the source schema.  Example Back to Rules for Type I ExampleBack to Rules for Type I  Type II: originate from the descendants of o’s ancestors in the source schema.  Example Back to Rules for Type II ExampleBack to Rules for Type II  Type III: originate from the object classes in another source schema, whose ancestor or descendant has a key-foreign key reference with o’s ancestor or descendant.  Example Back to Rules for Type III ExampleBack to Rules for Type III

22 Generate condition constraints in where clause For each type of object class in vpath of o  Present a set of rules to generate where conditions for o In the following rules  vo refers to an arbitrary object class in o’s vpath  o_no and vo_no refer to the key attribute of o and vo  vo is processed before o, we can employ vo_no when generating where conditions for o  $in represent the source document

23 Rules for Type I object class Rule Type I_A (Definition for Type I)Definition for Type I  If vo is an ancestor of o in source schema, then the following condition constraints (red color) are generated in the Where clause let $ono_set := for $o_no in $ono_set where some $vo1 in $in//vo satisfies ( exists( and ) Figure 12(b). Where condition generated for o in Rule Type I_A

24 Rules for Type I object class (cont.) Rule Type I_B  If vo is a descendant of o in source schema, then the following condition constraints (red color) are generated in the Where clause let $ono_set := for $o_no in $ono_set where some $vo1 in $in//vo satisfies ( exists( and ) Figure 13(b). Where condition generated for o in Rule Type I_B

25 Rules for Type II object class Rule Type II_A (Definition for Type II)Definition for Type II  Case (A): LCA is in the vpath of o  If vo is a Type II object class in o’s vpath and the Lowest Common Ancestor of vo and o in source schema, say LCA, is in the vpath of o in the view, then there is no need to generate a condition constraint in the Where clause for the restriction of vo on o.

26 Rules for Type II object class (cont.) Rule Type II_B  Case (B): LCA is not in the vpath of o  If vo is a Type II object class in o’s vpath and the Lowest Common Ancestor of vo and o, say LCA, is not in the vpath of o in the view, then the following condition constraints (red color) are generated in the Where clause. Figure 15(b). Where condition generated for o in Rule Type II_B let $ono_set := for $o_no in $ono_set where some $LCA in $in//LCA satisfies ( and )

27 Rules for Type III object class Rule Type III_A (Definition for Type III)Definition for Type III  Case (A): referenced object class is in o’s vpath  If vo is a descendant of the referenced object class in source schema and the referencing object class is in o’s vpath in the view, then there is no need to generate a condition constraints for the restriction of vo on o

28 Rules for Type III object class (cont.) Rule Type III_B  Case (B): o is the referencing object class itself  If vo is a descendant of the referenced object class and o is the referencing object class itself in source schema, then the following condition constraints are generated let $ono_set := for $o_no in $ono_set where some $referenced in $in1//referenced satisfies ( and ) Figure 18(b). Where condition generated for o in Rule Type III_B

29 Rules for Type III object class (cont.) Rule Type III_C  Case (C): referenced object class is not in o’s vpath and o is an ancestor of referencing object class  If vo is a descendant of the referenced object class and o is an ancestor of the referencing object class in the source, and the referencing object class is not in o’s vpath, then the following condition constraints (red color) are generated in the Where clause let $ono_set := for $o_no in $ono_set where some $referenced in $in1//referenced satisfies ( ) and some $referencing in $in2//referencing satisfies ( and ) Figure 17(b). Where condition generated for o in Rule Type III_C

30 Rules for Type III object class (cont.) Rule Type III_D  Case (D): referencing object class is not in o’s vpath and o is a descendant of referencing object class  If vo is a descendant of the referenced object class and o is a descendant of the referencing object class in the source, and the referencing object class is not in o’s vpath, then the following condition constraints are generated let $ono_set := for $o_no in $ono_set where some $referenced in $in1//referenced satisfies ( ) and some $referencing in $in2//referencing satisfies ( and ) Figure 19(b). Where condition generated for o in Rule Type III_D In the cases where vo is an ancestor of the referenced object class in source schema, similar rules can be easily derived.

31 Summary for all the rules Rule Type I & Type II  Consider all different cases where vo is in the same source schema as o Rule Type III  Consider cases where vo is in another source schema different from o’s source schema In summary, all the rules above consider all possible cases in designing XML views using our query operators

32 Algorithm Generate_View_Definition The ORA-SS view input in the algorithm is valid First generate a set of let clauses for all object classes in the view in pre order Generate root element for the view Process each child of the root from left to right Algorithm Generate_View_Definition Input: view schema v; source schema s Output: view definition of v 1. for each object class o in the view{ 2 generate a let clause: “let $ono_set := 3 } 4 generate the start tag for root of the view: 5 “return ” 6 for each child o of the root of v { 7 generate a start bracket: “{“ 8 Generate_Objectclass_Definition(o, v); 9 generate a end bracket: “}” 10 } 11 generate the end tag for root of the view: “ ” Figure 20. Algorithm to generate view definition

33 Algorithm Generate_Objectclass_Definition Algorithm Generate_ObjectClass_Definition Input: object class o; view schema v source schema s Output: view definition of o and its descendants 1. generate a for clause “for $o_no in $ono_set” 2. generate an empty where clause for o; 3. for each object class vo in the vpath of o{ // top down 4. if vo belongs to type I { 5. ProcessTypeI(vo, o); //generate a where condition based on rules for Type I 6. } 7. if vo belongs to type II { 8. ProcessTypeII(vo, o); //generate a where condition based on rules for Type II 9. } 10. if vo belongs to type III { 11. ProcessTypeIII(vo, o); //generate a where condition based on rules for Type III 12. } 13. append the generated condition in the where clause; 14.} 15. if there is any selection operator applied to o { 16.generate a where condition for all the operators in the where clause; 17.} 18. generate a let clause: “let $o := = $o_no]” 19. generate a return clause: “return ” // construct o and those attributes shown as attributes of o in the source file 20. for each attribute of o shown as a sub element of o in the source file { 21. generate it as a sub element of o: 22. } 23. if o has no child { 24. generate an end tag for o: “ ” 25. return the generated definition; 26. } 27. else { 28. for each child object class co of o { 29. generate a start bracket: “{“ 30. Generate_Objectclass_Definition(co, v, s); 31. generate an end bracket: “}“ 32. } 33. generate an end tag for o: “ ” 34. return the generated definition; 35. } Figure 21. Algorithm to generate object class definition

34 Part 5. Conclusion

35 Conclusion Our motivation  Complexity of defining and querying XML views using XQuery Propose a novel approach  Automatically generate XQuery view definitions from views defined based on ORA-SS Application of our approach  Materialized XML views  Map queries on XML views into the equivalent queries on source XML data

36 Conclusion (cont.) Advantages of our work  The first work to employ a semantic data model for the design and query of XML views  Provides a facility to design valid XML views  Provides a fast and user-friendly approach to retrieve XML data via views Ongoing work  XML views in the case where XML data are stored in traditional databases

37 References 1. S. Abiteboul, D. Quass, J. McHugh, et. al., “The lorel query language for semistructured data”, International Journal of Digital Libraries, Volume 1, No. 1, pp , S. Abiteboul. On views and XML. 18th ACM Symposium on Principles of Database Systems, pp. 1-9, S. Abiteboul, S. Cluet, L. Mignet, et. al., “Active views for electronic commerce”, VLDB, pp , S. Abiteboul, V, Aguilear, S, Ailleret, et. al., “XML repository and Active Views Demonstration”, VLDB Demo, pp , C. Baru, A. Gupta, B. Ludaescher, et. al., “XML-Based Information Mediation with MIX”, ACM SIGMOD Demo, M. Carey, J. Kiernan, J. hanmugasundaram, et. al., “XPERANTO: A Middleware for Publishing Object-Relational Data as XML Documents”, VLDB, pp , M. Carey, D. Florescu, Z. Ives, et. al., “XPERANTO: Publishing Object-Relational Data as XML”, WebDB Workshop, Y.B. Chen, T.W. Ling, M.L. Lee, “A Case Tool for Designing XML Views”, DIWeb Workshop, Y.B. Chen, T.W. Ling, M.L. Lee, “Designing Valid XML Views”, ER Conference, V. Christophides, S. Cluet, J. Simeon,“On Wrapping Query Languages and Efficient XML Integration”, SIGMOD, pp , S. Cluet, P. Veltri, D. Vodislav, “Views in a large scale xml repository”, VLDB, pp , G. Dobbie, X.Y Wu, T.W Ling, M.L Lee, “ORA-SS: An Object-Relationship-Attribute Model for SemiStructured Data”, Technical Report TR21/00, School of Computing, National University of Singapore, C. Fan, J. Funderburk, H. Lam, Et. al., “XTABLES: Bridging Relational Technology and XML”, IBM Research Report, M. Fernandez, W. Tan, D. Suciu, “Efficient Evaluation of XML Middleware Queries”, ACM SIGMOD, pp , M. Fernandez, W. Tan, D. Suciu, “SilkRoute: Trading Between Relations and XML”, World Wide Web Conference, J. Shanmugasundaram, E. Shekita, R. Barr, et. al., “Efficiently Publishing Relational Data as XML Documents”, VLDB, pp , J. Shanmugasundaram, J. Kiernan, E. Shekita, et. al., “Querying XML Views of Relational Data”, VLDB, pp , “XML Schema”, W3C Recommendation, “XQuery: A Query Language for XML”, W3C Working Draft, “XML Path Language”, W3C Recommendation, Microsoft Corp Oracle Corp IBM Corp [24] I. Manolescu, D. Florescu, D. Kossmann, “Answering XML Queries over Heterogeneous Data Sources”, VLDB Conf, 2001, pp [25] S. Ceri, S. Comai, E. Damiani, et. al., “XML-GL: a graphical language of querying and restructuring XML documents”, WWW Conf, pp , 1999

38 Example of vpath Back

39 FLWOR expression i. For clause evaluates the expression and iterates over the items in the resulting sequence, binding the variable to each item in turn. ii. Let clause binds a variable to the result of its associated expression (a set of values) without iteration. iii. Where clause serves as a filter for the tuples of variable bindings generated by the For and Let clauses iv. Order by clause determine the order of the tuple stream v. Return clause is evaluated once for each tuple in the tuple stream and construct the instances of the XML data. Back

40 Example swap Back