Encyclopedia of Database Systems

2018 Edition
| Editors: Ling Liu, M. Tamer Özsu

XML Tree Pattern, XML Twig Query

  • Laks V. S. Lakshmanan
Reference work entry
DOI: https://doi.org/10.1007/978-1-4614-8265-9_797

Synonyms

TP; TPQ; Tree pattern queries; Twigs

Definition

A tree pattern query (also known as twig query) is a pair Q = (T, F), where T is node-labeled and edge-labeled tree with a distinguished node x ∈ T and F is a boolean combination of constraints on nodes. Node labels are variables such as $x, $y. Edge labels are one of “pc,” “ad,” indicating parent–child or ancestor–descendant. Node constraints are of the form $x.tag = TagName or $x.data relOp val, where $x.data denotes the data content of node $x, and relOp is one of =, <, >, ≤, , .

Informally, a tree pattern query specifies a pattern tree, with a set of constraints. Some of the constraints specify what the node labels (tags) should be. Some of them specify how pairs of nodes are related to one another – as a parent–child or as an ancestor–descendant. Finally, constraints on the data content of nodes enforce what data values are expected to be present at the nodes. Taken together, a tree pattern is similar in concept to a...

This is a preview of subscription content, log in to check access.

Recommended Reading

  1. 1.
    Al-Khalifa S, Jagadish HV, Koudas N, Patel JM, Srivastava D, Wu Y. Structural joins: a primitive for efficient XML query pattern matching. In: Proceedings of the 18th International Conference on Data Engineering; 2002. p. 141–52.Google Scholar
  2. 2.
    Amer-Yahia S, Cho SR, Lakshmanan LVS, Srivastava D. Minimization of tree pattern queries. In: Proceedings of the ACM SIGMOD International Conference on Management of Data; 2001. p. 497–508.Google Scholar
  3. 3.
    Amer-Yahia S, Cho SR, Srivastava D. Tree pattern relaxation. In: Advances in Database Technology, Proceedings of the 8th International Conference on Extending Database Technology; 2002. p. 496–513.CrossRefGoogle Scholar
  4. 4.
    Amer-Yahia S, Lakshmanan LVS, Pandit S. FleXPath: flexible structure and full-text querying for XML. In: Proceedings of the ACM SIGMOD International Conference on Management of Data; 2004. p. 83–94.Google Scholar
  5. 5.
    Benedikt M, Fan W, Geerts F. XPath satisfiability in the presence of DTDs. In: Proceedings of the 24th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 2005. p. 25–36.Google Scholar
  6. 6.
    Benedikt M, Fan W, Kuper GM. Structural properties of XPath fragments. In: Proceedings of the 9th International Conference on Database Theory; 2003. p. 79–95.Google Scholar
  7. 7.
    Bruno N, Koudas N, Srivastava D. Holistic twig joins: optimal XML pattern matching. In: Proceedings of the ACM SIGMOD International Conference on Management of Data; 2002. p. 310–21.Google Scholar
  8. 8.
    Chen Z, Jagadish HV, Korn F, Koudas N, Muthukrishnan S, Ng R, Srivastava D. Counting twig matches in a tree. In: Proceedings of the 17th International Conference on Data Engineering; 2001. p. 595–604.Google Scholar
  9. 9.
    Chien SY, Vagena Z, Zhang D, Tsotras VJ, Zaniolo C. Efficient structural joins on indexed XML documents. In: Proceedings of the 28th International Conference on Very Large Data Bases; 2002. p. 263–74.CrossRefGoogle Scholar
  10. 10.
    Deutsch A, Tannen V. Reformulation of XML queries and constraints. In: Proceedings of the 9th International Conference on Database Theory; 2003.p. 225–41.Google Scholar
  11. 11.
    Flesca S, Furfaro F, Masciari E. On the minimization of Xpath queries. In: Proceedings of the 29th International Conference on Very Large Data Bases; 2003. p. 153–64.CrossRefGoogle Scholar
  12. 12.
    Freire J, Haritsa J, Ramanath M, Roy P, Simeon J. StatiX: making XML count. In: Proceedings of the ACM SIGMOD International Conference on Management of Data; 2002. p. 181–91.Google Scholar
  13. 13.
    Gokhale C, Gupta N, Kumar P, Lakshmanan LVS, Ng R, Prakash BA. Complex group-by queries for XML. In: Proceedings of the 23rd International Conference on Data Engineering; 2007. p. 646–55.Google Scholar
  14. 14.
    Hidders J. Satisfiability of XPath expressions. In: Proceedings of the 9th International Workshop on Database Programming Languages; 2003. p. 21–36.CrossRefGoogle Scholar
  15. 15.
    Jagadish HV, Lakshmanan LVS, Srivastava D, Thompson K. TAX: a tree algebra for XML. In: Proceedings of the 8th International Workshop on Database Programming Languages; 2001. p. 149–69.CrossRefGoogle Scholar
  16. 16.
    Jagadish HV, Al-Khalifa S, Chapman A, Lakshmanan LVS, Nierman A, Paparizos S, Patel JM, Srivastava D, Wiwatwattana N, Wu Y, Yu C. TIMBER: a native XML database. VLDB J. 2002;11(4):274–91.zbMATHCrossRefGoogle Scholar
  17. 17.
    Jiang H, Lu H, Wang W, Ooi BC. XR-tree: indexing XML data for efficient structural joins. In: Proceedings of the 19th International Conference on Data Engineering; 2003. p. 253–63.Google Scholar
  18. 18.
    Lakshmanan LVS, Ramesh G, Wang H, (Jessica) Zhao Z. On testing satisfiability of tree pattern queries. In: Proceedings of the 30th International Conference on Very Large Data Bases; 2004.p. 120–31.Google Scholar
  19. 19.
    Lakshmanan LVS, Wang H, (Jessica) Zhao Z. Answering tree pattern queries using views. In: Proceedings of the 32nd International Conference on Very Large Data Bases; 2006. p. 571–82.Google Scholar
  20. 20.
    Miklau G, Suciu D. Containment and equivalence for a fragment of XPath. In: Proceedings of the 21st ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 2002. p. 65–76.Google Scholar
  21. 21.
    Paparizos S, Al-Khalifa S, Jagadish HV, Lakshmanan LVS, Nierman A, Srivastava D, Wu Y. Grouping in XML. In: Advances in Database Technology, Proceedings of the 8th International Conference on Extending Database Technology; 2002. p. 128–47.zbMATHGoogle Scholar
  22. 22.
    Polyzotis N, Garofalakis M. XSketch synopses for XML data graphs. ACM Trans Database Syst. 2006;31(3):1014–63.CrossRefGoogle Scholar
  23. 23.
    Polyzotis N, Garofalakis M, Ioannidis Y. Selectivity estimation for XML twigs. In: Proceedings of the 20th International Conference on Data Engineering; 2004. p. 264–75.Google Scholar
  24. 24.
    Wiwatwattana N, Jagadish HV, Lakshmanan LVS, Srivastava D. X3: a cube operator for XML OLAP. In: Proceedings of the 23rd International Conference on Data Engineering; 2007. p. 916–25.Google Scholar
  25. 25.
    XML Path Language (XPath) Version 1.0. http://www.w3.org/TR/xpath
  26. 26.
    Xu W, Meral Özsoyoglu Z. Rewriting XPath queries using materialized views. In: Proceedings of the 31st International Conference on Very Large Data Bases; 2005. p. 121–32.Google Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.University of British ColumbiaVancouverCanada

Section editors and affiliations

  • Sihem Amer-Yahia
    • 1
  1. 1.Laboratoire d'Informatique de GrenobleCNRS and LIGGrenobleFrance