NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Complexity of Inconsistency-Tolerant Query Answering in Datalog+/- under Cardinality-Based Repairs

Thomas Lukasiewicz, Enrico Malizia, Andrius Vaicenavicius

Abstract

This paper investigates the computational complexity of query answering over inconsistent databases using cardinality-based repairs within the Datalog+/- framework. By analyzing various language fragments and repair semantics—including ABox Repair (AR), Intersection of Repairs (IAR), and Intersection of Closed Repairs (ICR)—the study establishes a comprehensive complexity landscape. The findings reveal that cardinality-maximal repairs often incur a significant "counting penalty" in simpler languages, while the added cost is masked in more expressive fragments.

1. Introduction

In data integration and web extraction, combining logical rules (ontologies) with large datasets frequently leads to inconsistencies. To maintain query reliability, researchers utilize "inconsistency-tolerant semantics" based on database repairs. While subset-maximal repairs (maximal consistent subsets under set inclusion) are well-studied, this paper focuses on cardinality-maximal repairs, which prioritize subsets containing the maximum number of facts. This approach is particularly relevant when errors are assumed to be rare, making larger consistent subsets more likely to be accurate.

2. Theoretical Framework

The study evaluates several dimensions of the problem:

  • Datalog+/- Fragments: A range of languages from "Linear" (L) to "Guarded" (G) and "Weakly Sticky" (WS).
  • Repair Semantics:
    • AR (ABox Repair): Answers must hold in every cardinality-maximal repair.
  • IAR (Intersection of Repairs): Answers must hold in the intersection of all cardinality-maximal repairs.
  • ICR (Intersection of Closed Repairs): Answers must hold in the intersection of the logical closures of all cardinality-maximal repairs.
  • Complexity Measures: Both data complexity (scaling with facts) and combined complexity (scaling with facts and rules) are analyzed.

3. Complexity Analysis

The researchers performed a rigorous analysis by reducing known hard problems, such as Quantified Boolean Formula (QBF) validity, to query answering under the specified semantics. To understand the impact of cardinality-based repairs, it is essential to compare them against the baseline complexity of standard Boolean Conjunctive Query (BCQ) answering in these languages.

Baseline complexity for standard BCQ answering across Datalog+/- fragments.

As shown in the baseline table, simpler languages like Linear (L) or Sticky (S) exhibit highly efficient data complexity ($\leq AC^0$). However, the introduction of cardinality constraints significantly alters this landscape.

4. Key Results and Discussion

The primary contribution of this work is the definitive complexity map for cardinality-based repairs.

Complexity results for BCQ answering under cardinality-based repair semantics (AR, IAR, ICR).

The "Counting" Penalty

The transition to cardinality-maximal repairs introduces a "counting penalty." For simpler languages, data complexity jumps from $AC^0$ to $\Theta^p_2$-complete. This increase stems from the need to determine the size of the largest repair, a task that requires multiple calls to an NP oracle.

ICR as a "Free" Upgrade

A notable finding is that the complexity of the more precise ICR semantics is often identical to that of the simpler IAR semantics. This suggests that in practical implementations of cardinality-based systems, there is no computational disadvantage to employing the more rigorous ICR approach.

Complexity Masking

For highly expressive languages like Guarded (G) or Weakly Sticky (WS), the inherent difficulty of the language itself (e.g., P or EXP data complexity) is high enough that the additional overhead of finding cardinality-maximal repairs does not change the overall complexity class. In these cases, the repair cost is "masked" by the reasoning cost.

5. Conclusion and Future Work

This research provides a complete theoretical foundation for cardinality-based repairs in Datalog+/-. Future directions include extending this model to weighted repairs, where facts from different sources have varying trust levels, and incorporating user preferences. Additionally, developing systems that provide "explanations" for query results—detailing why specific facts were included or excluded—remains a critical area for practical deployment.

Summary updated

BibTeX
@inproceedings{lukasiewicz2022complexity,
  author = {Thomas Lukasiewicz and Enrico Malizia and Andrius Vaicenavicius},
  title = {{Complexity of Inconsistency-Tolerant Query Answering in Datalog+/- under Cardinality-Based Repairs}},
  booktitle = {SEBD},
  year = {2022},
  url = {https://openreview.net/forum?id=KsxOBidtPL},
}
Figure