Skip to main content

XML Tree Pattern, XML Twig Query

  • Reference work entry
  • First Online:
  • 16 Accesses

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 via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   4,499.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD   6,499.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Recommended Reading

  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. 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. 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.

    Chapter  Google Scholar 

  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. 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. 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. 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. 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. 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.

    Chapter  Google Scholar 

  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. 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.

    Chapter  Google Scholar 

  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. 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. Hidders J. Satisfiability of XPath expressions. In: Proceedings of the 9th International Workshop on Database Programming Languages; 2003. p. 21–36.

    Chapter  Google Scholar 

  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.

    Chapter  Google Scholar 

  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.

    Article  MATH  Google Scholar 

  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. 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. 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. 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. 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.

    MATH  Google Scholar 

  22. Polyzotis N, Garofalakis M. XSketch synopses for XML data graphs. ACM Trans Database Syst. 2006;31(3):1014–63.

    Article  Google Scholar 

  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. 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. XML Path Language (XPath) Version 1.0. http://www.w3.org/TR/xpath

  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 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Laks V. S. Lakshmanan .

Editor information

Editors and Affiliations

Section Editor information

Rights and permissions

Reprints and permissions

Copyright information

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

About this entry

Check for updates. Verify currency and authenticity via CrossMark

Cite this entry

Lakshmanan, L.V.S. (2018). XML Tree Pattern, XML Twig Query. In: Liu, L., Özsu, M.T. (eds) Encyclopedia of Database Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-8265-9_797

Download citation

Publish with us

Policies and ethics