Interpreting Tree-to-Tree Queries

  • Michael Benedikt
  • Christoph Koch
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4052)


We establish correspondences between top-down tree building query languages and predicate logics. We consider the expressive power of the query language XQ, a clean core of the practitioner’s language XQuery. We show that all queries in XQ with only atomic equality are equivalent to “first-order interpretations”, an analog to first-order logic (FO) in the setting of transformations of tree-structured data. When XQ is considered with deep equality, we find that queries can be translated into FO with counting (FO(Cnt)). We establish partial converses to this, characterizing the subset of the FO resp. FO(Cnt) interpretations that correspond to XQ. Finally, we study the expressive power of fragments of XQ and obtain partial characterizations in terms of existential FO and a fragment of FO that is two-variable if the tree node labeling alphabet is assumed fixed.


Data Tree Node Equality Atomic Formula Relational Query XPath Query 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ebbinghaus, H.-D., Flum, J.: Finite Model Theory, 2nd edn. Springer, Heidelberg (1999)MATHGoogle Scholar
  2. 2.
    Etessami, K., Vardi, M., Wilke, T.: First Order Logic with Two Variables and Unary Temporal Logic. Information and Computation 179 (2002)Google Scholar
  3. 3.
    Gottlob, G., Koch, C., Pichler, R.: Efficient Algorithms for Processing XPath Queries. ACM Transactions on Database Systems 30(2), 444–491 (2005)CrossRefMathSciNetGoogle Scholar
  4. 4.
    Immerman, N.: “Descriptive Complexity”. Springer, Heidelberg (1999)Google Scholar
  5. 5.
    Koch, C.: On the Complexity of Non-recursive XQuery and Functional Languages on Complex Values. In: Proc. PODS (2005)Google Scholar
  6. 6.
    Koch, C.: On the Role of Composition in XQuery. In: Proc. WebDB (2005)Google Scholar
  7. 7.
    Marx, M.: XPath with Conditional Axis Relations. In: Proc. EDBT (2004)Google Scholar
  8. 8.
    Marx, M.: First order paths in ordered trees. In: Proc. of the 10th International Conference on Database Theory (ICDT) (2005)Google Scholar
  9. 9.
    Paredaens, J., Van Gucht, D.: Possibilities and Limitations of Using Flat Operators in Nested Algebra Expressions. In: Proc. PODS, pp. 29–38 (1988)Google Scholar
  10. 10.
    Schweikardt, N.: Arithmetic, First-Order Logic, and Counting Quantifiers. ACM Transactions on Computational Logic 6(3), 634–671 (2005)CrossRefMathSciNetGoogle Scholar
  11. 11.
    World Wide Web Consortium. “XQuery 1.0 and XPath 2.0 Formal Semantics”. W3C Working Draft (Aug.16th 2002), 2002

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Michael Benedikt
    • 1
  • Christoph Koch
    • 2
  1. 1.Bell Laboratories 
  2. 2.Saarland University 

Personalised recommendations