Query Answer Explanations under Existential Rules

Ismail Ilkan Ceylan, Thomas Lukasiewicz, Enrico Malizia, Andrius VaicenaviciusSEBD 2022

Abstract

In modern AI, Ontology-Mediated Query Answering (OMQA) uses logical rules to derive hidden insights from databases. However, the complexity of these rules often obscures the reasoning behind specific query results. This paper provides the first comprehensive complexity roadmap for explaining query answers under "existential rules" (Datalog±). By formalizing "minimal explanations" (MinEx)—the smallest data subsets required to trigger a result—the authors map the computational difficulty of verifying, finding, and reasoning about these justifications across diverse rule-based frameworks.

Introduction: The Need for Transparency in OMQA

Modern database systems increasingly rely on ontologies—sets of logical rules—to enhance search capabilities. For instance, a rule might specify that if a protein belongs to a complex and that complex is "covered," then the protein itself is considered "covered." While this makes queries more powerful, it introduces a transparency gap. When a system concludes that "Protein X is covered," researchers need to understand the underlying evidence: which specific database facts triggered this conclusion?

In logic, these justifications are known as minimal explanations (MinEx). A MinEx is the smallest possible set of database facts that, when combined with the ontology rules, entails the query answer. While well-studied for simpler logics, this paper addresses the more expressive and computationally demanding domain of existential rules.

Problem Definition and Methodology

The authors define several distinct decision problems to categorize the difficulty of working with explanations:

  • Is-MinEX: Verifying if a specific set of facts constitutes a minimal explanation.
  • All-MinEX: Determining if all possible minimal explanations have been identified.
  • MinEX-Rel/Irrel: Identifying if a specific fact is "relevant" (part of at least one explanation) or "irrelevant."
  • Small/Large-MinEX: Checking for the existence of an explanation within specific size bounds.
Conceptual illustration of minimal explanations (MinEx) using a protein-complex containment example.

The study employs a rigorous theoretical complexity analysis, evaluating these problems across various "flavors" of existential rules—including Linear, Guarded, Sticky, and Acyclic rules—under both data complexity and combined complexity measures.

Key Insights: The Complexity Jump

A central finding of the research is the "Complexity Jump": explaining an answer is almost invariably harder than finding the answer itself. For many rule sets where query answering resides in NP, verifying a minimal explanation (Is-MinEX) escalates to $D^P$ (a complexity class requiring both an NP and a co-NP check).

Furthermore, determining fact relevance (MinEX-Rel) proves particularly challenging, often reaching $\Sigma^P_2$ or ExpTime. This implies that even with a candidate explanation in hand, proving that a specific fact is essential to some explanation is computationally expensive.

Complexity Roadmap and Results

The paper establishes a definitive complexity landscape for these tasks. A major highlight is the role of FO-rewritability. For simpler rule languages (like the DL-Lite family or Linear rules), queries can be rewritten into standard SQL. In these instances, the authors prove that computing all minimal explanations is feasible in polynomial time relative to the database size.

Complexity results for Is-MinEX and All-MinEX across various rule languages.

Key results from the analysis include:

  • Data Complexity: For tractable rule sets, verifying an explanation is efficient (typically $AC^0$ or P-complete).
  • Combined Complexity: As rule sets grow more expressive, problems quickly become PSPACE-complete or 2-ExpTime-complete.
  • Polynomial Feasibility: Theorem 7 demonstrates that for FO-rewritable languages, all minimal explanations can be computed in polynomial time regarding data size.

Conclusion and Future Directions

This work provides a foundational framework for understanding the costs of transparency in rule-based AI. While the current study focuses on positive answers, the authors identify several critical areas for future research:

  • Negative Explanations: Reasoning about why a query failed to return a result (abductive reasoning).
  • Inconsistency Management: Providing explanations when the database and rules are in conflict.
  • Preferred Explanations: Ranking justifications to present the most useful or relevant ones to users first.
  • Probabilistic Contexts: Extending these proofs to databases containing uncertain or probabilistic facts.

Summary updated

BibTeX
@inproceedings{ceylan2022query,
  author = {Ismail Ilkan Ceylan and Thomas Lukasiewicz and Enrico Malizia and Andrius Vaicenavicius},
  title = {{Query Answer Explanations under Existential Rules}},
  booktitle = {SEBD},
  year = {2022},
  url = {https://openreview.net/forum?id=stON_kjSWfD},
}
Figure