Query Containment for Highly Expressive Datalog Fragments

The containment problem of Datalog queries is well known to be undecidable. There are, however, several Datalog frag-ments for which containment is known to be decidable, most notably monadic Datalog and several "regular" query lan-guages on graphs. Monadically Defined Queries (MQs) have been introduced recently as a joint generalization of these query languages. In this paper, we study a wide range of Datalog frag-ments with decidable query containment and determine ex-act complexity results for this problem. We generalize MQs to (Frontier-)Guarded Queries (GQs), and show that the con-tainment problem is 3ExpTime-complete in either case, even if we allow arbitrary Datalog in the sub-query. If we focus on graph query languages, i.e., fragments of linear Datalog, then this complexity is reduced to 2ExpSpace. We also con-sider nested queries, which gain further expressivity by us-ing predicates that are defined by inner queries. We show that nesting leads to an exponentially increasing hierarchy for the complexity of query containment, both in the linear and in the general case. Our results settle open problems for (nested) MQs, and they paint a comprehensive picture of the state of the art in Datalog query containment.

[1]  Balder ten Cate,et al.  Guarded Negation , 2011, Advances in Modal Logic.

[2]  Diego Calvanese,et al.  Reasoning on regular path queries , 2003, SGMD.

[3]  Jean-François Baget,et al.  On rules with existential variables: Walking the decidability line , 2011, Artif. Intell..

[4]  Michael Benedikt,et al.  Monadic Datalog Containment , 2012, ICALP.

[5]  Andrea Calì,et al.  Taming the Infinite Chase: Query Answering under Expressive Relational Constraints , 2008, Description Logics.

[6]  Alin Deutsch,et al.  Optimization Properties for Classes of Conjunctive Regular Path Queries , 2001, DBPL.

[7]  Diego Calvanese,et al.  Decidable containment of recursive queries , 2003, Theor. Comput. Sci..

[8]  Sebastian Rudolph,et al.  Flag & check: data access with monadically defined queries , 2013, PODS '13.

[9]  Serge Abiteboul,et al.  Regular path queries with constraints , 1997, PODS '97.

[10]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[11]  Surajit Chaudhuri,et al.  On the complexity of equivalence between recursive and nonrecursive Datalog programs , 1994, PODS '94.

[12]  Haim Gaifman,et al.  Decidable optimization problems for database logic programs , 1988, STOC '88.

[13]  Thomas Schwentick,et al.  Optimizing Conjunctive Queries over Trees Using Schema Information , 2008, MFCS.

[14]  Walter J. Savitch,et al.  Relationships Between Nondeterministic and Deterministic Tape Complexities , 1970, J. Comput. Syst. Sci..

[15]  Balder ten Cate,et al.  Queries with Guarded Negation , 2012, Proc. VLDB Endow..

[16]  Bruno Courcelle,et al.  Recursive Queries and Context-free Graph Grammars , 1991, Theor. Comput. Sci..

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

[18]  Surajit Chaudhuri,et al.  On the equivalence of recursive and nonrecursive datalog programs , 1992, J. Comput. Syst. Sci..

[19]  Oded Shmueli,et al.  Decidability and expressiveness aspects of logic queries , 1987, XP7.52 Workshop on Database Theory.