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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsRecommended Reading
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.
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.
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.
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.
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.
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.
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.
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.
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.
Deutsch A, Tannen V. Reformulation of XML queries and constraints. In: Proceedings of the 9th International Conference on Database Theory; 2003.p. 225–41.
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.
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.
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.
Hidders J. Satisfiability of XPath expressions. In: Proceedings of the 9th International Workshop on Database Programming Languages; 2003. p. 21–36.
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.
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.
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.
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.
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.
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.
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.
Polyzotis N, Garofalakis M. XSketch synopses for XML data graphs. ACM Trans Database Syst. 2006;31(3):1014–63.
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.
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.
XML Path Language (XPath) Version 1.0. http://www.w3.org/TR/xpath
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.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Section Editor information
Rights and permissions
Copyright information
© 2018 Springer Science+Business Media, LLC, part of Springer Nature
About this entry
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
DOI: https://doi.org/10.1007/978-1-4614-8265-9_797
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4614-8266-6
Online ISBN: 978-1-4614-8265-9
eBook Packages: Computer ScienceReference Module Computer Science and Engineering