Creative Commons Attribution 4.0 International license
Query containment is a fundamental database problem which has been extensively studied for conjunctive queries (CQs). The most famous result is arguably the Homomorphism Theorem: a CQ q₁ is contained in a CQ q₂ iff there is a homomorphism from q₂ to q₁. However, when extending conjunctive queries with safe base negation (CQ^¬), this test becomes incomplete, hence, requiring significantly more expensive procedures due to its inherently harder complexity (Π₂^P-hard).
In this paper, we define and study the classes CQ^{1¬}_{HT} and CQ^{¬}_{HT}: the classes of conjunctive queries extended with one or several safe negated atoms that satisfy the Homomorphism Theorem, and hence, whose containment check is in NP. To characterise them, we define what we call the dependency-version of a query, which is a dependency that, intuitively, models the databases in which the query is false. It turns out that, when the query q contains one (several) negated atom(s), the query satisfies the Homomorphism Theorem iff its tgd(ded)-version is uniformly one-bounded. We also show that CQ^¬_{HT} membership is EXPTIME-hard, but its complexity reduces to Π₂^P in the CQ^{1¬}_{HT} case, and to NP when bounding the number of positive atoms that can unify with the negated one.
@InProceedings{oriol:LIPIcs.ICDT.2026.23,
author = {Oriol, Xavier},
title = {{Conjunctive Query Containment with Safe Negation and TGD One-Boundedness}},
booktitle = {29th International Conference on Database Theory (ICDT 2026)},
pages = {23:1--23:20},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-413-0},
ISSN = {1868-8969},
year = {2026},
volume = {365},
editor = {ten Cate, Balder and Funk, Maurice},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICDT.2026.23},
URN = {urn:nbn:de:0030-drops-256373},
doi = {10.4230/LIPIcs.ICDT.2026.23},
annote = {Keywords: conjunctive queries, query containment, safe negation, tgd, one-boundedness}
}