Pre-Discussion. XQuery: An XML Query Language. Outline. 1. The story, in brief is. Other query languages. XML vs. Relational Data

Similar documents
XQuery. Leonidas Fegaras University of Texas at Arlington. Web Databases and XML L7: XQuery 1

Introduction to XQuery and XML Databases

XML: Extensible Markup Language

TDDD43. Theme 1.2: XML query languages. Fang Wei- Kleiner h?p:// TDDD43

XML databases. Jan Chomicki. University at Buffalo. Jan Chomicki (University at Buffalo) XML databases 1 / 9

XML and information exchange. XML extensible Markup Language XML

XML Metadata Standards and Topic Maps

Progress Report on XQuery

Big Data 12. Querying

Part VII. Querying XML The XQuery Data Model. Marc H. Scholl (DBIS, Uni KN) XML and Databases Winter 2005/06 153

A Modular modular XQuery implementation

Event Stores (I) [Source: DB-Engines.com, accessed on August 28, 2016]

Manipulating XML Trees XPath and XSLT. CS 431 February 18, 2008 Carl Lagoze Cornell University

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views

Big Data 10. Querying

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

DBS2: Exkursus XQuery and XML-Databases. Jan Sievers Jens Hündling Lars Trieloff

The XML World View a personal vision with challenges

BEAWebLogic. Integration. Transforming Data Using XQuery Mapper

Querying purexml Part 1 The Basics

Introduction to XQuery. Overview. Basic Principles. .. Fall 2007 CSC 560: Management of XML Data Alexander Dekhtyar..

XPath. by Klaus Lüthje Lauri Pitkänen

XML Query (XQuery) Requirements

Next Generation Query and Transformation Standards. Priscilla Walmsley Managing Director, Datypic

M359 Block5 - Lecture12 Eng/ Waleed Omar

XML Systems & Benchmarks

Advanced Database Technologies XQuery

The XQuery Data Model

Semistructured Data and XML

Working with XML and DB2

XQuery Update. An Update Copyright 2008, Oracle Corp. 1

XML Technologies. Doc. RNDr. Irena Holubova, Ph.D. Web pages:

XML Technical Overview. Bill Arledge, Consulting Product Manager BMC Software Inc.

Querying XML Documents. Organization of Presentation

XQuery. Announcements (March 21) XQuery. CPS 216 Advanced Database Systems

EMERGING TECHNOLOGIES

Oracle Database 12c: Use XML DB

DISCUSSION 5min 2/24/2009. DTD to relational schema. Inlining. Basic inlining

COPYRIGHTED MATERIAL. Contents. Part I: Introduction 1. Chapter 1: What Is XML? 3. Chapter 2: Well-Formed XML 23. Acknowledgments

81067AE Development Environment Introduction in Microsoft

Navigating Input Documents Using Paths4

Why do we need an XML query language? XQuery: An XML Query Language CS433. Acknowledgment: Many of the slides borrowed from Don Chamberlin.

XML. Semi-structured data (SSD) SSD Graphs. SSD Examples. Schemas for SSD. More flexible data model than the relational model.

Chapter 13 XML: Extensible Markup Language

Lecture 8. Database Management and Queries

516. XSLT. Prerequisites. Version 1.2

DB2 SQL Class Outline

Querying XML data: Does One Query Language Fit All? Abstract 1.0 Introduction 2.0 Background: Querying XML documents

XQUERY: an XML Query Language

SQL. History. From Wikipedia, the free encyclopedia.

XQuery Optimization Based on Rewriting

The Specification Xml Failed To Validate Against The Schema Whitespace

Introduction to Databases CS348

DSD: A Schema Language for XML

Teiid Designer User Guide 7.5.0

Semi-structured Data. 8 - XPath

Welcome to. Software Belux Techical Symposium November 14, Information Management

XML Wrap-up. CS 431 March 1, 2006 Carl Lagoze Cornell University

Introduction to Semistructured Data and XML. Overview. How the Web is Today. Based on slides by Dan Suciu University of Washington

XQuery 1.0: An XML Query Language

Big Data Exercises. Fall 2016 Week 9 ETH Zurich

Table of Contents Chapter 1 - Introduction Chapter 2 - Designing XML Data and Applications Chapter 3 - Designing and Managing XML Storage Objects

XML in Databases. Albrecht Schmidt. al. Albrecht Schmidt, Aalborg University 1

XML technology is very powerful, but also very limited. The more you are aware of the power, the keener your interest in reducing the limitations.

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

An Algebraic Approach to XQuery View Maintenance

IBM DB2 11 DBA for z/os Certification Review Guide Exam 312

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

XML Query Languages. Yanlei Diao UMass Amherst April 22, Slide content courtesy of Ramakrishnan & Gehrke, Donald Kossmann, and Gerome Miklau

Relational Databases

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

ADT 2009 Other Approaches to XQuery Processing

Module 4. Implementation of XQuery. Part 1: Overview of Compiler, Runtime System

Part X. XQuery Querying XML Documents

Part X. XQuery Querying XML Documents. Torsten Grust (WSI) Database-Supported XML Processors Winter 2008/09 246

Table of Contents. Preface... xvii

Oracle 11g: XML Fundamentals

SDMX self-learning package XML based technologies used in SDMX-IT TEST

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

StreamServe Persuasion SP5 XMLIN

XML Query Requirements

Index-Driven XQuery Processing in the exist XML Database

COMP9321 Web Application Engineering

Documentation for Quark xquery_model and related libraries Pet-Chean Ang and Anand Bhaskar 30 th May 2005

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

XPath and XQuery. Introduction to Databases CompSci 316 Fall 2018

from XMLAttributes Author: Jan-Eike Michels Source: U.S.A. Status: SQL:2003 TC and SQL:200x WD change proposal Date: March 8, 2004

Efficient Implementation of XQuery Constructor Expressions

JENA: A Java API for Ontology Management

Variable Scope The Main() Function Struct Functions Overloading Functions Using Delegates Chapter 7: Debugging and Error Handling Debugging in Visual

Informatics 1: Data & Analysis

Querying XML Data. Querying XML has two components. Selecting data. Construct output, or transform data

Introduction to XML 3/14/12. Introduction to XML

Extending CMIS Standard for XML Databases

Query Languages for XML

Native XML Support in DB2 Universal Database

Introduction to Database Systems CSE 414

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML

XQuery FLOWR Expressions Lecture 35

PrepAwayExam. High-efficient Exam Materials are the best high pass-rate Exam Dumps

Transcription:

Pre-Discussion XQuery: An XML Query Language D. Chamberlin After the presentation, we will evaluate XQuery. During the presentation, think about consequences of the design decisions on the usability of the language. XQuery : XML :: SQL : relational tables Intended as a standard way to query different XML data sources Declarative, Uses expressions to assemble queries and results A number of factors influenced XQuery 2. Pre-existing standards and languages 3. The vision behind XQuery, it s intended use 4. Current affairs XML vs. Relational Data Relational Data Flat Structure Optimized for efficient access and retrieval XML Hierarchical Structure Optimized for representing intrinsic relationships of data that make up an XML document Implications for query language design Path Expressions FLWOR Expressions Case sensitive, Other query languages Constrained by existing standards ( XML Schema, XPath) Influenced by other languages XSLT, Quilt etc. Each of these were good for a niche area XPath Cannot create new XML, introduce variables or namespaces, select part of nodes etc. XSLT ( styling XML for display formats ) Joins, querying etc can be difficult to do (debatable!) 1

Other query languages XQuery Joins and Sorts Manipulating Sequences of Values User defined functions easy to write (even with recursion) Create temporary results and navigate them Restructure using FLWOR expressions The vision Data Integration Built by people from the db and SQL community XML Schema included (allows validation) Designed to support query processing Procedural query processing User defined functions FLWOR expressions Element Constructors for temporary results 2. Pre-existing languages 3. The vision behind XQuery, it s intended use 1. Data Model 2. Query Processing Steps 3. Language Features Data Model Abstract representation for XML docs Based on the notion of sequences of nodes or atomic values Nodes form hierarchies to represent relationships implicitly Document order is important items.xml 1. Data Model <item status = available > <itemno>0021</itemno> <description>scooter</description> <seller>vespa</seller> <reserve-price>12000</reserveprice> </item> 2

2. Query Processing Steps 3. Language Features XML DOC Schema validation Query Data Model Query Path Expressions Predicates FLWOR Functions Type System XML Representation Query Results Serialization Language Features Path Expressions to navigate through elements in an XML document Based on XPath syntax Series of steps separated by / Each step returns a sequence of nodes The last sequence is the value of the Expression doc( items.xml")/ child::*/ child::item[child::seller = Vespa ]/ child::description Language Features Predicates to filter a sequence of values Often used in the steps of a path expression item[seller = Vespa ] Evaluated on each item of the sequence seller = Vespa used to select some item nodes and discard others FLWOR Iteration over sequences of values FLWOR for, let, when, order-by, return Adopted from Quilt For each item that has more than ten bids, generate a popular-item element containing item-description (pg: 606) FLWR for $i in doc( items.xml )/*/item let $b := doc( bids.xml ) /*/bid[itemno = $i/itemno] where count ($b) > 10 return <popular-item> { $i/description } </popular-item> 3

Functions Functions Libraries as well as User defined Recursion supported define function depth( element $e) returns integer { } depth(doc( bids.xml )) Type System Based on the Type System of XML Schema Queries need to refer to types sometimes Can use qualified name, generic keywords Occurrence indicators Element of type order+ Dynamic type information: typeswitch Typecasting available: cast, treat and assert 2. Pre-existing languages 3. The vision behind XQuery, it s inteded use 4. Current affairs Current affairs Supported by all major vendors IBM, Oracle, Microsoft etc XQuery code should work across vendors Compatible with several W3C standards XML, Namespaces, XSLT, XPath, and XML Schema. XQuery 1.0 is still a working draft Discussion: Evaluating XQuery Full-class discussion: How would you evaluate XQuery? As a query language, how does it compare to SQL? What are your general feelings about usability? When would you use it? When would you prefer something else like XML-QL or XSLT (or even mapping XML to relational and using SQL)? for and return For and Return variable for $m in (2,3), $n in (5,10) Comma operator return <fact> {m} times {n} is {$m * $n} </fact> Element constructor 4

for and return For and Return for $m in (2,3), $n in (5,10) return <fact> {m} times {n} is {$m * $n} </fact> RESULT <fact> 2 times 5 is 10 </fact> <fact> 2 times 10 is 20 </fact> <fact> 3 times 5 is 15 </fact> <fact> 3 times 10 is 30 </fact> Let for $i in (1 to 3) let $j := (1 to $i) Let $i = 1, $j = 1 $i = 2, $j = (1, 2) $i = 3, $j = (1, 2, 3) 5