Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sept. 27, 2002 ISDB’02 Transforming XPath Queries for Bottom-Up Query Processing Yoshiharu Ishikawa Takaaki Nagai Hiroyuki Kitagawa University of Tsukuba.

Similar presentations


Presentation on theme: "Sept. 27, 2002 ISDB’02 Transforming XPath Queries for Bottom-Up Query Processing Yoshiharu Ishikawa Takaaki Nagai Hiroyuki Kitagawa University of Tsukuba."— Presentation transcript:

1 Sept. 27, 2002 ISDB’02 Transforming XPath Queries for Bottom-Up Query Processing Yoshiharu Ishikawa Takaaki Nagai Hiroyuki Kitagawa University of Tsukuba {ishikawa,kitagawa}@is.tsukuba.ac.jp

2 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

3 Sept. 27, 2002ISDB'02Background XML : content-description language on the Web XML : content-description language on the Web XPath XPath pattern-based query language for XML pattern-based query language for XML extracts XML nodes based on the specified pattern extracts XML nodes based on the specified pattern has navigational semantics has navigational semantics XSLT uses XPath for the node specification XSLT uses XPath for the node specification XQuery also uses XPath XQuery also uses XPath

4 Sept. 27, 2002ISDB'02 XML Example <itemlist> CD player CD player Star Electronics Star Electronics CDP-R55N CDP-R55N 2001 2001 125.00 125.00......</itemlist>

5 Sept. 27, 2002ISDB'02 XPath Query Sample query Q: retrieve prices of CD players Sample query Q: retrieve prices of CD players XPath sentence XPath sentence contains location steps separated by "/" contains location steps separated by "/" a location step has the format axis::node_test[predicate]...[predicate] a location step has the format axis::node_test[predicate]...[predicate] location steps can be abbreviated location steps can be abbreviated e.g., /descendant::foo → //foo, /attribute::bar → @bar e.g., /descendant::foo → //foo, /attribute::bar → @bar /itemlist/item[@category = "audio equipment"] [catalog-info/type = "CD player"]/sales-info/price [catalog-info/type = "CD player"]/sales-info/price

6 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

7 Sept. 27, 2002ISDB'02 article authors author "Smith""White" "Chen" author "Miller" XPath Semantics XPath assumes top-down query processing XPath assumes top-down query processing Not efficient for large XML databases Not efficient for large XML databases Bottom-up processing is better in some cases Bottom-up processing is better in some cases query: /article/authors[author = "Miller"] article authors author "Smith""White" "Chen" article authors author "Miller" author articleauthors "Miller" author top-downbottom-up

8 Sept. 27, 2002ISDB'02 Bottom-Up Query Processing We can process the example query when We can process the example query when we can determine the specified leaf elements (i.e., "Miller") with the help of an index, and we can determine the specified leaf elements (i.e., "Miller") with the help of an index, and we can select the parent for a specific author node. we can select the parent for a specific author node. We do not need to access all the authors/author elements We do not need to access all the authors/author elements article authors author "Smith""White" "Chen" author "Miller" articleauthors "Miller" author

9 Sept. 27, 2002ISDB'02 Our Objective and Approach Our Objective Our Objective Efficient bottom-up processing of XPath queries with the help of index structures Efficient bottom-up processing of XPath queries with the help of index structures Our Approach Our Approach Use of the proximal nodes model as the underlying retrieval model Use of the proximal nodes model as the underlying retrieval model The model enables bottom-up query evaluation The model enables bottom-up query evaluation Development of transformation rules from XPath queries to proximal nodes expressions Development of transformation rules from XPath queries to proximal nodes expressions

10 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

11 Sept. 27, 2002ISDB'02 The Proximal Nodes Model (1) Proposed by Navarro and Baeza-Yates [7] as a structured document retrieval model Proposed by Navarro and Baeza-Yates [7] as a structured document retrieval model Uses bottom-up query processing approach Uses bottom-up query processing approach XML data can be treated as nested nodes: XML data can be treated as nested nodes: a node corresponds to an element or attribute in XML a node corresponds to an element or attribute in XML each node has an associated text region (called the segment): segments can take nested structure each node has an associated text region (called the segment): segments can take nested structure Expressive power and efficiency are well-balanced Expressive power and efficiency are well-balanced evaluation cost is almost O(n): n is the no. of nodes evaluation cost is almost O(n): n is the no. of nodes

12 Sept. 27, 2002ISDB'02 The Proximal Nodes Model (2) The model consists of three components The model consists of three components Text pattern matching language Text pattern matching language specifies pattern matching conditions specifies pattern matching conditions implementation dependent implementation dependent returns a set of the matched nodes returns a set of the matched nodes example: "ABC Corporation" example: "ABC Corporation" Retrieval operators based on document structures Retrieval operators based on document structures returns a set of nodes for a given element or attribute name returns a set of nodes for a given element or attribute name example: chapter, price example: chapter, price Operators to integrate partial retrieval results Operators to integrate partial retrieval results calculates the result node set from the given node sets calculates the result node set from the given node sets efficient computation based on segment relationships efficient computation based on segment relationships

13 Sept. 27, 2002ISDB'02 Proximal Nodes Operators P in Q a set of P nodes contained in one or more Q nodes P with Q a set of P nodes that contains one or more Q nodes P child Q a set of P nodes each of which is a child of a Q node P parent Q a set of P nodes each of which is a parent of a Q node P + Q the union of P and Q P - Q the difference of P and Q P is Q the intersection of P and Q P same Q a set of P nodes each of which is equal to a Q node P and Q are nodes with associated segments

14 Sept. 27, 2002ISDB'02 Example of Proximal Nodes Expression Example expression of proximal nodes model Example expression of proximal nodes model Query processing steps Query processing steps 1. determine the node sets that corresponds to the elements "item" and "type" using indexes 1. determine the node sets that corresponds to the elements "item" and "type" using indexes 2. determine the node set that corresponds to the pattern "CD player" using an index 2. determine the node set that corresponds to the pattern "CD player" using an index 3. compute the result of "same" operator 3. compute the result of "same" operator 4. compute the result of "with" operator 4. compute the result of "with" operator item with (type same "CD player")

15 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

16 Sept. 27, 2002ISDB'02 Translation Rules (1) Supports major XPath patterns Supports major XPath patterns Based on the XPath semantic description by Wadler [10] Based on the XPath semantic description by Wadler [10] Use of denotational semantics Use of denotational semantics

17 Sept. 27, 2002ISDB'02 Translation Rules (2)

18 Sept. 27, 2002ISDB'02 Translation Rules (3)

19 Sept. 27, 2002ISDB'02 Auxiliary Functions

20 Sept. 27, 2002ISDB'02 Simplification Using the Knowledge of Document Structure If we know the DTD of the target XML, we can derive more simplified translation results If we know the DTD of the target XML, we can derive more simplified translation results

21 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

22 Sept. 27, 2002ISDB'02 Translation Example Original query Q Original query Q Translation result: Translation result: t 1 = item with (item with (category same "audio equipment")) t 1 = item with (item with (category same "audio equipment")) t 2 = catalog-info child t 1 t 2 = catalog-info child t 1 t 3 = t 1 with (t 1 with (((type child t 2 ) child t 2 ) same "CD player")) t 3 = t 1 with (t 1 with (((type child t 2 ) child t 2 ) same "CD player")) t 4 = sales-info child t 3 t 4 = sales-info child t 3 ans = (((price child t 4 ) child t 4 ) child t 3 ) child itemlist ans = (((price child t 4 ) child t 4 ) child t 3 ) child itemlist /itemlist/item[@category = "audio equipment"] [catalog-info/type = "CD player"]/sales-info/price [catalog-info/type = "CD player"]/sales-info/price

23 Sept. 27, 2002ISDB'02 Simplification of Query Plan (1) The translated result contains multiple application of an operator The translated result contains multiple application of an operator We can delete redundant operators considering the operator semantics We can delete redundant operators considering the operator semantics Example: Example: t 1 = item with (item with (category same "audio equipment")) → item with (category same "audio equipment") t 1 = item with (item with (category same "audio equipment")) → item with (category same "audio equipment")

24 Sept. 27, 2002ISDB'02 Simplification of Query Plan (2) If we can use the DTD information, we can further simplify the expressions If we can use the DTD information, we can further simplify the expressions Example: Example: t 3 = t 1 with ((type child (catalog-info child t 1 )) same "CD player") → t 1 with ((type in t 1 ) same "CD player") t 3 = t 1 with ((type child (catalog-info child t 1 )) same "CD player") → t 1 with ((type in t 1 ) same "CD player") Simplified query plan for query Q Simplified query plan for query Q t 1 = item with (category name "audio equipment") t 1 = item with (category name "audio equipment") ans = price in (t 1 with ((type in t 1 ) same "CD player")) ans = price in (t 1 with ((type in t 1 ) same "CD player"))

25 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

26 Sept. 27, 2002ISDB'02 Related Work Translation of XQL queries into proximal nodes expressions (Baeza-Yates&Navarro [2]) Translation of XQL queries into proximal nodes expressions (Baeza-Yates&Navarro [2]) Rewriting techniques for XQL queries (Wood [13]) Rewriting techniques for XQL queries (Wood [13]) Use of document structure for the query optimization [3,11,12,13] Use of document structure for the query optimization [3,11,12,13] Optimization of regular path expressions in the context of semistructured DBs [4,8] Optimization of regular path expressions in the context of semistructured DBs [4,8]

27 Sept. 27, 2002ISDB'02 Presentation Overview Background Background Motivation and Our Approach Motivation and Our Approach The Proximal Nodes Model The Proximal Nodes Model Query Translation Query Translation Translation Example Translation Example Related Work Related Work Conclusions and Future Work Conclusions and Future Work

28 Sept. 27, 2002ISDB'02 Conclusions and Future Work Conclusions Conclusions Bottom-up processing approach for XPath queries Bottom-up processing approach for XPath queries Support of major XPath query patterns Support of major XPath query patterns Translation to proximal nodes expressions Translation to proximal nodes expressions Simplification and optimization techniques Simplification and optimization techniques Future work Future work Support of more complete XPath semantics Support of more complete XPath semantics Application of hybrid approach (top-down and bottom-up) Application of hybrid approach (top-down and bottom-up)


Download ppt "Sept. 27, 2002 ISDB’02 Transforming XPath Queries for Bottom-Up Query Processing Yoshiharu Ishikawa Takaaki Nagai Hiroyuki Kitagawa University of Tsukuba."

Similar presentations


Ads by Google