Containment and equivalence for a fragment of XPath

被引:177
作者
Miklau, G [1 ]
Suciu, D [1 ]
机构
[1] Univ Washington, Seattle, WA 98195 USA
关键词
algorithms; languages; theory; tree pattern matching; XPath expressions; query containment; query equivalence;
D O I
10.1145/962446.962448
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
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 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 that 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 algorithm for containment that runs in exponential time, and study parameterized PTIME special cases. While we identify one parameterized class of queries for which containment can be decided efficiently, we also show that even with some bounded parameters, containment remains coNP-complete. In response to these negative results, we describe a sound algorithm that is efficient for all queries, but may return false negatives in some cases.
引用
收藏
页码:2 / 45
页数:44
相关论文
共 28 条
  • [1] AMERYAHIA S, 2001, P ACM SIGMOD
  • [2] [Anonymous], 1979, Computers and Intractablity: A Guide to the Theoryof NP-Completeness
  • [3] BUNEMAN P, 2001, P 10 INT WORLD WID W, P201
  • [4] MORE EFFICIENT BOTTOM-UP MULTIPATTERN MATCHING IN TREES
    CAI, J
    PAIGE, R
    TARJAN, R
    [J]. THEORETICAL COMPUTER SCIENCE, 1992, 106 (01) : 21 - 60
  • [5] Calvanese D, 2002, LECT NOTES COMPUT SC, V2397, P40
  • [6] CHAMBERLIN D, 2001, XQUERY 1 0 XML QUERY
  • [7] Chandra Ashok K., 1977, STOC'77: Proceedings of the ninth annual ACM symposium on Theory of computing, P77, DOI DOI 10.1145/800105.803397
  • [8] Cole R, 1999, PROCEEDINGS OF THE TENTH ANNUAL ACM-SIAM SYMPOSIUM ON DISCRETE ALGORITHMS, P245
  • [9] DEROSE S, 2001, XML LINKING LANGUAGE
  • [10] DEROSE S, 1999, XML POINTER LANGUAGE