Managing XML and Semistructured Data

Slides:



Advertisements
Similar presentations
Querying on the Web: XQuery, RDQL, SparQL Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology.
Advertisements

Web Data Management XQuery 1. In this lecture Summary of XQuery FLWOR expressions – For, Let, Where, Order by, Return FOR and LET expressions Collections.
2005conjunctive-ii1 Query languages II: equivalence & containment (Motivation: rewriting queries using views)  conjunctive queries – CQ’s  Extensions.
Lecture 11: Datalog Tuesday, February 6, Outline Datalog syntax Examples Semantics: –Minimal model –Least fixpoint –They are equivalent Naive evaluation.
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.
Incremental Maintenance for Materialized Views over Semistructured Data Written By: Serge Abiteboul Jason McHuge Michael Rys Vasilis Vassalos Janet L.
Relational Databases for Querying XML Documents: Limitations & Opportunities VLDB`99 Shanmugasundaram, J., Tufte, K., He, G., Zhang, C., DeWitt, D., Naughton,
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 311 Database Systems I The Semistructured Data Model.
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.
Friday, September 4 th, 2009 The Systems Group at ETH Zurich XML and Databases Exercise Session 6 courtesy of Ghislain Fourny/ETH © Department of Computer.
Managing XML and Semistructured Data Lecture 8: Query Languages - XML-QL Prof. Dan Suciu Spring 2001.
Web-site Management System Strudel Presented by: LAKHLIFI Houda Instructor: Dr. Haddouti.
The Query Language TQL Speaker: Giovanni Conforti Joint work with: G. Ghelli, A. Albano, D. Colazzo, P. Manghi, and C. Sartiani Università di Pisa WebDB.
From Semistructured Data to XML: Migrating The Lore Data Model and Query Language Roy Goldman, Jason McHugh, Jennifer Widom Stanford University
1 Lecture 10 XML Wednesday, October 18, XML Outline XML (4.6, 4.7) –Syntax –Semistructured data –DTDs.
Managing XML and Semistructured Data Lecture : Indexes.
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.
Typing Semistructured Data By, Keshava Reddy Kottapally Goutham Chinnapolamada Source: Serge Abiteboul, Dan Suciu, Peter Buneman, Data on the web: From.
Query Languages - XQuery Slides partially from Dan Suciu.
Models and languages for semistructured data Bridging documents and databases.
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 Lecture 16: Indexes Prof. Dan Suciu Spring 2001.
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 14: Constraints and Keys Prof. Dan Suciu Spring 2001.
Managing XML and Semistructured Data Lecture 1: Preliminaries and Overview Prof. Dan Suciu Spring 2001.
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.
Managing XML and Semistructured Data Lecture 2: XML Prof. Dan Suciu Spring 2001.
Querying XML February 12 th, Querying XML Data XPath = simple navigation through the tree XQuery = the SQL of XML XSLT = recursive traversal –will.
Advisor: Prof. Zaniolo Hung-chih Yang Ling-Jyh Chen XML Query Language.
IS432: Semi-Structured Data Dr. Azeddine Chikh. 1. Semi Structured Data Object Exchange Model.
Introduction to XQuery Resources: Official URL: Short intros:
1 XML-KSI, 2004 XML- : an extendible framework for manipulating XML data Jaroslav Pokorny Charles University Praha.
Web Data Management Indexes. In this lecture Indexes –XSet –Region algebras –Indexes for Arbitrary Semistructured Data –Dataguides –T-indexes –Index Fabric.
Managing XML and Semistructured Data Lecture 13: XDuce and Regular Tree Languages Prof. Dan Suciu Spring 2001.
Lecture 6: XML Query Languages Thursday, January 18, 2001.
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.
Management of XML and Semistructured Data Lecture 10: Schemas Monday, April 30, 2001.
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.
Lecture 7: Foundations of Query Languages Tuesday, January 23, 2001.
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.
SchemaLog – A Visual Perspective CPSC 534B Laks V.S. Lakshmanan UBC (names of schema components abbreviated.)
CSE 6331 © Leonidas Fegaras XQuery 1 XQuery Leonidas Fegaras.
Lecture 17: XPath and XQuery Wednesday, Nov. 7, 2001.
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)
CS589 Principles of DB Systems Fall 2008 Lecture 4d: Recursive Datalog with Negation – What is the query answer defined to be? Lois Delcambre
Lecture 9: Query Complexity Tuesday, January 30, 2001.
Lecture 14: Relational Algebra Projects XML?
Querying XML and Semistructured Data
Management of XML and Semistructured Data
Data Warehousing/Mining Comp 150 DW Semistructured Data
Managing XML and Semistructured Data
Managing XML and Semistructured Data
Managing XML and Semistructured Data
Lecture 12: XML, XPath, XQuery
Alin Deutsch, University of Pennsylvania Mary Mernandez, AT&T Labs
Lecture 9: XML Monday, October 17, 2005.
XQuery Leonidas Fegaras.
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
Semi-Structured data (XML)
Lecture 11: XML and Semistructured Data
Presentation transcript:

Managing XML and Semistructured Data Lecture 5: Query Languages - Lorel and UnQL Prof. Dan Suciu Spring 2001

In this lecture A core query language Lorel UnQL Resources: UnQL: A Query Language and Algebra for Semistructured Data Based on Structural Recursion Buneman, Fernandez, Suciu. VLDBJ 2000 The Lorel Query Language for Semistructured Data  by Abiteboul, Quass, McHugh, Widom, Wiener, in International Journal on Digital Libraries, 1997.

A Core Query Language Will illustrate with: DB = . . . 1976 Database biblio &o1 book paper book &o12 &o24 &o29 . . . title author date author title author date &o52 &96 &25 &30 1976 Database Systems &o47 &o48 &o50 Roux Combalusier Smith 1999 Database Systems

Query 1: SELECT author: X FROM biblio.book.author X . . . answer &o1 &o12 &o24 &o29 &96 &30 paper book author date title biblio &o47 &o48 &o50 &o52 &25 Smith 1999 Database Systems Roux Combalusier 1976 . . . author Answer = {author: “Smith”, author: “Roux”, author: “Comalusier”} author author

Query 2: SELECT row: X FROM biblio._ X WHERE “Smith” in X.author . . . answer &o1 &o12 &o24 &o29 &96 &30 paper book author date title biblio &o47 &o48 &o50 &o52 &25 Smith 1999 Database Systems Roux Combalusier 1976 . . . . . . Answer = {row: {author:“Smith”, date: 1999, title: “Database…”}, row: … } row

SELECT row: ( SELECT author: Y FROM X.author Y) FROM biblio.book X Query 3: row answer &o1 &o12 &o24 &o29 &96 &30 paper book author date title biblio &o47 &o48 &o50 &o52 &25 Smith 1999 Database Systems Roux Combalusier 1976 . . . &a1 row Answer = {row: {author:“Smith”}, row: {author:“Roux”, author:“Combalusier”,}, } &a2 author author author

SELECT ( SELECT row: {author: Y, title: T} FROM X. author Y, X SELECT ( SELECT row: {author: Y, title: T} FROM X.author Y, X.title T) FROM biblio.book X WHERE “Roux” in X.author Query 4: row answer &o1 &o12 &o24 &o29 &96 &30 paper book author date title biblio &o47 &o48 &o50 &o52 &25 Smith 1999 Database Systems Roux Combalusier 1976 . . . Answer = {row: {author:“Roux”, title: “Database…”}, row: {author:“Combalusier”, title: “Database…”}, } &a1 row author &a2 title title author (Query has typo in the book )

Formal Semantics SELECT E[X1, …, Xn] FROM F WHERE C Given query Q = and database DB Answer(Q,DB) is defined in two steps: Step 1: compute all bindings: Cij are node oids or atomic values Must satisfy paths in F Must satisfy conditions in C Step 2: answer is E[C11, …, C1n]  …  E[Cm1, …, Cmn] X1 X2 … Xn Ci1 Ci2 Cin

Formal Semantics When E has nested subqueries, apply semantics recursively Note: so far we have dealt with an unordered model What do we need to do for order ? Complexity: PTIME in |DB| (not in |Q|).

Lorel Minor syntactic differences in regular path expressions (% instead of _, # instead of _*) Common path convention: becomes: SELECT biblio.book.author FROM biblio.book WHERE biblio.book.year = 1999 SELECT X.author FROM biblio.book X WHERE X.year = 1999

Lorel Existential variables: What happens with books having multiple authors ? Author is existentially quantified: SELECT biblio.book.year FROM biblio.book WHERE biblio.book.author = “Roux” SELECT X.year FROM biblio.book X, X.author Y WHERE Y = “Roux”

Lorel Path variables. @P in: Constructing new results What happens on graphs with cycles ? Constructing new results Several default rules Casting between datatypes Very useful in practice SELECT P FROM biblio.# @P X

UnQL Patterns: Equivalent to: SELECT row: X WHERE {biblio.book: {author “Roux”, title X}} in DB, SELECT row: X FROM biblio.book Y, Y.author Z, Y.title X WHERE Z=“Roux”

UnQL Label variables: “find all publication types and their titles where Roux is an author” SELECT row: {type: L, title : X} WHERE {biblio.L: {author “Roux”, title X}} in DB,

UnQL Unrestricted use of label variables creates problems: SELECT row: {type: L, title : Y} WHERE {biblio.(book|L).title X} in DB, SELECT row: {type: L, title : Y} WHERE {biblio.(L)*.title X} in DB,

UnQL In UnQL regular path expressions cannot contain label variables: Pat ::= Var | Const | {L1:Pat1, …, Ln:Patn} L ::= RegularPathExpression | LabelVariable