Abstract
Tree patterns represent important fragments of XPath. In this paper, we show that some classes \({\mathcal{C}}\) of tree patterns exhibit such a property that, given a finite number of compatible tree patterns \({P_1, \ldots, P_n\in \mathcal{C}}\), there exists another pattern P such that P 1, . . . , P n are all contained in P, and for any tree pattern \({Q\in \mathcal{C}}\), P 1, . . . , P n are all contained in Q if and only if P is contained in Q. We experimentally demonstrate that the pattern P is usually much smaller than P 1, . . . , P n combined together. Using the existence of P above, we show that testing whether a tree pattern, P, is contained in another, \({Q\in \mathcal{C}}\), under an acyclic schema graph G, can be reduced to testing whether P G , a transformed version of P, is contained in Q without any schema graph, provided that the distinguished node of P is not labeled *. We then show that, under G, the maximal contained rewriting (MCR) of a tree pattern Q using a view V can be found by finding the MCR of Q using V G without G, when there are no *-nodes on the distinguished path of V and no *-nodes in Q.
Similar content being viewed by others
References
Amer-Yahia, S., Cho, S., Lakshmanan, L.V.S., Srivastava, D.: Minimization of tree pattern queries. In: SIGMOD, pp. 497–508 (2001)
Amer-Yahia S., Cho S., Lakshmanan L.V.S., Srivastava D.: Tree pattern query minimization. VLDB J. 11(4), 315–331 (2002)
Benedikt M., Fan W., Kuper G.: Structural properties of XPath fragments. Theor. Comput. Sci. 336(1), 3–31 (2005)
Lakshmanan, L.V., Ramesh, G., Hui (Wendy) Wang, Z.J.Z.: On testing satisfiabilty of tree patterns. In: VLDB, pp. 120–131 (2004)
Lakshmanan, L.V.S., Wang, H., Zhao, Z.J.: Answering tree pattern queries using views. In: VLDB, pp. 571–582 (2006)
Miklau G., Suciu D.: Containment and equivalence for a fragment of XPath. J. ACM 51(1), 2–45 (2004)
Neven F., Schwentick T.: On the complexity of XPath containment in the presence of disjunction, DTDs, and variables. Logic. Methods Comput. Sci. 2(3), 1–30 (2006)
Ramanan, P.: Efficient algorithms for minimizing tree pattern queries. In: SIGMOD Conference, pp. 299–309 (2002)
Schwentick T.: XPath query containment. SIGMOD Record. 33(1), 101–109 (2004)
Tang J., Fu A.W.: Query rewriting using views for XPath queries, framework and methodoloies. Inf. Syst. 35, 315–334 (2010)
ten Cate, B., Lutz, C.: The complexity of query containment in expressive fragments of XPath 2.0. J. ACM 56(6) (2009)
Wang, J., Li, J., Yu, J.X.: Answering tree pattern queries using views: a revisit. In: EDBT, pp. 153–164 (2011)
Wang J., Yu J.X., Liu C.: Independence of containing patterns property and its application in tree pattern query rewriting using views. World Wide Web J. 12(1), 87–105 (2009)
Wood, P.T.: Minimising simple XPath expressions. In: WebDB, pp. 13–18 (2001)
Wood, P.T.: Containment for XPath fragments under DTD constraints. In: ICDT, pp. 300–314 (2003)
Xu, W., Özsoyoglu, Z.M.: Rewriting XPath queries using materialized views. In: VLDB, pp. 121–132 (2005)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Wang, J., Yu, J.X., Pang, C. et al. Least common container of tree pattern queries and its applications. Acta Informatica 49, 173–202 (2012). https://doi.org/10.1007/s00236-012-0155-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00236-012-0155-1