1 XML INTEROPERABILITY Manjusha Ravindranath. 2 CONTENTS Introduction Interoperability XSSQL syntax Usecases document Group By -Without aggregation -With.

Slides:



Advertisements
Similar presentations
XML Data Management 8. XQuery Werner Nutt. Requirements for an XML Query Language David Maier, W3C XML Query Requirements: Closedness: output must be.
Advertisements

Querying on the Web: XQuery, RDQL, SparQL Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology.
XML Examples. Bank Information Basic structure: A-101 Downtown 500 … Johnson Alma Surrey … A-101 Johnson …
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
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 !
XML, XML Schema, Xpath and XQuery Slides collated from various sources, many from Dan Suciu at Univ. of Washington.
RDF Tutorial.
TIMBER A Native XML Database Xiali He The Overview of the TIMBER System in University of Michigan.
XQUERY. What is XQuery? XQuery is the language for querying XML data The best way to explain XQuery is to say that XQuery is to XML what SQL is to database.
Database Management Systems, R. Ramakrishnan1 Introduction to Semistructured Data and XML Chapter 27, Part D Based on slides by Dan Suciu University of.
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.
Agenda from now on Done: SQL, views, transactions, conceptual modeling, E/R, relational algebra. Starting: XML To do: the database engine: –Storage –Query.
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
© 2002 by Prentice Hall 1 SI 654 Database Application Design Winter 2003 Dragomir R. Radev.
IS432: Semi-Structured Data Dr. Azeddine Chikh. 7. XQuery.
XML Views El Hazoui Ilias Supervised by: Dr. Haddouti Advanced XML data management.
XQuery: 1 W3C (World Wide Web Consortium) What is W3C? –An industry consortium, best known for standardizing HTML and XML. –Working Groups create or adopt.
A Graphical Environment to Query XML Data with XQuery
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.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
1 COS 425: Database and Information Management Systems XML and information exchange.
Query Languages - XQuery Slides partially from Dan Suciu.
XQuery – The W3C XML Query Language Jonathan Robie, Software AG Don Chamberlin, IBM Research Daniela Florescu, INRIA.
XML QUERY LANGUAGE Prepared by Prof. Zaniolo, Hung-chih Yang, Ling-Jyh Chen Modified by Fernando Farfán.
Page 1 Multidatabase Querying by Context Ramon Lawrence, Ken Barker Multidatabase Querying by Context.
ebis/etat/ebuy/xdia Joint Effort ebis/etat/ebuy/xdia Joint Effort2 Introduction Extensible Markup language XML SCHEMA DTD.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
Processing of structured documents Spring 2003, Part 8 Helena Ahonen-Myka.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
Advisor: Prof. Zaniolo Hung-chih Yang Ling-Jyh Chen XML Query Language.
XML-to-Relational Schema Mapping Algorithm ODTDMap Speaker: Artem Chebotko* Wayne State University Joint work with Mustafa Atay,
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 XML Taken from Chapter 7.
Maziar Sanaii Ashtiani – SCT – EMU, Fall 2011/12.
XML-QL A Query Language for XML Charuta Nakhe
Introduction to XML and XQuery Guangjun (Kevin) Xie.
1 XTree for Declarative XML Querying Zhuo Chen, Tok Wang Ling, Mengchi Liu, and Gillian Dobbie January 2004.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XQuery.
The main mathematical concepts that are used in this research are presented in this section. Definition 1: XML tree is composed of many subtrees of different.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
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.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XML.
Database Systems Part VII: XML Querying Software School of Hunan University
SDPL 2002Notes 9: XQuery1 9 Querying XML Data and Documents n XQuery, W3C XML Query Language –"work in progress", Working Draft, 30 April 2002 –joint work.
[ Part III of The XML seminar ] Presenter: Xiaogeng Zhao A Introduction of XQL.
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.
Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
1 Indexing The syntax for creating a index is: CREATE [UNIQUE] INDEX index_name ON table_name (column1, column2,... column_n) [ COMPUTE STATISTICS ]; Why.
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
Submitted To: Ms. Poonam Saini, Asst. Prof., NITTTR Submitted By: Rohit Handa ME (Modular) CSE 2011 Batch.
1 XQuery Slides From Dr. Suciu. 2 XQuery Based on Quilt, which is based on XML-QL Uses XPath to express more complex queries.
IS432 Semi-Structured Data Lecture 6: XQuery Dr. Gamal Al-Shorbagy.
19 th International Unicode Conference San Jose, CA September W3C XML Query Paul Cotton, Microsoft 19 th Unicode Conference Sept 12, 2001.
This PowerPoint is based on slides from: Rajshekhar Sunderraman, Department of Computer Science Georgia State University.
CSE 6331 © Leonidas Fegaras XQuery 1 XQuery Leonidas Fegaras.
1 Storing and Maintaining Semistructured Data Efficiently in an Object- Relational Database Mo Yuanying and Ling Tok Wang.
XML – Basic Concepts (modified version from Dr. Praveen Madiraju) 2015, Fall Pusan National University Ki-Joune Li.
XML Extensible Markup Language
SDPL 2005Notes 7: XQuery1 7 Querying XML n How to access different sources (DBs, docs) as XML? n XQuery, W3C XML Query Language –"work in progress", (last.
XML: Extensible Markup Language
Chapter 2: Database System Concepts and Architecture - Outline
Querying and Transforming XML Data
XML QUESTIONS AND ANSWERS
Database Processing with XML
XML Data Introduction, Well-formed XML.
SilkRoute: A Framework for Publishing Rational Data in XML
eXtensible Markup Language (XML)
XQuery Leonidas Fegaras.
Presentation transcript:

1 XML INTEROPERABILITY Manjusha Ravindranath

2 CONTENTS Introduction Interoperability XSSQL syntax Usecases document Group By -Without aggregation -With aggregation -Multiple XML Databases Restructuring Queries Implementation Conclusion

3 INTRODUCTION The goal of this research is - to study XML interoperability. - to develop a SQL oriented query language XSSQL for querying XML documents in comparison to procedure oriented languages like XQuery. - to study mapping between the flat representation of relational data and the hierarchical representation of XML data.

4 INTEROPERABILITY Interoperability is the ability to uniformly share, interpret, query and manipulate data across component databases. XSSQL supports main key features of an interoperable language by -being independent of the XML schemas and Document Type Descriptors. -permitting restructuring of one XML document to another through view definition capabilities.

5 XSSQL SYNTAX select {$var/Qname } from document (“doc_name.xml”)//Qname $var where whereConditions Variables are declared in the from clause as - document (“doc_name.xml”)/Qname $var for an element at the top level of the document. - document (“doc_name.xml”)//Qname $var for an element which is at intermediate levels of the document. Group by is given inside the in the select clause as

6 QUERIES FROM USECASES DOCUMENT 1. “XMP” Queries 2. Tree Queries 3. “SEQ” Queries 4. “R” Queries 5. “SGML” Queries 6. ”STRING” Queries 7. “NS” Queries 8. “PARTS” 9. “STRONG”

7 “XMP” QUERY Sample Data-”bib.xml” TCP/IP Illustrated Stevens W. Addison-Wesley Data on the web Suciu Dan Morgan Kaufmann

8 QUERY (XSSQL) Solution in XSSQL Q1. List books published by Addison-Wesley after 1991 including their year and title. select {$b/title} from document(“bib.xml”)//book $b where $b/publisher =“Addison-Wesley” and >1991 Expected Result TCP/IP Illustrated

9 QUERY (XQUERY) Solution in XQuery XQuery uses the “FLWR” expression which consists of FOR, LET,WHERE and RETURN for $b in document(“bib.xml”)//book where $b/publisher=“Addison-Wesley” and >1991 return {$b/title} Solution in XQuery has the same above expected result.

10 TREE QUERY - FUNCTIONS IN XSSQL Sample Data -”book.xml” Data on the web Dan Suciu Introduction Text…. Audience Text…. Web Data and the Two Cultures

11 QUERY (XSSQL) Solution in XSSQL Q2. Prepare a nested table of contents for Book1 listing all the sections and their titles preserving the attributes of each element if any. create function toc ($e as element) return element * as begin { declare $n = local-name($e) if ($n =“section”) select {toc($e/*)} if ($n =“title”) select {$e/text ()} } end { toc(document(“book.xml”)/book) }

12 EXPECTED RESULT Introduction Audience Web Data and the Two Cultures

13 QUERY (XQUERY) Solution in XQuery define function toc ($e as element) as element * { let $n: = local-name($e) return if ($n =“section”) then {toc($e/*)} else if ($n =“title”) then {$e/text ()} else {} } { toc(document(“book.xml”)/book) }

14 GROUP BY In XSSQL the concept is that each node will have its own grouping. Each child will inherit grouping of its parent The cases studied under group by are - Group by without aggregation - Group by with aggregation - Multiple XML Databases Following queries are based on the document “sales.xml”. This document gives the daily sales of the stores in two cities in each month starting from January of the current year. For the sake of simplicity two stores in two cities of NC are taken and sales of couple of days in the months of January and February are discussed.

15 WITHOUT AGGREGATION Sample Data -“sales.xml” NC Greensboro Harris Teeter January NC Greensboro Food Lion January

16 QUERY (XSSQL) Q3. List all stores in each city. select distinct($c/text()) distinct($s/text()) from document (“sales.xml”)/entries/entry $e, $e/city $c,$e/store $s

17 SEMANTICS OF GROUP BY IN XSSQL The instantiations after the group by would be like the following $c $s Greensboro Harris Teeter Greensboro Food Lion Raleigh Harris Teeter Raleigh Lowes

18 SEMANTICS OF GROUP BY IN XSSQL The output instance is graphically shown below. By <city group By $c, $c binds to every … in the document. Duplicate city names are eliminated by distinct ($c/text()). root Gso Raleigh HTFLHTLowes

19 EXPECTED RESULT Greensboro Harris Teeter Food Lion Raleigh Harris Teeter Lowes

20 QUERY(XQUERY) for $c in distinct-values(document(“sales.xml”)//city) return $c/text() { for $e in document(“sales.xml”)/entries/entry where some $ca in $e/city satisfies deep-equal ($ca,$c) for $s in distinct-values ($e/store) return $s/text() }

21 NEW GROUP BY PROPOSAL The above example can be written in XQuery using a new GROUP BY proposal provided by Prof. Dan Suciu. for $e in document(“sales.xml”)/entries/entry, $c in $e/city, $s in $e/store return GROUPBY $c IN $c/text() GROUPBY $s IN $s

22 QUERY (XSSQL) Q4. Give the monthly sales in all stores in each city select distinct($c/text()) distinct($s/text()) distinct($m/text()) SUM($i) from document (“sales.xml”)/entries/entry $e, $e/city $c,$e/store $s, $e/month $m, $e/sales $i

23 EXPECTED RESULT Greensboro Harris Teeter January 210 February 730 Food Lion January 300 February 830

24 QUERY (XQUERY) for $c in distinct-values(document(“sales.xml”)//city), $e in document(“sales.xml”)/entries/entry where some $ca in $e/city satisfies deep-equal($ca,$c) return distinct($c/text()) { for $s in distinct-values(document(“sales.xml”)//store), where some $sa in $e/store satisfies deep-equal($sa,$s) return distinct($s/text()) { for $m in distinct-values(document(“sales.xml”)//month) let $i=$e/sales

25 QUERY (XQUERY) contd... where some $ma in $e/month satisfies deep-equal($ma,$m) return distinct($m/text()) { SUM($i) } }

26 MULTIPLE XML DATABASES Suppose we have multiple XML databases having similar and possibly overlapping data. Sample Data “Univ1.xml” and “Univ2.xml” deals with student information in different majors. Mathematics Stephen Providence Dale Borget Computer Science Barbara McMasters

27 MULTIPLE XML DATABASES Sample Data “Univ2.xml” Mathematics Dale Borget Mary Rierson English Robin Mooney

28 QUERY (XSSQL) define function students ($a as element entry) as xs:string { declare $b =$a/student return $b } select { $e1 / major} { students ($e1)} { $e2[student NOT IN (select $sa from document(“Univ1.xml”)//entry $ea, $ea/major$ma $ea/student $sa where $ma/text()=$m2/text() ) ]/student }

29 QUERY (XSSQL) contd... from document(“Univ1.xml”)//entry $e1, document(“Univ2.xml”)//entry $e2, $e2/major $m2 UNION select {$a} from document(“Univ2.xml”)//entry $a, $n in $a/major where $n not in document(“Univ1.xml”)//entry/major

30 EXPECTED RESULT Mathematics Stephen Providence Dale Borget Mary Rierson Computer Science Barbara McMasters English Robin Mooney

31 RESTRUCTURING QUERIES The following two documents “doc1.xml” and “doc2.xml” contain the same information about company stocks but have a different hierarchical structure. Views have been created to demonstrate the restructuring capabilities of XSSQL.

32 RESTRUCTURING QUERIES Sample Data “doc1.xml” 8/8/03 IBM /8/03 MSFT 6681

33 RESTRUCTURING QUERIES Sample Data contd.. 8/9/03 IBM /9/03 MSFT 6981

34 RESTRUCTURING QUERIES Sample Data “doc2.xml” 8/8/ /9/

35 RULES OF RESTRUCTURING a. /doc2/entries/stock/IBM is a /doc1/entries/stock/ticker b. If x is a ticker then /doc2/entries/stock/x/text() corresponds to /doc1/entries/stock/value.

36 QUERY (XSSQL) create view doc1_to_doc2 as select distinct($d/text() ) $v/text() from document (“doc1.xml”)//stock $s, $s/date $d, $s/ticker $t, $s/value $v Expected Result “doc2.xml”

37 IMPLEMENTATION XSSQL queries are translated into XQuery using naive algorithms. General Algorithm used to translate XSSQL into XQuery: - Read and tokenize input XSSQL string using white spaces (Can use JAVA stringTokenizer classes). - Translate XSSQL tokens to tokens in XQuery using functions. - Finally concatenate XQuery tokens to produce the output string.

38 CONCLUSION In conclusion We introduced XSSQL as a SQL oriented query language for querying XML documents. We developed a formal syntax of XSSQL akin to SQL and provided novel algorithms for translating XSSQL to XQUERY. We have shown that XSSQL extensively deals with group by with and without aggregation in single and multiple XML documents using several levels of nesting. This work leads to many important directions of future work like - optimization of views in XML documents. - merging of multiple (more than two) XML documents. - developing standalone engine for XSSQL.

39 RFERENCES Lakshmanan, L.V.S., Sadri, F., and Subramanian, S.N SchemaSQL- An Extension to SQL for Multi-database interoperability. W3C Working Draft XML Query Use Cases- Cotton, P., Robie, J., - Jan 30, 2002 Querying XML Documents. Unicode Conference Berners-Lee, T., Hendler, J., Lassila, O., - May 17, 2001 The Semantic Web.Scientific American W3C Recommendation, - May 2, 2001 XML Schema Part 0: Primer