Abstract
XPath is ubiquitous in XML applications for navigating XML trees and selecting a set of element nodes. In XPath query processing, one of the most important issues is how to efficiently check containment relationship between two XPath expressions. To get out of the intricacy and complexity caused by numerous XPath features, we investigate this issue on a frequently used fragment of XPath expressions that consists of node tests, the child axis (/), the descendant axis (//), branches ([]) and label wildcards (*). Prior work has shown that homomorphism technology can be used for containment checking. However, homomorphism is the sufficient but not necessary condition for containment. For special classes of this fragment, the homomorphism algorithm returns false negatives. To address this problem, this paper proposes two containment techniques, conditioned homomorphism and hidden conditioned homomorphism, and then presents sound algorithms for checking containment. Experimental results confirm the practicability and efficiency of the proposed algorithms.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
James Clark, Steve DeRose. XML path language (XPath), version 1.0. W3C Recommendation, http://www.w3.org/TR/xpath.
Scott Boag, Don Chamberlin et al. XQuery 1.0: An XML query language. W3C Candidate Recommendation. http://www.w3.org/TR/xquery.
Steven DeRose, Eve Maler et al. XML linking language (XLink), version 1.0. W3C Recommendation, http://www.w3.org/TR/xlink.
Steven DeRose, Ron Daniel Jr. et al. XML pointer language (XPointer). W3C Working draft, http://www. w3.org/TR/xptr.
James Clark. XSL transformations (XSLT), version 1.0. W3C Recommendation, http://www.w3.org/TR/xslt.
Gerome Miklau, Dan Suciu. Containment and equivalence for a fragment of XPath. Journal of the ACM, 2004, 51(1): 2–45.
Thomas Schwentick. XPath query containment. ACM SIGMOD Record, 2004, 33(1): 101–109.
Ashok K Chandra, Philip M Merlin. Optimal implementation of conjunctive queries in relational data bases. In Proc. the 9th ACM Symposium on Theory of Computing, Boulder, Colorado, USA, May 4–4, 1977, pp.77–90.
Peter Buneman, Susan Davidson et al. Reasoning about keys for XML. In Proc.the 8th Int. Workshop on Database Programming Languages (DBPL), Kinloch Rannoch, Scotland, Sept. 1–3, 1999, pp.133–148.
Tova Milo, Dan Suciu T. Index structures for path expressions. In Proc. the 7th Int. Conference on Database Theory (ICDT), Jerusalem, Israel, Jan. 10–12, 1999, pp.277–295.
Peter T Wood. Minimizing simple xpath expressions. In Proc. the 4th Int. Workshop on the Web and Databases (WebDB), Santa Barbara, California, USA, May 24–25, 2001, pp.13–18.
Sihem Amer-Yahia, SungRan Cho et al. Minimization of tree pattern queries. In Proc. the ACM SIGMOD Conf. Management of Data, Santa Barbara, California, USA, May 21–24, 2001, pp.497–508.
Oded Shmueli. Equivalence of datalog queries is undecidable. The Journal of Logic Programming, 1993, 15(3): 231–242.
Peter T Wood. On the equivalence of XML patterns. In Proc. the First Int. Conference on Computational Logic (CL), London, UK, July 24–28, 2000, pp.1152–1166.
Frank Neven, Thomas Schwentick. XPath containment in the presence of disjunction, DTDs, and variables. In Proc. the 9th Int. Conf. Database Theory (ICDT), Siena, Italy, Jan. 8–10, 2003, pp.315–329.
Daniela Florescu, Alon Levy et al. Query containment for conjunctive queries with regular expressions. In Proc. the 17th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS), Seattle, Washington, USA, June 1–3, 1998, pp.139–148.
Diego Calvanese, Giuseppe De Giacomo et al. View-based query answering and query containment over semistructured data. In Proc. the 8th Int. Workshop on Database Programming Languages (DBPL), Frascati, Italy, Sept. 8–10, 2001, pp.40–61.
Sihem Amer-Yahia, SungRan Cho et al. Tree pattern query minimization. The VLDB Journal, 2002, 11(4): 315–331.
Frank Neven. Automata theory for XML researchers. ACM SIGMOD Record, 2002, 31(3): 39–46.
Peter T Wood. Containment for XPath fragments under DTD constraints. In Proc. the 9th Int. Conference on Database Theory (ICDT), Siena, Italy, Jan. 8–10, 2003, pp.300–314.
Author information
Authors and Affiliations
Corresponding author
Additional information
This work is in part supported by the National Natural Science Foundation of China under Grant No. 60573094, the National Grand Fundamental Research 973 Program of China under Grant No. 2006CB303103, the National High Technology Development 863 Program of China under Grant No. 2006AA01A101, and Tsinghua Basic Research Foundation under Grant No. JCqn2005022.
Electronic supplementary material
Rights and permissions
About this article
Cite this article
Feng, JH., Liao, YG. & Zhang, Y. HCH for Checking Containment of XPath Fragment. J Comput Sci Technol 22, 736–748 (2007). https://doi.org/10.1007/s11390-007-9080-0
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11390-007-9080-0