XPath Processor MQP Presentation April 15, 2003 Tammy Worthington Advisor: Elke Rundensteiner Computer Science Department Worcester Polytechnic Institute.

Slides:



Advertisements
Similar presentations
Bottom-up Evaluation of XPath Queries Stephanie H. Li Zhiping Zou.
Advertisements

Twig 2 Stack: Bottom-up Processing of Generalized-Tree-Pattern Queries over XML Documents Songting Chen, Hua-Gang Li *, Junichi Tatemura Wang-Pin Hsiung,
Transforming XML Part I Document Navigation with XPath John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel:
An Algorithm for Streaming XPath Processing with Forward and Backward Axes Charles Barton, Philippe Charles, Deepak Goyal, Mukund Raghavchari IBM T. J.
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University.
The Data Mining Visual Environment Motivation Major problems with existing DM systems They are based on non-extensible frameworks. They provide a non-uniform.
G. Gottlob, C. Koch & R. Pichler TU Wien, Vienna, Austria Elias Politarhos Advanced Databases M.Sc. in Information Systems Athens University of Economics.
` 1 VAMANA (Talk 2) (vǎ - mǎ - nǎ) Venkatesh Raghavan & Prof. Elke Rundensteiner DSRG Talk 1 ST May 2003 An Efficient XPath Query Engine Exploiting the.
Environments and Evaluation
XPath Carissa Mills Jill Kerschbaum. What is XPath? n A language designed to be used by both XSL Transformations (XSLT) and XPointer. n Provides common.
Cornell CS 502 More XML XML schema, XPATH, XSLT CS 502 – Carl Lagoze – Cornell University.
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.
Introduction to XSLT & its use in Grainger Library full-text & metadata projects Thomas G. Habing Grainger Engineering Library Presentation to ASIS&T,
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
10/06/041 XSLT: crash course or Programming Language Design Principle XSLT-intro.ppt 10, Jun, 2004.
Xpath Query Evaluation. Goal Evaluating an Xpath query against a given document – To find all matches We will also consider the use of types Complexity.
An Approach to Task Modelling for User Interface Design Costin Pribeanu National Institute for Research and Development in Informatics, Bucureşti, Romania.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
Lecture 6 of Advanced Databases XML Schema, Querying & Transformation Instructor: Mr.Ahmed Al Astal.
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.
Introduction to XPath Web Engineering, SS 2007 Tomáš Pitner.
CSE3201/CSE4500 Information Retrieval Systems
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
WORKING WITH XSLT AND XPATH
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XML as a Boxwood Data Structure Feng Zhou, John MacCormick, Lidong Zhou, Nick Murphy, Chandu Thekkath 8/20/04.
A Metadata Based Approach For Supporting Subsetting Queries Over Parallel HDF5 Datasets Vignesh Santhanagopalan Graduate Student Department Of CSE.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Querying Structured Text in an XML Database By Xuemei Luo.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
Lecture 11 XSL Transformations (part 1: Introduction)
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Database Systems Part VII: XML Querying Software School of Hunan University
1 Le Thi Thu Thuy*, Doan Dai Duong*, Virendrakumar C. Bhavsar* and Harold Boley** * Faculty of Computer Science, University of New Brunswick, Fredericton,
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Streaming XPath Engine Oleg Slezberg Amruta Joshi.
1 Typing XQuery WANG Zhen (Selina) Something about the Internship Group Name: PROTHEO, Inria, France Research: Rewriting and strategies, Constraints,
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
INRIA - Progress report DBGlobe meeting - Athens November 29 th, 2002.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
XFormsDB An XForms - Based Framework for Simplifying Web Application Development Markku Laine Master’s Thesis Presentation March 9, 2010.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
Computing & Information Sciences Kansas State University Friday, 20 Oct 2006CIS 560: Database System Concepts Lecture 24 of 42 Friday, 20 October 2006.
The Interpreter Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Martin Kruliš by Martin Kruliš (v1.1)1.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XPath --XML Path Language Motivation of XPath Data Model and Data Types Node Types Location Steps Functions XPath 2.0 Additional Functionality and its.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Overview of Previous Lesson(s) Over View 3 Model of a Compiler Front End.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Agenda Preliminaries Motivation and Research questions Exploring GLL
Querying and Transforming XML Data
CO4301 – Advanced Games Development Week 2 Introduction to Parsing
{ XML Technologies } BY: DR. M’HAMED MATAOUI
XML in Web Technologies
CS 3304 Comparative Languages
OrientX: an Integrated, Schema-Based Native XML Database System
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Interpreter Pattern.
More XML XML schema, XPATH, XSLT
Presentation transcript:

XPath Processor MQP Presentation April 15, 2003 Tammy Worthington Advisor: Elke Rundensteiner Computer Science Department Worcester Polytechnic Institute

XPath Processor 2 XQuery Introduction MASS (A Multi-Axis Storage Structure for Large XML Documents) VAMANA (XPath Query Engine) XQuery Engine (future development) Execution TreeMass Interface Node Set XPath Expression XML Doc XPath Node Set Input XQuery XML Doc XPath Expression XPath Processor

XPath Processor 3 Processor Requirements Must conform with XPATH grammar as specified by W3C Implementation in C++ –Performance needed since XQuery can have several XPath expressions –MASS and VAMANA in C++ Parser interface that is independent of query engine –Existing parsers coupled to query engine (Xalan, Pathan, LibXPath, Sablotron) –Facilitates efficient development and testing Extensibility –Allow for user transformations of parse tree –Allow for XPath grammar changes Error handling –Show useful error message –Parse tree should be destroyed automatically if parse error occurs

XPath Processor 4 Processor Overview Generates independent parse tree –Parse tree is a structure of in-memory C++ objects –Small footprint due to compact parse tree representation Built-in transformations –Predicate transformation needed to facilitate data flow in query engines User implemented callback interface –Completely separate from query execution –Generates execution tree from parse tree User derives from parser class and provides implementation Implementation is a simple 1-to-1 transformation XPATH Expression Parse Tree Transformed Parse Tree Execution Tree Transformer Generator (Callbacks) Parser (Productions)

XPath Processor 5 Parse Tree Node Hierarchy Parse Node Step Node Axis Type Node Name Test Node Function Node Function Arg Node Filter Node Negative Node Predicate Node Unary Predicate Node Binary Predicate Node Set Operator Node Number Operator Node Literal Node

XPath Processor 6 Running Example XPath syntax –AxisName::NodeTest[predicate] –/child::company/descendant-or-self::employee[position() = 1] Abbreviated notation: /company//employee[1] Boston JohnDoe JaneDoe XML Document example

XPath Processor 7 Productions to Parse Tree /child::company/descendant-or-self::employee[position() = 1] Expr LocPath Step Nodetest Axis Pred LocPath FunctionLiteral 1 Binary Predicate Equals Function Position Step company Step employee Nodetest Axis Productions:Parse Tree:

XPath Processor 8 Abbreviated Notation Abbreviated expression –/company//employee[1] Normalized expression –/child::company/descendant-or-self::employee[position() = 1] Literal 1 Step company Step employee Binary Predicate Equals Function Position Parse Tree: Normalized Parse Tree:

XPath Processor 9 Transformed Parse Tree Data flow query engines require data to flow from the step node up through its predicate node which filters the data –Predicate nodes must be placed above their corresponding step node When could this be done? –While parsing Too complicated because productions expect certain inputs –While generating execution tree Would make user interface too complex –In post-processing of parse tree Simple recursive transformation

XPath Processor 10 Transformed Parse Tree /child::company/descendant-or-self::employee[position() = 1] Step company Step employee Literal 1 Binary Predicate Equals Function Position Literal 1 Binary Predicate Equals Function Position Parse Tree: Transformed Parse Tree:

XPath Processor 11 User Implementation of Callbacks Interface defines a callback for each node type –Callbacks supply parse tree parameters Value – axis, nodetest, literal, etc Role – relationship to parent –User implements callbacks to generate execution tree An in-order traversal of the tree is made and appropriate callbacks are called

XPath Processor 12 Callbacks /child::company/descendant-or-self::employee[position() = 1] Step company Step employee Literal 1 Binary Predicate equals Function position Start Predicate (equals, root) Start Step (employee, context) Start Step (company, context) End Step Start Function (position, operand) End Function Start Literal (1, operand) End Literal End Predicate Parse Tree:Corresponding Callbacks Invoked:

XPath Processor 13 Execution Tree Generation User derives from parser class and provides implementation of the callback interfaces –Implementation specific to execution tree stored in derived class Stack required to maintain context in execution tree –Each Start callback creates a node, attaches it to its parent (top of stack) and pushes it onto the stack –Each End callback pops a node off the stack Implemented parser interface for VAMANA query engine –1-to-1 mapping makes execution tree generation simple

XPath Processor 14 Execution Tree Generation /child::company/descendant-or-self::employee[position() = 1] Start Predicate (equals, root) Start Step (employee, context) Start Step (company, context) End Step Start Function (position, operand) End Function Start Literal (1, operand) End Literal End Predicate Predicate (equals, root) Step (employee, context) Step (company, context) Stack: Mass Node company Mass Node employee V Literal 1 V Function position V Binary Predicate equals Start Predicate (equals, root) Start Step (employee, context) Start Step (company, context) End Step Start Function (position, operand) End Function Start Literal (1, operand) End Literal End Predicate Function (position, expr)Literal (1, expr) Callbacks: Execution Tree:

XPath Processor 15 Evaluation Numerous XPATH expressions were tested including all of the examples in W3C’s XPath specifications Each tree was printed, enabling visual evaluation (example to follow) Error messages helpful in locating parse error –Example (using \ instead of /) child::company\descendant-or-self::employee[position() =1] –Output child::company\descendant-or-self::employee[position() =1] ^ Parse Error!

XPath Processor 16 Printed Trees /child::company/descendant-or-self::employee[position() = 1] |child | |company | |CONTEXT| /~ |descendant-or-self| |employee | | ROOT | | | |position | | |FUNCTION| | |OPERAND| | /~ \_ | = | |BIPRED| | PRED | \_ | 1 | |LITERAL | |OPERAND| |position | |FUNCTION| |OPERAND | /~ | = | |BIPRED| | ROOT | | |\_ | | | 1 | | | |LITERAL | | | |OPERAND| | | | | | child | | |company | | |CONTEXT| | /~ \_ |descendant-or-self| | employee | | CONTEXT | |position | |VFUNCTION| | OPERAND | /~ | = | |VBIPRED | | ROOT | | |\_ | | | 1 | | | |VLITERAL | | | |OPERAND| | | | | | child | | |company | | |CONTEXT| | /~ \_ |descendant-or-self| | employee | | CONTEXT | Parse Tree:Transformed Parse Tree:Execution Tree:

XPath Processor 17 Conclusion Successful implementation XPath Processor completely independent of query engine Successful integration with VAMANA and MASS Successful MQP overall

XPath Processor 18 Thanks I would like to thank Elke Rundensteiner, Kurt Deschler and Venkatesh Raghavan. This XPATH Processor was a contribution to both the MASS and VAMANA projects and is the result of a collaborated effort.

XPath Processor 19 References 1.Tim Bray, Jean Paoli, C. M. Sperberg-Mcqueen and Eve Maler. Extensible Markup Language (XML), Version 1.0, Second Edition, W3C Recommendation, October 6, Jim Clark and Steve DeRose. XML Path Language (XPATH), Version 1.0, W3C Recommendation, November 16, Don Chamberlin, Peter Fankhauser, Massimo Marchiori and Jonathan Robie. XML Query Requirements, W3C Working Draft, February 15, Kurt W. Deschler and Elke Rundensteiner. MASS: A Multi-Axis Storage Structure for Large XML Documents, 2002, Technical Report in progress. 5.Venkatesh Raghavan. VAMANA – Efficient Xpath Query Engine Exploiting the MASS Index, October 23, 2002, Master’s Thesis Proposal.

Questions?