XPath Help Karl Lieberherr. Source of information / Plan 20050915/http://www.w3.org/TR/2005/WD-xpath20- 20050915/

Slides:



Advertisements
Similar presentations
ISSUE 95 Lists. Changhais wish list The notion of field typed as a list (or a collection) should exist –For a list or a collection, it would be good to.
Advertisements

XML Data Management 8. XQuery Werner Nutt. Requirements for an XML Query Language David Maier, W3C XML Query Requirements: Closedness: output must be.
XML Examples. Bank Information Basic structure: A-101 Downtown 500 … Johnson Alma Surrey … A-101 Johnson …
Linked Lists Linked Lists Representation Traversing a Linked List
XML: Extensible Markup Language
Lesson 1.3 Unit 1, Lesson 3. Set:A collection of distinct objects Elements:All of the objects that make up a set.
NFA algorithms and AP algorithms Suggested by Yannis Smaragdakis.
Getting started with ML ML is a functional programming language. ML is statically typed: The types of literals, values, expressions and functions in a.
0 PROGRAMMING IN HASKELL Chapter 10 - Declaring Types and Classes.
CS 355 – PROGRAMMING LANGUAGES Dr. X. Apply-to-all A functional form that takes a single function as a parameter and yields a list of values obtained.
CS-1010 Dr. Mark L. Hornick 1 Selection Statements and conditional expressions.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Trees Chapter 8.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
XQuery from the Experts Chapter 5 – Introduction to the formal Semantics Νίκος Λούτας.
Chapter 5 Section 1 Sets Basics Set –Definition: Collection of objects –Specified by listing the elements of the set inside a pair of braces. –Denoted.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
12 April 2013Lecture 2: Intervals, Interval Arithmetic and Interval Functions1 Intervals, Interval Arithmetic and Interval Functions Jorge Cruz DI/FCT/UNL.
Chapter 8 . Sequence Control
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus.
Functional programming: LISP Originally developed for symbolic computing First interactive, interpreted language Dynamic typing: values have types, variables.
Trees CMSC 433 Chapter 8.1 Nelson Padua-Perez Bill Pugh.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Efficient Query Evaluation over Temporally Correlated Probabilistic Streams Bhargav Kanagal, Amol Deshpande ΗΥ-562 Advanced Topics on Databases Αλέκα Σεληνιωτάκη.
Trees. Tree Terminology Chapter 8: Trees 2 A tree consists of a collection of elements or nodes, with each node linked to its successors The node at the.
TDDD43 XML and RDF Slides based on slides by Lena Strömbäck and Fang Wei-Kleiner 1.
1 Static Type Analysis of Path Expressions in XQuery Using Rho-Calculus Wang Zhen (Selina) Oct 26, 2006.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
Lecture 22 XML querying. 2 Example 31.5 – XQuery FLWOR Expressions ‘=’ operator is a general comparison operator. XQuery also defines value comparison.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
XPath. Why XPath? Common syntax, semantics for [XSLT] [XPointer][XSLT] [XPointer] Used to address parts of an XML document Provides basic facilities for.
CSE314 Database Systems The Relational Algebra and Relational Calculus Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Web Data Management Indexes. In this lecture Indexes –XSet –Region algebras –Indexes for Arbitrary Semistructured Data –Dataguides –T-indexes –Index Fabric.
1.6 Compound and Absolute Value Inequalities Compound inequalities are just more than one inequality at the same time. Sometimes, they are connected by.
CS551 - Lecture 8 1 CS551 Modelling with Objects (Chap. 3 of UML) Yugi Lee STB #555 (816)
Built-in Data Structures in Python An Introduction.
11 Chapter 4 Grammars and Parsing Grammar Grammars, or more precisely, context-free grammars, are the formalism for describing the structure of.
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
THE REAL NUMBERS College Algebra. Sets Set notation Union of sets Intersection of sets Subsets Combinations of three or more sets Applications.
Chapter 2 Inequalities. Lesson 2-1 Graphing and Writing Inequalities INEQUALITY – a statement that two quantities are not equal. SOLUTION OF AN INEQUALITY.
Union and Intersection
XPath --XML Path Language Motivation of XPath Data Model and Data Types Node Types Location Steps Functions XPath 2.0 Additional Functionality and its.
XJ: Facilitating XML Processing in Java Matthew Harren Mukund Raghavachari Oded Shmueli Michael Burke Rajesh Bordawekar Igor Pechtchanski Vivek Sarkar.
CSE 6331 © Leonidas Fegaras XQuery 1 XQuery Leonidas Fegaras.
Lecture 23 XQuery 1.0 and XPath 2.0 Data Model. 2 Example 31.7 – User-Defined Function Function to return staff at a given branch. DEFINE FUNCTION staffAtBranch($bNo)
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
1. 2 Translations Stretches Reflections Combinations 1. Function Transformations Horizontal Vertical x-axis y-axis y = x Inverse Relations FRSTFRST 3.
1 The XPath Language. 2 XPath Expressions Flexible notation for navigating around trees A basic technology that is widely used uniqueness and scope in.
Jesse proposal1 Jesse’s proposal Karl Lieberherr.
Lists/Dictionaries. What we are covering Data structure basics Lists Dictionaries Json.
DATA STRUCURES II CSC QUIZ 1. What is Data Structure ? 2. Mention the classifications of data structure giving example of each. 3. Briefly explain.
Notes Over 1.2.
XML: Extensible Markup Language
Ch 6.5 Solving Compound Inequalities Involving “OR”
Graph Database.
Querying XML XQuery.
Querying XML XQuery.
Operations with Sets A = { 1, 2, 3 ,4, 5} B = { 2, 4, 6, 8, 10}
Set-Builder Notation.
Lecture 15 (Notes by P. N. Hilfinger and R. Bodik)
What is the difference between and and or?
Java Programming Course
UNIT V Run Time Environments.
Solving and graphing Compound Inequalities
XQuery Leonidas Fegaras.
Objectives The student will be able to:
Lecture 25: The Metacircular Evaluator Eval Apply
Presentation transcript:

XPath Help Karl Lieberherr

Source of information / Plan / / Complex definition We want to extract the “static” part of XPath Objective: Use / and /+/ (//) to build sequences and use operators: union, intersection and except to combine them.

Mismatches XPath can work without schema. But we want to visualize XPath expression in schema. Works only for “static” XPath expressions XPath views meaning of expression as a sequence. Strategies views the meaning of an expression as a function that maps objects to object graph slices. Traversing slice: sequence of nodes.

Mismatches But we can also view the meaning of a strategy and a class graph as another graph: TraversalGraph

XPath data model In the data model, a value is always a sequence. A sequence is an ordered collection of zero or more items. An item is either an atomic value or a node. singleton, empty sequence. Sequences are never nested.

EBNF for XPath [26] PathExpr ::= ("/" RelativePathExpr?) | ("//" RelativePathExpr) | RelativePathExprPathExpr RelativePathExpr [27] RelativePathExpr ::= StepExpr (("/" | "//") StepExpr)*RelativePathExprStepExpr [28] StepExpr ::= AxisStep | FilterExprStepExprAxisStepFilterExpr

Class dictionaries / EBNF exercise3.txt class dictionaries are both a simplification and extension of EBNF.

EBNF for XPath [30] ForwardStep ::= (ForwardAxis NodeTest) | AbbrevForwardStepForwardStepForwardAxis NodeTestAbbrevForwardStep [31] ForwardAxis ::= | | | | | | | ForwardAxis

EBNF for XPath Combining Node Sequences [14] UnionExpr ::= IntersectExceptExpr ( ("union" | "|") IntersectExceptExpr )*UnionExprIntersectExceptExpr [15] IntersectExceptExpr ::= Instanceof Expr ( ("intersect" | "except") InstanceofExpr )*IntersectExceptExprInstanceof Expr InstanceofExpr [16] InstanceofExpr::= PathExprInstanceofExprPathExpr

sequence operations XPath provides the following operators for combining sequences of nodes: The union and | operators are equivalent. They take two node sequences as operands and return a sequence containing all the nodes that occur in either of the operands. The intersect operator takes two node sequences as operands and returns a sequence containing all the nodes that occur in both operands. The except operator takes two node sequences as operands and returns a sequence containing all the nodes that occur in the first operand but not in the second operand.

sequence operations $seq1 is bound to (A, B) $seq2 is bound to (A, B) $seq3 is bound to (B, C) Then: $seq1 union $seq2 evaluates to the sequence (A, B). $seq2 union $seq3 evaluates to the sequence (A, B, C). $seq1 intersect $seq2 evaluates to the sequence (A, B). $seq2 intersect $seq3 evaluates to the sequence containing B only. $seq1 except $seq2 evaluates to the empty sequence. $seq2 except $seq3 evaluates to the sequence containing A only.

Declare context node type what is meaning of / B and /+/ B?

Mixing strategies and XPath?? what would the meaning be of: –s1 : from A via B to C –s2 : A /+/ D –union (s1 s2)