Maintaining Semantics in the Design of Valid and Reversible SemiStructured Views Yabing Chen, Tok Wang Ling, Mong Li Lee Department of Computer Science National University of Singapore 1 Outline Introduction Motivating Example Design Rules for Swap Operators Conclusion 2 Introduction XML The dominant standard for exchanging data on the Internet XML Views Exploit the potential of XML Secure the source data Provide an application-specific view 3 Related Work XML Views on Relational Database SilkRoute [1] [2] XPERANTO [3] [4] uses a canonical mapping to create a default XML view from relational data ROLEX [14] Two different language to define and query the views over relational data Uses XSLT to define XML views. XML Views on XML Data Xyleme [15] Define XML views using DTD ActiveView [16] Define views with active features [1]M. Fernandez, W. Tan, D. Suciu, “Efficient Evaluation of XML Middleware Queries”, ACM SIGMOD, pp. 103-114, 2001. [2] M. Fernandez, W. Tan, D. Suciu, “SilkRoute: Trading Between Relations and XML”, World Wide Web Conference, 1999. [3] M. Carey, J. Kiernan, J. hanmugasundaram, et. al., “XPERANTO: A Middleware for Publishing Object-Relational Data as XML Documents”, VLDB, pp. 646-648, 2000. [4] M. Carey, D. Florescu, Z. Ives, et. al., “XPERANTO: Publishing Object-Relational Data as XML”, WebDB Workshop, 2000. [15] Sophie Cluet, Pieanglo Veltri, Dan Vodislav, Views in a large scale xml repository, VLDB 2001, pp. 271-280. [16] Serge Abiteboul, Sophie Cluet, Laurent Mignet, et. Al. Active views for electronic commerce, VLDB 1999, pp.138-149. 4 Weakness of related work Disadvantage of the main related work Ignore semantic information in source data For example, ignore the difference between object class, attribute and relationship in schema Cannot check the validity of designed views Difficult to use query languages to define views Proprietary language or XQuery 5 Our approach Our approach for XML views Our previous work Design valid XML Views [9] Based on a semantically rich model - ORA-SS [18] Use query operators, such as selection, drop, swap, join, etc. Our current work (this paper) A complete set of rules for swap operators & reversible views Maintain participation constraints for relationship types in the views. [9] Ya Bing. Chen, Tok Wang Ling, Mong Li Lee, “Designing Valid XML Views”, ER Conference, 2002 [18] Gillian Dobbie, Xiao Ying Wu, Tok Wang Ling, Mong Li Lee, ORA-SS: An Object-Relationship-Attribute Model for SemiStructured Data, Technical Report TR21/00, School of Computing, National University of Singapore, 2000. 6 Motivating Example ORA-SS data model Object class – Rectangle Attribute – circle Relationship type – label on the connection between object classes Difference between ORA-SS and ER diagram ORA-SS is hierarchical structure ER is flat structure Difference between ORA-SS and other XML models More semantics expressed. i.e. differentiate object class and attribute, differentiate the relationship attributes and object class attributes course cs,2,1:n,1:n code title cl,2,1:n,1:n student lecturer cl cs cst,3,1:n,1:n stfNo * stuNo name hobby grade tutor name office work load cst stfNo office feedback 7 Motivating Example (cont.) Invalid view may be created by swapping course & student incorrectly Relationship attribute grade relocated wrongly. Relationship type cl disappears. course student cs,2,1:n,1:n cl,2,1:n,1:n cs cs,2,1:n,1:n * code title student lecturer cl cs stuNo name hobby grade course lecturer cst,3,1:n,1:n cst,3,1:n,1:n stfNo * stuNo name hobby grade Swap course & student tutor name office work load code title cst stfNo name office work load tutor cst stfNo office feedback Source Schema stfNo office feedback Invalid view Schema 8 Motivating Example (cont.) Fortunately, valid view can be created based on our developed rules. Relationship attribute grade relocated correctly. Relationship type cl is kept in the view correctly. course student cs,2,1:n,1:n cs,2,1:n,1:n cl,2,1:n,1:n * stuNo name hobby code title student lecturer cl cs cst,3,1:n,1:n stfNo * stuNo name hobby grade tutor name office work load cst stfNo office feedback Source Schema Swap course & student course cs code title grade cl, 2, 1:n, 1:n cst,3,1:n,1:n lecturer tutor cst cl stfNo office feedback stfNo name office work load Valid view Schema 9 Swap Operators Our previous work Select, join and drop operator. Simple rules for swap operator Our current work Detailed and complete rules for swap operator Reversible views A view is reversible if its source schema can be produced back by applying swap operator on the view 10 Swap Operator (cont.) Rule Swap_1: move attributes of Oi and Oj with Oi and Oj Oi ki Oj ai Swap Oi & Oj kj Oa Oa Reversible by applying the same rule Oj kj aj aj Oi ki ai 11 Swap Operator (cont.) Relationship types affected: Oi Oa Oa Oa Oc Oc Oc The Second Category Oj Oj Ok Ob Ob Ob The First Category Oi Oi Od The path from Oj up to Oi and its ascendants Ok Oj Od The path involving Oi and its branch object class The Third Category Ok Od The path involving Oj and its descendants 12 Swap Operator (cont.) Rule Swap_2: handles the first category of relationship types Attach attributes of R at the lowest object class Reason: keep the relationship attributes meaningful in the view Property of first category of relationship types: The path from Oj up to Oi and its ascendants Oi Oj Swap Oi & Oj Oa R(Oi, Oa Oj) , Oj R attribute Oa Reversible by applying the same rule R(Oi,Oa Oj) , Oi R attribute 13 Swap Operator (cont.) Rule Swap_3: handles the second category of relationship types Attach sub trees of Oi or Oa to Oi Reason: keep the relationship meaningful in the view Property of the second category of relationship types: The path involving Oi and its branch object classes Oj Oi R1(Oi, Ob) Ob Swap Oi & Oj Oa Oa R2(Oi, Oa, Oc) Oj Oc Reversible by applying the Rule Swap_4 R2(Oi, Oa, Oc) Oc Oi R1(Oi, Ob) Ob 14 Swap Operator (cont.) Rule Swap_4: handle the third category of relationship types Move sub trees of Oj accordingly Reason: keep the relationship meaningful in the view Property of the third category of relationship types: The path involving Oj and its descendants Oj Oi Swap Oi & Oj Oa Oa R1(Oa, Oj, Ok) Ok Oj R1(Oa, Oj, Ok) Reversible by applying the Rule Swap_3 & 4 R2(Oa, Oj, Od) Od Oi R2(Oa, Oj, Od) Od R3(Oi, Oj, Od, Oe) Ok Oe R3(Oi, Oj, Od, Oe) Oe 15 Conclusion An approach to maintaining semantics in designing views A complete set of rules for the swap operator Keep the relationship types correct in the views Maintain the view reversibility The first work to maintain semantics (i.e. relationship types) Provide for a more robust view mechanism to guarantee the valid views design 16 Thanks! 17 References 1. Serge. Abiteboul, S. Cluet, L. Mignet, et. al., “Active views for electronic commerce”, VLDB, pp.138-149, 1999. 2. Chaitanya. Baru, A. Gupta, B. Ludaescher, et. al., “XML-Based Information Mediation with MIX”, ACM SIGMOD Demo, 1999. 3. Michael. Carey, J. Kiernan, J. hanmugasundaram, et. al., “XPERANTO: A Middleware for Publishing ObjectRelational Data as XML Documents”, VLDB, pp. 646-648, 2000. 4. Michael. Carey, D. Florescu, Z. Ives, et. al., “XPERANTO: Publishing Object-Relational Data as XML”, WebDB Workshop, 2000. 5. Ya Bing. Chen, Tok Wang Ling, Mong Li Lee, “Designing Valid XML Views”, ER Conference, 2002 6. Ya Bing Chen, Tok Wang Ling, Mong Li Lee, “Automatic Generation of SQLX Definitions from ORA-SS Views”, DASFAA, 2004. 7. Sophie. Cluet, P. Veltri, D. Vodislav, “Views in a large scale xml repository”, VLDB, pp. 271-280, 2001. 8. Gillian. 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, 2000. 9. Mary. Fernandez, W. Tan, D. Suciu, “Efficient Evaluation of XML Middleware Queries”, ACM SIGMOD, pp. 103-114, 2001. 10. Mary. Fernandez, W. Tan, D. Suciu, “SilkRoute: Trading Between Relations and XML”, World Wide Web Conference, 1999. 11. Philip. Bohannon, H. Korth, P. Narayan, S. Ganguly, and P. Shenoy. Optimizing view queries in ROLEX to support navigable tree results. VLDB, 2002. 12. Alin. Deutsch and V. Tannen. MARS: A System for Publishing XML from Mixed and Redundant Storage. VLDB, 2003. 18