skip to main content
10.1145/543613.543623acmconferencesArticle/Chapter ViewAbstractPublication PagespodsConference Proceedingsconference-collections
Article

Containment and equivalence for an XPath fragment

Published:03 June 2002Publication History

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.

References

  1. S. Amer-Yahia, S. Cho, L. V. S. Lakshmanan, and D. Srivastava. Minimization of tree pattern queries. SIGMOD, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P. Buneman, S. Davidson, W. Fan, C. Hara, and W. Tan. Reasoning about keys for xml, 2000.]]Google ScholarGoogle Scholar
  3. 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 ScholarGoogle Scholar
  4. 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 ScholarGoogle Scholar
  5. A. Chandra, D. Kozen, and L. Stockmeyer. Alternation. In Journal of the ACM, pages 115-133, January 1981.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle Scholar
  9. S. DeRose, E. Maler, and D. Orchard. Xml linking language (Xlink). http://www.w3.org/TR/2000/REC-xlink-20010627, June 2001.]]Google ScholarGoogle Scholar
  10. A. Deutsch and V. Tannen. Containment and Integrity Constraints for XPath Fragments. In KRDB 2001, 2001.]]Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Garey and D. Johnson. Computers and Intractability: A Guide to the Theory of NP-completeness. W. H. Freeman, San Francisco, 1979.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Hoffmann and M. O'Donnell. Pattern matching in trees. Journal of the Association for Computing Machinery, 29(1):68-95, 1982.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Kilpelainen and H. Mannila. Ordered and unordered tree inclusion. SIAM Journal on Computing, pages 340-356, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Kosaraju. Efficient tree pattern matching. In FOCS: IEEE Symposium on Foundations of Computer Science (FOCS), 1989.]]Google ScholarGoogle Scholar
  16. 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 ScholarGoogle Scholar
  17. T. Milo and D. Suciu. Index structures for path expressions. In ICDT, pages 277-295, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. H. Seidl. Personal communication, August 2001.]]Google ScholarGoogle Scholar
  19. O. Shmueli. Equivalence of datalog queries is undecidable. The Journal of Logic Programming, 15(3):231-242, February 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. L. J. Stockmeyer and A. Meyer. Word problems requiring exponential time. In 5th STOC, pages 1-9. ACM, 1973.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Vardi. Why is modal logic so robustly decidable, 1997.]]Google ScholarGoogle ScholarCross RefCross Ref
  23. P. Wadler. A formal semantics of patterns in xslt. Markup Technologies, pages 183-202, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. T. Wood. On the equivalence of xml patterns. International Conference on Deductive and Object-Oriented Databases (DOOD), pages 1152-1166, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. T. Wood. Minimizing simple xpath expressions. Fourth International Workshop on the Web and Databases (WebDB'2001), 2001.]]Google ScholarGoogle Scholar
  26. XML Schema part 1: Structures. http://www.w3.org/TR/1999/WD-xmlschema-1-19991217/, 17 December 1999. W3C Working Draft.]]Google ScholarGoogle Scholar
  27. 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 ScholarGoogle Scholar

Index Terms

  1. Containment and equivalence for an XPath fragment

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          PODS '02: Proceedings of the twenty-first ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems
          June 2002
          311 pages
          ISBN:1581135076
          DOI:10.1145/543613

          Copyright © 2002 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 3 June 2002

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          PODS '02 Paper Acceptance Rate24of109submissions,22%Overall Acceptance Rate642of2,707submissions,24%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader