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.

Slides:



Advertisements
Similar presentations
Tim Berners-Lee authors HTML in 1991, assisted by his colleagues at CERN,
Advertisements

XQuery John Annechino Steven Pow. Agenda What is XQuery? Uses of XQuery XQuery vs. XSLT Syntax –Built-In Functions –FLWOR –if-then-else –User-Defined.
XQuery Or, what about REAL databases?. XQuery - its place in the XML team XLink XSLT XQuery XPath XPointer.
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.
1 XQuery Web and Database Management System. 2 XQuery XQuery is to XML what SQL is to database tables XQuery is designed to query XML data What is XQuery?
Database Management Systems, R. Ramakrishnan1 Introduction to Semistructured Data and XML Chapter 27, Part D Based on slides by Dan Suciu University of.
1 Part 3: Query Languages Managing XML and Semistructured Data.
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.
XML Extensible Markup Language Standard supported by W3C (World Wide Web Consortium) HTML – End user oriented (presentation) XML – Application oriented.
Xquery Introduction by Examples. Sources XQuery 1.0: An XML Query LanguageW3C Working Draft 22 August 2003 Don Chamberlin’s Sigmod03 talk:
Querying XML (cont.). Comments on XPath? What’s good about it? What can’t it do that you want it to do? How does it compare, say, to SQL?
IS432: Semi-Structured Data Dr. Azeddine Chikh. 7. XQuery.
QSX (LN 3)1 Query Languages for XML XPath XQuery XSLT (not being covered today!) (Slides courtesy Wenfei Fan, Univ Edinburgh and Bell Labs)
A Graphical Environment to Query XML Data with XQuery
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object, Object- Relational, and XML: Concepts, Models, Languages,
1 Efficient XML Stream Processing with Automata and Query Algebra A Master Thesis Presentation Student: Advisor: Reader: Jinhui Jian Prof. Elke A. Rundensteiner.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 357 Database Systems I Query Languages for XML.
XQuery language Presented by: Tayeb sbihi supervised by: Dr. H. Haddouti.
1 COS 425: Database and Information Management Systems XML and information exchange.
Query Languages - XQuery Slides partially from Dan Suciu.
1 A Unified Model for XQuery Evaluation over XML Data Streams Jinhui Jian Hong Su Elke A. Rundensteiner Worcester Polytechnic Institute ER 2003.
4/15/2002Bo Du 1 - Bo Du, April 15, XML - QL A Query Language for XML.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
XML QUERY LANGUAGE Prepared by Prof. Zaniolo, Hung-chih Yang, Ling-Jyh Chen Modified by Fernando Farfán.
Fundamentals, Design, and Implementation, 9/e Text and XML databases Instructor: Dragomir R. Radev Winter 2005.
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.
Xpath to XQuery February 23rd, Other Stuff HW 3 is out. Instructions for Phase 3 are out. Today: finish Xpath, start and finish Xquery. From Wednesday:
Querying XML February 12 th, Querying XML Data XPath = simple navigation through the tree XQuery = the SQL of XML XSLT = recursive traversal –will.
Processing of structured documents Spring 2003, Part 8 Helena Ahonen-Myka.
Advisor: Prof. Zaniolo Hung-chih Yang Ling-Jyh Chen XML Query Language.
Xquery. Summary of XQuery FLWR expressions FOR and LET expressions Collections and sorting Resource W3C recommendation:
XML Query Processing Data Warehousing Lab. M.S. 2 Hyeyoung Cho.
1 XQuery Slides From Dr. Suciu. 2 FLWR (“Flower”) Expressions FOR... LET... WHERE... RETURN... FOR... LET... WHERE... RETURN...
SDPL 20067: Querying XML with XQuery1 7 Querying XML n How to access data sources as XML? n XQuery, W3C XML Query Language –Candidate Rec, November 2005.
1 XML INTEROPERABILITY Manjusha Ravindranath. 2 CONTENTS Introduction Interoperability XSSQL syntax Usecases document Group By -Without aggregation -With.
Introduction to XML and XQuery Guangjun (Kevin) Xie.
TDDD43 XML and RDF Slides based on slides by Lena Strömbäck and Fang Wei-Kleiner 1.
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.
HTML Structure & syntax
End of XML February 19 th, FLWR (“Flower”) Expressions FOR... LET... WHERE... RETURN... FOR... LET... WHERE... RETURN...
Introduction to XQuery Bun Yue Professor, CS/CIS UHCL.
NaLIX Natural Language Interface for querying XML Huahai Yang Department of Information Studies Joint work with Yunyao Li and H.V. Jagadish at University.
By Mohsen ashouri.  Introduction  Comparison between XML and HTML  XML Syntax  Challenges  Summary.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to the Internet and World Wide Web Outline 1.1Introduction 1.2World Wide Web Consortium.
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
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.
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.
SDPL 20077: Querying XML with XQuery1 7 Querying XML n How to access XML data sources? n XQuery, XML Query Lang, W3C Rec, 01/ '07 –joint work by XML Query.
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.
XML Query: xQuery Reference: Xquery By Priscilla Walmsley, Published by O’Reilly.
IS432 Semi-Structured Data Lecture 6: XQuery Dr. Gamal Al-Shorbagy.
CSE 6331 © Leonidas Fegaras XQuery 1 XQuery Leonidas Fegaras.
XQuery 1. In this lecture Summary of XQuery FLWOR expressions – For, Let, Where, Order by, Return FOR and LET expressions Collections and sorting 2.
Lecture 17: XPath and XQuery Wednesday, Nov. 7, 2001.
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.
8 Querying XML How to access different sources (DBs, docs) as XML?
Lecture 11: Xpath/XQuery
{ XML Technologies } BY: DR. M’HAMED MATAOUI
Database Application Design
Querying XML XQuery.
Querying XML XQuery.
نگاشت‌ پرس‌وجوهاي XML به پرس‌وجوهاي رابطه‌اي‌
Alin Deutsch, University of Pennsylvania Mary Mernandez, AT&T Labs
XQuery Leonidas Fegaras.
Xquery Slides From Dr. Suciu.
Lecture 15: Querying XML Friday, October 27, 2000.
Presentation transcript:

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 new “recommendations”

XQuery: 2 XML (eXtensible Markup Language) TCP/IP Illustrated Stevens W. Addison Wesley …

XQuery: 3 XQuery – Example 1 Get title of books published by Addison-Wesley after for $b in $bib/book where $b/publisher = "Addison-Wesley" and > 1993 return $b/title TCP/IP Illustrated

XQuery: 4 FLWOR Expressions Basic FLWOR Expression: –For – consider (introduce a variable) –Let – introduce additional variables –Where – filter by conditions –Order by – order the output –Return – build results Xquery is compositional: any place XML data can go, another { FLWOR } expression can go.

XQuery: 5 XQuery – Example 2 Get titles of books published after 1994, but NOT published by Addison-Wesley. Order the result in descending order by title. for $b in $bib/book let $c := $b/publisher where $c != "Addison-Wesley" and > 1994 order by $b/title descending return $b/title The Economics of Technology and Content for Digital TV Early Adopter XQuery Data on the Web

XQuery: 6 XQuery – Example 3 Join and on and print the title and price. for $b in $bib/book, $e in $reviews/entry where $e/title = $b/title return { $b/title, $e/price } TCP/IP Illustrated Advanced Programming in the Unix environment Data on the Web 34.95

XQuery: 7 XQuery – Example 4 Get the average price of the books. { let $prices := $bib/book/price return { avg($prices) } } Should be: Actually is: type error: no common aggregate type because price is declared to be of type string

XQuery: 8 XQuery – Example 4 (continued) Get the average of the years of the books. { let $years := return { avg($years) } }

XQuery: 9 XQuery – Example 5 Get year (as an attribute) and title of book. (Use a predicate to limit the books to those published by Addison-Wesley.) for $b in $bib/book, $c in $b[publisher = "Addison-Wesley"] return { } { $c/title } TCP/IP Illustrated Advanced Programming in the Unix environment