Semantic acyclicity on graph databases

It is known that unions of acyclic conjunctive queries (CQs) can be evaluated in linear time, as opposed to arbitrary CQs, for which the evaluation problem is NP-complete. It follows from techniques in the area of constraint-satisfaction problems that "semantically acyclic" unions of CQs -- i.e., unions of CQs that are equivalent to a union of acyclic ones -- can be evaluated in polynomial time, though testing membership in the class of semantically acyclic CQs is NP-complete. We study here the fundamental notion of semantic acyclicity in the context of graph databases and unions of conjunctive regular path queries with inverse (UC2RPQs). It is known that unions of acyclic C2RPQs can be evaluated efficiently, but it is by no means obvious whether the same holds for the class of UC2RPQs that are semantically acyclic. We prove that checking whether a UC2RPQ is semantically acyclic is decidable in 2EXPSPACE, and that it is EXPSPACE-hard even in the absence of inverses. Furthermore, we show that evaluation of semantically acyclic UC2RPQs is fixed-parameter tractable. In addition, our tools yield a strong theory of approximations for UC2RPQs when no equivalent acyclic UC2RPQ exists.

[1]  Jan Van den Bussche,et al.  Relative expressive power of navigational querying on graphs , 2011, ICDT '11.

[2]  Dan Suciu,et al.  Query containment for conjunctive queries with regular expressions , 1998, PODS.

[3]  Ronald Fagin,et al.  Degrees of acyclicity for hypergraphs and relational database schemes , 1983, JACM.

[4]  Mihalis Yannakakis,et al.  On the Complexity of Database Queries , 1999, J. Comput. Syst. Sci..

[5]  Mihalis Yannakakis,et al.  On the complexity of database queries (extended abstract) , 1997, PODS.

[6]  Christos H. Papadimitriou,et al.  The Complexity of Facets Resolved , 1988, J. Comput. Syst. Sci..

[7]  Mihalis Yannakakis,et al.  The complexity of facets (and some facets of complexity) , 1982, STOC '82.

[8]  Georg Gottlob,et al.  Hypertree decompositions and tractable queries , 1998, J. Comput. Syst. Sci..

[9]  Alberto O. Mendelzon,et al.  A graphical query language supporting recursion , 1987, SIGMOD '87.

[10]  Claudio Gutierrez,et al.  Survey of graph database models , 2008, CSUR.

[11]  Jianzhong Li,et al.  Adding regular expressions to graph reachability and pattern queries , 2011, ICDE 2011.

[12]  Moshe Y. Vardi A Note on the Reduction of Two-Way Automata to One-Way Automata , 1989, Inf. Process. Lett..

[13]  Phokion G. Kolaitis,et al.  On the expressive power of datalog: tools and a case study , 1990, J. Comput. Syst. Sci..

[14]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 1997, Theor. Comput. Sci..

[15]  Dan Suciu,et al.  Data on the Web: From Relations to Semistructured Data and XML , 1999 .

[16]  Yde Venema,et al.  Dynamic Logic by David Harel, Dexter Kozen and Jerzy Tiuryn. The MIT Press, Cambridge, Massachusetts. Hardback: ISBN 0–262–08289–6, $50, xv + 459 pages , 2002, Theory and Practice of Logic Programming.

[17]  Jerzy Tiuryn,et al.  Dynamic logic , 2001, SIGA.

[18]  Phokion G. Kolaitis,et al.  Constraint Satisfaction, Bounded Treewidth, and Finite-Variable Logics , 2002, CP.

[19]  Diego Calvanese,et al.  Containment of Conjunctive Regular Path Queries with Inverse , 2000, KR.

[20]  Phokion G. Kolaitis,et al.  A Logical Approach to Constraint Satisfaction , 2008, Complexity of Constraints.

[21]  Phokion G. Kolaitis,et al.  Conjunctive-Query Containment and Constraint Satisfaction , 2000, J. Comput. Syst. Sci..

[22]  Jaroslav Nesetril,et al.  Graphs and homomorphisms , 2004, Oxford lecture series in mathematics and its applications.

[23]  Alberto O. Mendelzon,et al.  GraphLog: a visual formalism for real life recursion , 1990, PODS '90.

[24]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[25]  Georg Gottlob,et al.  The complexity of acyclic conjunctive queries , 1998, Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280).

[26]  Francesco Scarcello,et al.  Structural tractability of enumerating CSP solutions , 2010, Constraints.

[27]  Martin Grohe The Structure of Tractable Constraint Satisfaction Problems , 2006, MFCS.

[28]  Jorge Pérez,et al.  Relative Expressiveness of Nested Regular Expressions , 2012, AMW.

[29]  M. W. Shields An Introduction to Automata Theory , 1988 .

[30]  Sergio Greco,et al.  Querying Graph Databases , 2000, EDBT.

[31]  Peter T. Wood,et al.  Query languages for graph databases , 2012, SGMD.

[32]  Moshe Y. Vardi The complexity of relational query languages (Extended Abstract) , 1982, STOC '82.

[33]  Mihalis Yannakakis,et al.  Algorithms for Acyclic Database Schemes , 1981, VLDB.

[34]  Jianzhong Li,et al.  Graph pattern matching , 2010, Proc. VLDB Endow..

[35]  Anthony Widjaja Lin,et al.  Expressive Languages for Path Queries over Graph-Structured Data , 2012, TODS.

[36]  Hubie Chen,et al.  Beyond Hypertree Width: Decomposition Methods Without Decompositions , 2005, CP.

[37]  Jörg Flum,et al.  Query evaluation via tree-decompositions , 2001, JACM.

[38]  Richard J. Lipton,et al.  Alternating Pushdown and Stack Automata , 1984, SIAM J. Comput..

[39]  Pablo Barceló,et al.  Efficient approximations of conjunctive queries , 2012, PODS '12.

[40]  李幼升,et al.  Ph , 1989 .

[41]  Diego Calvanese,et al.  Rewriting of regular expressions and regular path queries , 1999, PODS '99.

[42]  Wim Martens,et al.  Querying graph databases with XPath , 2013, ICDT '13.

[43]  Nicolás Marín,et al.  Review of Data on the Web: from relational to semistructured data and XML by Serge Abiteboul, Peter Buneman, and Dan Suciu. Morgan Kaufmann 1999. , 2003, SGMD.

[44]  Diego Calvanese,et al.  View-Based Query Answering and Query Containment over Semistructured Data , 2001, DBPL.

[45]  Tomás Feder,et al.  The Computational Structure of Monotone Monadic SNP and Constraint Satisfaction: A Study through Datalog and Group Theory , 1999, SIAM J. Comput..

[46]  Robert E. Tarjan,et al.  Simple Linear-Time Algorithms to Test Chordality of Graphs, Test Acyclicity of Hypergraphs, and Selectively Reduce Acyclic Hypergraphs , 1984, SIAM J. Comput..

[47]  Dániel Marx,et al.  Enumerating Homomorphisms , 2009, STACS.

[48]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[49]  Mihalis Yannakakis,et al.  Equivalences Among Relational Expressions with the Union and Difference Operators , 1980, J. ACM.