XML subtree queries: specification and composition

  • Authors:
  • Michael Benedikt;Irini Fundulaki

  • Affiliations:
  • Bell Labs, Lucent Technologies;Bell Labs, Lucent Technologies

  • Venue:
  • DBPL'05 Proceedings of the 10th international conference on Database Programming Languages
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

A frequent task encountered in XML processing is to filter an input document to produce a subdocument; that is, a document whose root-to-leaf paths are root-to-leaf paths of the original document and which inherits the tree structure of the original document. These are what we mean by subtree queries, and while they are similar to XPath filters, they cannot be naturally specified either in XPath or in XQuery. Special-purpose subtree query languages provide a natural idiom for specifying this class of queries, but both composition and evaluation are problematic. In this paper we show that for natural fragments of XPath, the resulting subtree query languages are closed under composition. This closure property allows a sequence of subtree queries to be rewritten as a single subtree query, which can then be evaluated either by a subtree-query specific evaluator or via translation to XQuery. We provide a set of composition algorithms for each common XPath fragment and discuss their complexity.