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.

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: Extensible Markup Language
1 Web Data Management Path Expressions. 2 In this lecture Path expressions Regular path expressions Evaluation techniques Resources: Data on the Web Abiteboul,
Relational Databases for Querying XML Documents: Limitations & Opportunities VLDB`99 Shanmugasundaram, J., Tufte, K., He, G., Zhang, C., DeWitt, D., Naughton,
CM036: Advanced Database Lecture 3 Relational Algebra and SQL.
1 Rewriting Nested XML Queries Using Nested Views Nicola Onose joint work with Alin Deutsch, Yannis Papakonstantinou, Emiran Curtmola University of California,
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.
From Semistructured Data to XML: Migrating The Lore Data Model and Query Language Roy Goldman, Jason McHugh, Jennifer Widom Stanford University
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
1 COS 425: Database and Information Management Systems XML and information exchange.
Containment and Equivalence for an XPath Fragment By Gerom e Mikla Dan Suciu Presented By Roy Ionas.
Models and languages for semistructured data Bridging documents and databases.
XML and The Relational Data Model
1 New Ways of Querying the Web by Eliahu Brodsky and Alina Blizhovsky.
Storing and Querying Ordered XML Using a Relational Database System By Khang Nguyen Based on the paper of Igor Tatarinov and Statis Viglas.
LORE Light Object Repository by Othman Chhoul CSC5370 Fall 2003.
Managing XML and Semistructured Data Lecture 16: Indexes Prof. Dan Suciu Spring 2001.
The Query Compiler 16.1 Parsing and Preprocessing Meghna Jain(205) Dr. T. Y. Lin.
CH 11 Multimedia IR: Models and Languages
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
Managing XML and Semistructured Data Lecture 1: Preliminaries and Overview Prof. Dan Suciu Spring 2001.
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Sangam: A Transformation Modeling Framework Kajal T. Claypool (U Mass Lowell) and Elke A. Rundensteiner (WPI)
OEM and LORE Query Language Sanjay Madria Department of Computer Science University of Missouri-Rolla
Putting Semi-structured Data to Practice Alon Levy Seattle, Washingon University of Washington.
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Programming by Example using Least General Generalizations Mohammad Raza, Sumit Gulwani & Natasa Milic-Frayling Microsoft Research.
Introduction to XPath Bun Yue Professor, CS/CIS UHCL.
Abstract State Machines and Computationally Complete Query Languages Andreas Blass,U Michigan Yuri Gurevich,Microsoft Research & U Michigan Jan Van den.
10/06/041 XSLT: crash course or Programming Language Design Principle XSLT-intro.ppt 10, Jun, 2004.
IS432: Semi-Structured Data Dr. Azeddine Chikh. 1. Semi Structured Data Object Exchange Model.
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.
XML-QL A Query Language for XML Charuta Nakhe
TDDD43 XML and RDF Slides based on slides by Lena Strömbäck and Fang Wei-Kleiner 1.
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.
Extensible Markup and Beyond
XML과 Database 홍기형 성신여자대학교 성신여자대학교 홍기형.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
Lecture 11 XSL Transformations (part 1: Introduction)
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.
Database Systems Part VII: XML Querying Software School of Hunan University
[ 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.
The Semistructured-Data Model Programming Languages for XML Spring 2011 Instructor: Hassan Khosravi.
XML and Database.
Semi-structured Data In many applications, data does not have a rigidly and predefined schema: –e.g., structured files, scientific data, XML. Managing.
CSE 6331 © Leonidas Fegaras XQuery 1 XQuery Leonidas Fegaras.
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.
XML: Extensible Markup Language
Managing XML and Semistructured Data
Querying XML and Semistructured Data
Data Warehousing/Mining Comp 150 DW Semistructured Data
XML Data Introduction, Well-formed XML.
Querying XML XPath.
Semi-Structured data (XML Data MODEL)
Querying XML XPath.
Alin Deutsch, University of Pennsylvania Mary Mernandez, AT&T Labs
Lecture 3 Relational Algebra and SQL
Lecture 9: XML Monday, October 17, 2005.
XQuery Leonidas Fegaras.
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Semi-structured Data In many applications, data does not have a rigidly and predefined schema: e.g., structured files, scientific data, XML. Managing such.
Semi-Structured data (XML)
Lecture 11: XML and Semistructured Data
Presentation transcript:

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 of nodes (eg. for sub elements). - an unordered set of nodes (eg. For attributes). Compatible with XML schemas

Comparison of XML and semi structured data Similarities: - both are best described by a labeled graph. - both are schema-less self describing. Differences: - XML is ordered; semi structured data is unordered. - XML can mix text and elements

Required features for a Query Language Expressive power - The Query language must be at least as expressive as SQL on relational data. - The Query language should have the ability to restructure data. - The Query language should be able to navigate data with arbitrary nesting. Semantics - It is very important in a query language for query transformation and optimization.

Compositionality - Our queries must remain in the same data model. They cannot take data in one model and produce output in another model. Schema - when structure is defined, a query language should be exploited for optimization, type checking etc.,

Query languages For semi structured data - Lorel (Lightweight Object REpository Language) - UnQL (Unstructured Query Language) -StruQL, MSL, W3QL, WebSQL, Weblog, etc., For XML - XML-QL (XML Query Language) - XSLT & structural recursion. - XML Query Algebra.

Formal Semantics Given query Q = SELECT E[X 1,……. X n ] FROM F WHERE C and database DB Answer: (Q,DB) is defined in two steps: –Step 1: compute all bindings: C ij are node oids or atomic values

Must satisfy paths in F Must satisfy conditions in C –Step 2: answer is E[C 11, …, C 1n ]  …  E[C m1, …, C mn ]

When E has nested sub queries, 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 SELECT biblio.book.author FROM biblio.book WHERE biblio.book.year = 1999

Becomes SELECT X.author FROM biblio.book X WHERE X.year = 1999

Lorel Query language of LORE system adapts OQL to semi structured data. Select X.title from bib.article X where “tova milo” in X.author returns {title: “type inf…”}

Features of Lorel Differences with typed query languages - performs implicit coercions. - deals with missing attributes. - deals with set valued attributes. eg., x.year > 1998 may have several years. Select clause creates new nodes. Allows for nested queries. Allows for regular path expressions.

UnQL (Unstructured Query language) UnQL is an extension of basic LOREL. UnQL does not make use of coercion unlike LOREL. “Where” clause contains 2 kinds of constructs. - generators; variables are bound via patterns. - conditions; as in LOREL “from” clause is not needed as variables are bound in patterns.

UnQL Queries Eg., Select title:T where {bib:article:{title:T, year:Y}}in db, y>1998. Root of the database is explicitly represented: db UnQL queries can be rewritten in LOREL. The equivalent LOREL for the above query is: select title:T from bib.article A, A.title T, A.year Y where Y>1998.

Additional features of LOREL Label variables - can combine “schema” and “data” information. - can turn tables to data and vice-versa. - perform group-by operations. Can match variables with regular expressions.

References Managing XML and semi structured data – Lecture series by Prof. Dan Suciu. website: iu/COURSES/590DS/