We study the data complexity of consistent query answering (CQA) on databases that may violate the primary key constraints. A repair is a maximal subset of the database satisfying the primary key constraints. For a Boolean query q, the problem CERTAINTY(q) takes a database as input, and asks whether or not each repair satisfies q. The computational complexity of CERTAINTY(q) has been established whenever q is a self-join-free Boolean conjunctive query, or a (not necessarily self-join-free) Boolean path query. In this paper, we take one more step towards a general classification for all Boolean conjunctive queries by considering the class of rooted tree queries. In particular, we show that for every rooted tree query q, CERTAINTY(q) is in FO, NL-hard $\cap$ LFP, or coNP-complete, and it is decidable (in polynomial time), given q, which of the three cases applies. We also extend our classification to larger classes of queries with simple primary keys. Our classification criteria rely on query homomorphisms and our polynomial-time fixpoint algorithm is based on a novel use of context-free grammar (CFG).
翻译:我们研究了可能违反主键约束的数据库上一致性答案查询(CQA)的数据复杂度。修复是指满足主键约束的数据库的最大子集。对于布尔查询q,问题CERTAINTY(q)以数据库为输入,询问每个修复是否满足q。当q为无自连接布尔合取查询或(不一定无自连接的)布尔路径查询时,CERTAINTY(q)的计算复杂度已被确定。在本文中,我们通过考虑根树查询类,向所有布尔合取查询的通用分类迈进一步。具体而言,我们证明:对于每个根树查询q,CERTAINTY(q)属于FO、NL-hard ∩ LFP或coNP-complete类,并且给定q,可在多项式时间内判定这三种情况中哪一种适用。我们还将分类扩展到具有简单主键的更大查询类。我们的分类标准依赖于查询同态,而多项式时间不动点算法则基于对上下文无关文法(CFG)的创新性应用。