High-Level Why-Not Explanations using Ontologies

Balder ten Cate, Cristina Civili, Evgeny Sherkhonov, Wang-Chiew Tan

Abstract

This research introduces a foundational framework for addressing the "why-not" problem in database systems—explaining why a specific expected result is missing from a query. By leveraging ontologies, the proposed approach moves beyond simple data or query modifications to provide high-level, human-readable explanations. We define a formal framework based on S-ontologies, explore methods for utilizing both external and schema-derived knowledge, and provide a rigorous analysis of the algorithmic complexity involved in generating "most-general" explanations.

What Problem Does This Paper Address?

In complex database environments, users frequently encounter situations where an expected tuple does not appear in a query result. Traditional "why-not" explanations typically focus on two areas:

  1. Data-centric: Identifying missing records that, if added, would produce the result.
  2. Query-centric: Identifying constraints in the query that, if relaxed, would include the result.

However, these methods often lack semantic depth. For instance, if a user asks why there is no train connection between Amsterdam and New York, a data-centric tool might suggest adding a row to a "Connections" table. While technically correct, it fails to explain the underlying logic: that Amsterdam and New York are on different continents and no trans-Atlantic train infrastructure exists.

A sample relational table of train connections used to illustrate why-not queries.

This paper proposes using ontologies to bridge this gap, providing explanations like: "Amsterdam is a European city, New York is a US city, and there are no trans-Atlantic train connections."

Methods

The core of the framework is the S-ontology, which structures domain knowledge into concepts, subsumption relationships, and extensions (the set of database tuples belonging to a concept).

S-Ontology Sources

The authors explore two primary ways to obtain these ontologies:

  • External Ontologies: Utilizing existing domain knowledge through the Ontology-Based Data Access (OBDA) framework, specifically employing the DL-Lite$_R$ description logic for its computational efficiency.
  • Derived Ontologies: In the absence of external knowledge, the authors describe a method to generate "virtual" ontologies directly from the database schema and instance. This uses a custom concept language ($L_S$) that incorporates relational operations such as projection, selection, and intersection to define hierarchies.
A table representing a subset of cities, illustrating how concepts are mapped to data extensions.

Algorithmic Approaches

Two main strategies are developed for finding explanations:

  1. Exhaustive Search: Used primarily with external ontologies, this algorithm identifies all concepts containing the missing tuple, filters out those that overlap with actual query results, and prunes the remainder to find the "most-general" explanations.
  2. Incremental Search: Designed for derived ontologies, this uses a "least upper bound" (LUB) approach. It begins with the specific missing tuple and incrementally generalizes the concept until it can no longer be expanded without including existing query results.

Key Insights and Ideas

  • The "Most-General" Principle: The authors argue that the most useful explanations are those that are as general as possible. An explanation like "Amsterdam is a city" is often more valuable than one specifying its exact population, provided the population is irrelevant to the missing result.
  • Ontology as a Vocabulary: Ontologies provide the abstraction layer necessary to translate low-level database misses into high-level conceptual gaps.
  • Schema-Derived Knowledge: A significant insight is that integrity constraints (e.g., foreign keys) can be automatically transformed into concept hierarchies, allowing for high-level explanations even without manual ontology engineering.

Key Results and Complexity

The paper establishes several critical theoretical bounds:

  • Tractability: For queries with a fixed number of columns (bounded arity) and ontologies in DL-Lite$_R$, finding most-general explanations is solvable in polynomial time (PTIME).
  • Existence Problem: Determining if any explanation exists for a given why-not question is NP-complete, even for relatively simple database structures.
  • Language Efficiency: For derived ontologies ($L_S$), the number of unique concepts remains polynomial for simple fragments but can grow double-exponentially as relational operators are added.

Limitations and Future Work

While providing a robust theoretical foundation, the framework has limitations. Finding the shortest explanation (in terms of symbol count) remains NP-hard. Additionally, the current model focuses on relational logic; future work aims to extend this to numerical and aggregate queries (e.g., "Why is the average revenue low?"). Integrating these high-level "why-not" explanations with traditional "why" (provenance) data could lead to more comprehensive debugging tools for data consumers.

Summary updated

BibTeX
@inproceedings{cate2015high,
  author = {Balder ten Cate and Cristina Civili and Evgeny Sherkhonov and Wang-Chiew Tan},
  title = {{High-Level Why-Not Explanations using Ontologies}},
  booktitle = {PODS},
  year = {2015},
  doi = {10.1145/2745754.2745765},
}
Figure