Managing XML and Semistructured Data Lecture 8: Query Languages - XML-QL Prof. Dan Suciu Spring 2001.

Slides:



Advertisements
Similar presentations
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
Advertisements

1 Syntax-directed Transformations of XML Streams Stefanie Scherzinger joint work with Alfons Kemper.
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 !
Internet Technologies1 1 Lecture 4: Programming with XSLT.
1 Web Data Management Path Expressions. 2 In this lecture Path expressions Regular path expressions Evaluation techniques Resources: Data on the Web Abiteboul,
XML, XML Schema, Xpath and XQuery Slides collated from various sources, many from Dan Suciu at Univ. of Washington.
Database Management Systems, R. Ramakrishnan1 Introduction to Semistructured Data and XML Chapter 27, Part D Based on slides by Dan Suciu University of.
Agenda from now on Done: SQL, views, transactions, conceptual modeling, E/R, relational algebra. Starting: XML To do: the database engine: –Storage –Query.
© 2002 by Prentice Hall 1 SI 654 Database Application Design Winter 2003 Dragomir R. Radev.
Web-site Management System Strudel Presented by: LAKHLIFI Houda Instructor: Dr. Haddouti.
IS432: Semi-Structured Data Dr. Azeddine Chikh. 7. XQuery.
1 Lecture 10 XML Wednesday, October 18, XML Outline XML (4.6, 4.7) –Syntax –Semistructured data –DTDs.
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.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 357 Database Systems I Query Languages for XML.
1 COS 425: Database and Information Management Systems XML and information exchange.
1 Statistics XML: –Altavista: 800,000 pages returned. –Amazon.com: 242 books. In comparison: –God: 12,000 books, 7 Million pages –Bible: 32,000 books,
Query Languages - XQuery Slides partially from Dan Suciu.
1 New Ways of Querying the Web by Eliahu Brodsky and Alina Blizhovsky.
Managing XML and Semistructured Data Lecture 6: XPath Prof. Dan Suciu Spring 2001.
4/15/2002Bo Du 1 - Bo Du, April 15, XML - QL A Query Language for XML.
Managing XML and Semistructured Data
XML QUERY LANGUAGE Prepared by Prof. Zaniolo, Hung-chih Yang, Ling-Jyh Chen Modified by Fernando Farfán.
Managing XML and Semistructured Data Lecture 1: Preliminaries and Overview Prof. Dan Suciu Spring 2001.
Fundamentals, Design, and Implementation, 9/e Text and XML databases Instructor: Dragomir R. Radev Winter 2005.
Putting Semi-structured Data to Practice Alon Levy Seattle, Washingon University of Washington.
XML, XML Schema, XPath and XQuery Query Languages CS561 Slides collated from several sources, including D. Suciu at Univ. of Washington.
1 Lecture 08: XML and Semistructured Data. 2 Outline XML (Section 17) –XML syntax, semistructured data –Document Type Definitions (DTDs) XPath.
Managing XML and Semistructured Data Lecture 2: XML Prof. Dan Suciu Spring 2001.
1 Lecture 08: XML and Semistructured Data. 2 Outline XML (Section 17) –XML syntax, semistructured data –Document Type Definitions (DTDs) XPath.
1 Lecture 16: Querying XML Data: XPath, XQuery Friday, February 11, 2005.
Querying XML February 12 th, Querying XML Data XPath = simple navigation through the tree XQuery = the SQL of XML XSLT = recursive traversal –will.
XML: Extensible Markup Language FST-UMAC Gong Zhiguo.
Advisor: Prof. Zaniolo Hung-chih Yang Ling-Jyh Chen XML Query Language.
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.
Introduction to XQuery Resources: Official URL: Short intros:
XML-QL A Query Language for XML Charuta Nakhe
XML by Dan Suciu 1 Introduction to Semistructured Data and XML Based on slides by Dan Suciu University of Washington.
Dan SuciuTools for XML Data Exchange Dan Suciu AT&T Labs Joint work with Mary Fernandez.
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.
1 Searching XML Documents via XML Fragments D. Camel, Y. S. Maarek, M. Mandelbrod, Y. Mass and A. Soffer Presented by Hui Fang.
1 What Is XML? eXtensible Markup Language for data –Standard for publishing and interchange –“Cleaner” SGML for the Internet Applications: –Data exchange.
Lecture 6: XML Query Languages Thursday, January 18, 2001.
5/2/20051 XML Data Management Yaw-Huei Chen Department of Computer Science and Information Engineering National Chiayi University.
Lecture 5: XML Tuesday, January 16, Outline XML, DTDs (Data on the Web, 3.1) Semistructured data in XML (3.2) Exporting Relational Data in XML (8.3.1)
[ Part III of The XML seminar ] Presenter: Xiaogeng Zhao A Introduction of XQL.
XML query. introduction An XML document can represent almost anything, and users of an XML query language expect it to perform useful queries on whatever.
More XML: semantics, DTDs, XPATH February 18, 2004.
The Semistructured-Data Model Programming Languages for XML Spring 2011 Instructor: Hassan Khosravi.
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
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.
Semi-structured Data In many applications, data does not have a rigidly and predefined schema: –e.g., structured files, scientific data, XML. Managing.
Lecture 17: XPath and XQuery Wednesday, Nov. 7, 2001.
Querying Large XML Data Hsuan-Heng, Wu Shawn Ju. XML V.S. HTML XML is designed to describe data XML don’t use predefined tags XML is used to exchange.
SEMI-STRUCTURED DATA (XML) 1. SEMI-STRUCTURED DATA ER, Relational, ODL data models are all based on schema Structure of data is rigid and known is advance.
임 순 범 숙명여대 정보과학부 멀티미디어학과 1 III. XML-QL 멀티미디어 데이터베이스 ( ~11.1)
Lecture 14: Relational Algebra Projects XML?
Managing XML and Semistructured Data
Management of XML and Semistructured Data
eXtensible Markup Language (XML)
Semi-Structured data (XML Data MODEL)
Alin Deutsch, University of Pennsylvania Mary Mernandez, AT&T Labs
Early Profile Pruning on XML-aware Publish-Subscribe Systems
Lecture 9: XML Monday, October 17, 2005.
Wednesday, May 29, 2002 XML Storage Final Review
Semi-structured Data In many applications, data does not have a rigidly and predefined schema: e.g., structured files, scientific data, XML. Managing such.
Introduction to Database Systems CSE 444 Lecture 10 XML
Lecture 15: Querying XML Friday, October 27, 2000.
Semi-Structured data (XML)
Lecture 11: XML and Semistructured Data
Presentation transcript:

Managing XML and Semistructured Data Lecture 8: Query Languages - XML-QL Prof. Dan Suciu Spring 2001

In this lecture XML-QL features patterns, constructors, nested queries skolem functions Constructing trees in XML-QL XML-QL compared with XQuery Resources XML-QL: A Query Language for XML by Deutsch, Fernandez, Florescu, Levy, Suciu, in WWW8.XML-QL: A Query Language for XML Data on the Web Abiteboul, Buneman, Suciu : section 5.1

XML-QL First declarative language for XML How to obtain a query language for XML fast ? –Assume OEM as data model –Use features from UnQL and StruQL Patterns Templates Skolem functions –Design XML-like syntax

Patterns in XML-QL WHERE Morgan Kaufmann $A in “ CONSTRUCT $A WHERE Morgan Kaufmann $A in “ CONSTRUCT $A Find all authors who published in Morgan Kaufmann: Abbreviation: closes any tag.

Patterns in XML-QL where $A in “ $A Jones in “ construct $X where $A in “ $A Jones in “ construct $X Find all languages in which Jones’ coauthors have published: There is a join here…

Constructors in XML-QL where $A in “ construct $A $L where $A in “ construct $A $L Result is: Smith English Smith Mandarin Doe English.. Find all authors and the languages in which they published:

Nested Queries in XML-QL WHERE $A in “ CONSTRUCT $A WHERE $A in “ CONSTRUCT $L WHERE $A in “ CONSTRUCT $A WHERE $A in “ CONSTRUCT $L Find all authors and the languages in which they published; group by authors: Note: book.author is a (regular) path expression

Smith English Mandarin … Doe English … Result is:

Skolem Functions in XML-QL WHERE $A in “ CONSTRUCT $A $L WHERE $A in “ CONSTRUCT $A $L Same query, with Skolem functions Assumptions: the ID attribute is always id default Skolem function for author is G($A), for lang is H($A, $L) (why ?)

Skolem Functions in XML-QL { WHERE $A $T in “ CONSTRUCT $A $T /* implicit Skolem function H($A, $T) */ } { WHERE $A $T $J in “ CONSTRUCT $A $T /* implicit Skolem function J($A, $T) */ $J /* implicit Skolem function K($A, $T) */ } { WHERE $A $T in “ CONSTRUCT $A $T /* implicit Skolem function H($A, $T) */ } { WHERE $A $T $J in “ CONSTRUCT $A $T /* implicit Skolem function J($A, $T) */ $J /* implicit Skolem function K($A, $T) */ } Object fusion with Skolem functions and block structure - Compile a complete list of authors, from two sources

Result: (some have only books, Others only papers, Others have both) Smith Book1 Book2 Jones Book3 paper1 journal1 Mark paper2 journal3 …

Skolem Functions in XML-QL WHERE $A in “ CONSTRUCT $A $L WHERE $A in “ CONSTRUCT $A $L “Wrong” query number 1: What is “wrong” here ?

Skolem Functions in XML-QL WHERE $A in “ CONSTRUCT $A $L WHERE $A in “ CONSTRUCT $A $L “Wrong” query number 2: What is “wrong” here ?

Skolem Functions in XML-QL { WHERE $A in “ CONSTRUCT $L } { WHERE $C $X in “ CONSTRUCT $L } { WHERE $A in “ CONSTRUCT $L } { WHERE $C $X in “ CONSTRUCT $L } “Wrong” query number 3:

Three Rules to Construct Only Trees Rule 1: nested elements must have Skolem functions with arguments such that args1  args2 Rule 2: an element that has an atomic content must have a Skolem function with $X  args CONSTRUCT … CONSTRUCT … CONSTRUCT … $X …

Contructing trees with Skolem fcns (con’t) Rule 3: if a Skolem function occurs in two different places then the following must hold: –G = H –args1 = args2 –tag1 = tag2 { CONSTRUCT … }

XML-QL v.s. XQuery Xquery (=Quilt) v.s. XML-QL + faithful XML data model + Xpath sublanguage + aggregate functions (like in SQL) + some features from XQL -Patterns -Skolem functions