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

Querying inconsistent ontological knowledge bases is a critical challenge in data management. Several inconsistency-tolerant query answering semantics have been proposed, typically relying on the notion of "repairs"—maximally consistent subsets of an erroneous database. While subset-maximality is common, cardinality-maximality (considering only the largest consistent subsets) offers a more intuitive approach when errors are assumed to be sparse. This paper provides a comprehensive complexity analysis of Boolean conjunctive query answering across a wide range of Datalog+/- languages under three cardinality-based repair semantics: $\le$-AR, $\le$-IAR, and $\le$-ICR. We demonstrate that while cardinality-based repairs often introduce a "counting" overhead in simpler languages, this cost is frequently absorbed by the inherent complexity of more expressive Datalog+/- fragments.

Introduction

In Ontology-Based Data Access (OBDA), the data (ABox) often conflicts with the logical constraints defined in the ontology (TBox). To derive meaningful information from such inconsistent systems, researchers employ Inconsistency-Tolerant Semantics. The standard paradigm involves "repairs," which are subsets of the database consistent with the ontology.

Traditionally, repairs are defined by subset-maximality. However, this can result in numerous small repairs that may not accurately reflect the intended state of the data. This work focuses on cardinality-maximal repairs (or $\le$-repairs), which prioritize the largest possible consistent subsets. The central goal is to map the computational landscape of this stricter definition across the Datalog+/- family of languages.

Methodology and Semantics

The study evaluates three primary inconsistency-tolerant semantics:

  1. $\le$-AR (ABox Repair): A query answer is valid if it is entailed by every maximum-sized repair.
  2. $\le$-IAR (Intersection of Repairs): A query answer is valid if it is entailed by the intersection of all maximum-sized repairs.
  3. $\le$-ICR (Intersection of Closed Repairs): A query answer is valid if it is entailed by the intersection of the logical closures of all maximum-sized repairs.

The complexity is analyzed across various Datalog+/- fragments, including Linear (L), Guarded (G), Sticky (S), and Weakly Guarded (WG) rules. Analysis covers data complexity (where the ontology and query are fixed), combined complexity (where all inputs grow), and intermediate measures ($fp$-combined and $ba$-combined).

Complexity Analysis: Key Insights

The theoretical analysis reveals several critical patterns in the computational cost of cardinality-based repairs:

The Cost of Counting

Identifying a cardinality-maximal repair requires determining the size of the largest consistent subset. This "counting" step typically necessitates a binary search using an NP oracle, pushing the data complexity for many languages into the $\Theta^P_2$ class (polynomial time with logarithmic calls to an NP oracle).

The Masking Effect

For highly expressive languages that are already EXP-complete or 2EXP-complete, the additional computational effort to find the maximum cardinality does not increase the overall complexity class. The inherent difficulty of reasoning in these languages "masks" the overhead of repair identification.

ICR as a "Free" Upgrade

A significant practical finding is that for cardinality-maximal repairs, the ICR semantics—which is more informative than IAR—generally shares the same complexity bounds as IAR. This suggests that in systems implementing cardinality repairs, there is no computational penalty for choosing the more powerful ICR semantics.

Complexity results for cardinality-based IAR semantics.
Complexity results for cardinality-based ICR semantics, highlighting the similarity to IAR.

Key Results

The research provides a definitive lookup table for the complexity of these semantics. Key findings include:

  • Data Complexity: For most Datalog+/- languages, query answering under $\le$-AR, $\le$-IAR, and $\le$-ICR is $\Theta^P_2$-complete.
  • Combined Complexity: Bounds range from PSPACE for linear/acyclic rules to 2EXP-complete for guarded and weakly guarded rules.
  • Comparison: While cardinality-based repairs are generally harder than subset-based ones for "easy" languages (e.g., those in P or NP), they are complexity-neutral for "hard" languages.

Conclusion and Future Work

This work establishes the theoretical foundations for cardinality-based inconsistency-tolerant query answering. Future research directions include extending the analysis to non-Boolean queries, identifying "islands of tractability" for efficient implementation, and investigating non-uniform complexity within specific ontology classes.

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