XQL, OQL and SQL Xia Tang Sixin Qian Shijun Shen Feb 18, 2000.

Slides:



Advertisements
Similar presentations
Open Office.Org What is the Open Office.org Source Project? Open source project through which Sun Microsystems is releasing the technology for the popular.
Advertisements

XML: Extensible Markup Language
SQL Group Members: Shijun Shen Xia Tang Sixin Qiang.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
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?
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.
XSLT XML DBs, and Schemas Week 18 DSA. The Whisky Case study XSLT can be applied in the client. –Add a xml processing instruction to the xml to bind to.
XQL (XML Query Language) Jonathan Robie (Software AG) Eduard Derksen (CSCIO) Peter Fankhauser (GMD-IPSI) Ed Howland (DEGA) Gerald Huck (GMD-IPSI) Ingo.
1 COS 425: Database and Information Management Systems XML and information exchange.
1 New Ways of Querying the Web by Eliahu Brodsky and Alina Blizhovsky.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
XPath Tao Wan March 04, What is XPath? n A language designed to be used by XSL Transformations (XSLT), Xlink, Xpointer and XML Query. n Primary.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Chapter 11.1 and 11.2 Data Manipulation: Relational Algebra and SQL Brian Cobarrubia Introduction to Database Management Systems October 4, 2007.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Introduction to XPath Bun Yue Professor, CS/CIS UHCL.
SD2520 Databases using XML and JQuery
ECA 228 Internet/Intranet Design I Intro to XSL. ECA 228 Internet/Intranet Design I XSL basics W3C standards for stylesheets – CSS – XSL: Extensible Markup.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
Navigating XML. Overview  Xpath is a non-xml syntax to be used with XSLT and Xpointer. Its purpose according to the W3.org is  to address parts of an.
Lecture 6 of Advanced Databases XML Schema, Querying & Transformation Instructor: Mr.Ahmed Al Astal.
Introduction to Databases Chapter 7: Data Access and Manipulation.
XML-QL A Query Language for XML Charuta Nakhe
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
1/17 ITApplications XML Module Session 7: Introduction to XPath.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XSLT and XPath, by Dr. Khalil1 XSL, XSLT and XPath Dr. Awad Khalil Computer Science Department AUC.
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
1 XPath XPath became a W3C Recommendation 16. November 1999 XPath is a language for finding information in an XML document XPath is used to navigate through.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation eXist Update Lecturer.
Lecture 22 XML querying. 2 Example 31.5 – XQuery FLWOR Expressions ‘=’ operator is a general comparison operator. XQuery also defines value comparison.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Querying Structured Text in an XML Database By Xuemei Luo.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
XPath. Why XPath? Common syntax, semantics for [XSLT] [XPointer][XSLT] [XPointer] Used to address parts of an XML document Provides basic facilities for.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
August Chapter 6 - XPath & XPointer Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
Database Systems Part VII: XML Querying Software School of Hunan University
XPath Aug ’10 – Dec ‘10. XPath   XML Path Language   Technology that allows to select a part or parts of an XML document to process   XPath was.
[ Part III of The XML seminar ] Presenter: Xiaogeng Zhao A Introduction of XQL.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
Introduction to the Document Object Model Eugenia Fernandez IUPUI.
1 XML Data Management XPath Principles Werner Nutt.
XML Query: xQuery Reference: Xquery By Priscilla Walmsley, Published by O’Reilly.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
XPath --XML Path Language Motivation of XPath Data Model and Data Types Node Types Location Steps Functions XPath 2.0 Additional Functionality and its.
1 XPath. 2 Agenda XPath Introduction XPath Nodes XPath Syntax XPath Operators XPath Q&A.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
CITA 330 Section 5 XPath. XSL XSL (Extensible Stylesheet Language) is the standard language for writing stylesheets to transform XML documents among different.
Displaying Data with XSLT ©NIITeXtensible Markup Language/Lesson 6/Slide 1 of 45 Objectives In this lesson, you will learn to: * Perform conditional formatting.
XML Schema – XSLT Week 8 Web site:
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
1 Relational Algebra and SQL. 2 Relational Query Languages Languages for describing queries on a relational database Relational AlgebraRelational Algebra.
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
Querying and Transforming XML Data
Introduction to the Document Object Model
Session IV Chapter 16 – XQuery
{ XML Technologies } BY: DR. M’HAMED MATAOUI
XML Path Language Andy Clark 17 Apr 2002.
Session II Chapter 16 – XQuery
Presentation transcript:

XQL, OQL and SQL Xia Tang Sixin Qian Shijun Shen Feb 18, 2000

XQL (XML Query Language) XQL is a notation for addressing and filtering the elements and text of XML documents.(W3C)

XQL (XML Query Language) XQL is designed specifically for XML documents. XQL is a proposed extension to the XSL pattern syntax. XQL is concise, simple, and powerful.

What is an XML Query?

Approaches Using Document Object Model subtrees as the basis for a query. Using data dictionaries or repository directory structures to identify nodes to be queried. Using a URL identify documents.

XQL notations.Selects the current node...Selects the parent of current node. /Selects the document node. a[expr]Select only those nodes matching a which also Satisfy the expression expr. a[n]Selects the nth matching node matching a a/bFor each node matching a, add the nodes matching b to the result. a//bFor each node matching a, add the descendant nodes matching b to the result. //bReturns elements in the entire document matching b. a/bAll nodes matching a or b.

XQL notation A simple string is interpreted as an element name. Example: table this query specification returns all elements.

XQL notation The child operator “/” indicates hierarchy. Front/author This query returns elements that are children of elements.

XQL notation The equals operator ‘=’. The content of an element or the value of an attribute may be specified using ‘=’. Front/author=‘Bob’ return all authors with the name ‘Bob’ that are children of the element.

XQL notation Attribute names are preceded by the They are treated as children of the elements to which they belong. Find the type attribute with ‘ ’ for all address elements

XQL notation The descendant operator ‘//’ indicates any number of intervening levels. Bookstore//title Find all title elements, one or more levels deep in the bookstore (arbitrary descendants).

XQL notation The filter operator ‘[]’ filters the set of nodes to its left based on the conditions inside the brackets. returns addresses: each of these addresses must have a attribute called ‘type’ with the value ‘ ’.

XQL notation Brackets’[]’ are also used for subscripts, which indicate position within a document. Conditions and subscripts, both uses of brackets may occur in the same query. to 2] It returns the first three ‘level 3’ sections.

Example Bob, CA ………. John, CA ………. Query: //customer Result: Bob,CA John,CA

XQL Expressions Terms node Selects all child elements with node name is node. * Selects all child Selects the attribute Selects all attributes. node() Matches an element node. text() Matches a text node. comment() Matches a comment. pi() Matches a processing instruction node.

XQL Expressions Namespaces and names In attribute names, the attribute prefix comes before the namespace prefix. my:book Find all book elements with the prefix 'my'.

XQL Expression Comparisons A set of binary comparison operators is available for comparing numbers and strings and returning Boolean results. and >= are allowed short cuts for $lt$, $le$, $gt$ and $ge$.

XQL Expressions Boolean and Set Operators Boolean expressions can be used within subqueries. Multiple conditions may be combined using Boolean operators and set operators.

XQL Expressions Grouping operator ‘()’. Parentheses ‘()’ can be used to group collection operators for clarity or where the normal precedence is inadequate to express an operation.

XQL Expressions Functions (collection functions) Taken from XSL pattern language text() The text contained within the element. This concatenates the text of all of the element's descendants. It does not include the tag names or any attribute values, comment values, etc. It trims the string as discussed in text(). (Returns a string.) value() Returns a type cast version of the value of an element. (See Datatypes) If data typing is not supported or a data type is not provided, returns the same as text(). nodeType() Returns a number to indicate the type of the node: element 1; attribute 2; text 3; PI 7; comment 8; document 9. nodeName() The tag name of the node, including the namespace prefix. (Returns a string.)

XQL Expression Collection Function search context of the Invocation instance; evaluates to a subset of the search context. Pure Function Ignore the search context; evaluates to either a constant value or to a value that depends only on the function's parameters.

XQL Expressions Extensible Functions To allow user-defined functions to be written, XQL provides a function called “function()”. Joins To allow subtrees from one data source to be inserted into another document subtree, subject to the join conditions.

XQL Expressions Renaming Operator “->” The nodes in a list may be renamed using the renaming operator. “->” may also be used to adjust namespaces in query results.

Precedence of Operators Production Operator(s) Grouping ( ) Filter [ ] Subscript [ ] Bang ! Path / // Comparison = != >= $eq$ $ne$ $lt$ $le$ $gt$ $ge$ $ieq$ $ine$ $ilt$ $ile$ $igt$ $ige$ Intersection $intersect$ Union $union$ | Negation $not$ Conjunction $and$ Disjunction $or$

XQL’s important key features XML documents can be queried like a database; XQL is based on of XML so it allows for powerful queries to be simply expressed; It uses a string syntax that allows queries to be used in URL’s or embedded in attributes.

Links QL-proposal.html