ABSTRACT
XPath is a simple language for navigating an XML document and selecting a set of element nodes. XPath expressions are used to query XML data, describe key constraints, express transformations, and reference elements in remote documents. This paper studies the containment and equivalence problems for a fragment of the XPath query language, with applications in all these contexts.In particular, we study a class of XPath queries that contain branching, label wildcards and can express descendant relationships between nodes. Prior work has shown that languages which combine any two of these three features have efficient containment algorithms. However, we show that for the combination of features, containment is coNP-complete. We provide a sound and complete EXPTIME algorithm for containment, and study parameterized PTIME special cases. While we identify two parameterized classes of queries for which containment can be decided efficiently, we also show that even with some bounded parameters, containment is coNP-complete. In response to these negative results, we describe a sound algorithm which is efficient for all queries, but may return false negatives in some cases.
- S. Amer-Yahia, S. Cho, L. V. S. Lakshmanan, and D. Srivastava. Minimization of tree pattern queries. SIGMOD, 2001.]] Google ScholarDigital Library
- P. Buneman, S. Davidson, W. Fan, C. Hara, and W. Tan. Reasoning about keys for xml, 2000.]]Google Scholar
- D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. View-based query answering and query containment over semistructured data. Submitted for publication, 2001.]]Google Scholar
- D. Chamberlin, J. Clark, D. Florescu, J. Robie, J. Simeon, and M. Stefanascu. XQuery 1.0: An XML query language. http://www.w3.org/TR/xquery/, 07 June 2001. W3C working draft.]]Google Scholar
- A. Chandra, D. Kozen, and L. Stockmeyer. Alternation. In Journal of the ACM, pages 115-133, January 1981.]] Google ScholarDigital Library
- A. Chandra and P. Merlin. Optimal implementation of conjunctive queries in relational data bases. In Proceedings of 9th ACM Symposium on Theory of Computing, pages 77-90, May 1977.]] Google ScholarDigital Library
- R. Cole, R. Harihan, and P. Indyk. Tree pattern matching and subset matching in deterministic o(nlog3n) time. Proc. 10th ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 245-254, 1999.]] Google ScholarDigital Library
- S. DeRose, R. D. Jr., and E. Maler. XML pointer language (XPointer) working draft. http://www.w3.org/TR/1999/WD-xptr-19991206, December 1999.]]Google Scholar
- S. DeRose, E. Maler, and D. Orchard. Xml linking language (Xlink). http://www.w3.org/TR/2000/REC-xlink-20010627, June 2001.]]Google Scholar
- A. Deutsch and V. Tannen. Containment and Integrity Constraints for XPath Fragments. In KRDB 2001, 2001.]]Google Scholar
- D. Florescu, A. Levy, and D. Suciu. Query containment for conjunctive queries with regular expressions. In Principles of Database Systems (PODS), pages 139-148, 1998.]] Google ScholarDigital Library
- M. Garey and D. Johnson. Computers and Intractability: A Guide to the Theory of NP-completeness. W. H. Freeman, San Francisco, 1979.]] Google ScholarDigital Library
- C. Hoffmann and M. O'Donnell. Pattern matching in trees. Journal of the Association for Computing Machinery, 29(1):68-95, 1982.]] Google ScholarDigital Library
- P. Kilpelainen and H. Mannila. Ordered and unordered tree inclusion. SIAM Journal on Computing, pages 340-356, 1995.]] Google ScholarDigital Library
- Kosaraju. Efficient tree pattern matching. In FOCS: IEEE Symposium on Foundations of Computer Science (FOCS), 1989.]]Google Scholar
- G. Miklau and D. Suciu. Containment and equivalence of tree patterns. University of Washington Technical Report (TR 02-02-03), February 2002. http://www.cs.washington.edu/homes/gerome.]]Google Scholar
- T. Milo and D. Suciu. Index structures for path expressions. In ICDT, pages 277-295, 1999.]] Google ScholarDigital Library
- H. Seidl. Personal communication, August 2001.]]Google Scholar
- O. Shmueli. Equivalence of datalog queries is undecidable. The Journal of Logic Programming, 15(3):231-242, February 1993.]] Google ScholarDigital Library
- A. Snoeren, K. Conley, and D. Gifford. Mesh-based content routing using XML. In Proceedings of the 18th Symposium on Operating Systems Principles, 2001.]] Google ScholarDigital Library
- L. J. Stockmeyer and A. Meyer. Word problems requiring exponential time. In 5th STOC, pages 1-9. ACM, 1973.]] Google ScholarDigital Library
- M. Vardi. Why is modal logic so robustly decidable, 1997.]]Google ScholarCross Ref
- P. Wadler. A formal semantics of patterns in xslt. Markup Technologies, pages 183-202, 1999.]] Google ScholarDigital Library
- P. T. Wood. On the equivalence of xml patterns. International Conference on Deductive and Object-Oriented Databases (DOOD), pages 1152-1166, 2000.]] Google ScholarDigital Library
- P. T. Wood. Minimizing simple xpath expressions. Fourth International Workshop on the Web and Databases (WebDB'2001), 2001.]]Google Scholar
- XML Schema part 1: Structures. http://www.w3.org/TR/1999/WD-xmlschema-1-19991217/, 17 December 1999. W3C Working Draft.]]Google Scholar
- M. Yannakakis. Algorithms for acyclic database schemes. In Proceedings of the 7th Conference on Very Large Databases, Morgan Kaufman pubs. (Los Altos CA), Zaniolo and Detobel(eds), 1981.]]Google Scholar
Index Terms
- Containment and equivalence for an XPath fragment
Recommendations
Containment and equivalence for a fragment of XPath
XPath is a language for navigating an XML document and selecting a set of element nodes. XPath expressions are used to query XML data, describe key constraints, express transformations, and reference elements in remote documents. This article studies ...
HCH for checking containment of XPath fragment
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 ...
Containment for XPath Fragments under DTD Constraints
ICDT '03: Proceedings of the 9th International Conference on Database TheoryThe containment and equivalence problems for various fragments of XPath have been studied by a number of authors. For some fragments, deciding containment (and even minimisation) has been shown to be in PTIME, while for minor extensions containment has ...
Comments