Querying Inductive Databases via Logic-Based User-Defined Aggregates

Fosca Giannotti, Giuseppe MancoPKDD 1999

Abstract

This paper presents a unified framework for Knowledge Discovery in Databases (KDD) by integrating data mining tasks as specialized queries within a deductive database system. By utilizing Logic-Based User-Defined Aggregates (UDAs) within the $LDL++$ language, the authors demonstrate how complex mining processes—such as association rule discovery—can be formalized and executed within a single logical formalism. This approach bridges the gap between raw data and induced knowledge, enabling a declarative environment for inductive databases where patterns are queried as easily as records.

Introduction

The Knowledge Discovery in Databases (KDD) process has traditionally been a fragmented endeavor. While raw data typically resides in robust relational databases, the actual "mining" of that data—extracting patterns, trends, and rules—usually occurs in external, specialized software environments. This separation creates a significant hurdle: once patterns are discovered, they are often stored in isolated formats, making it difficult to query the relationship between the raw data and the newly induced knowledge simultaneously.

This research addresses this disconnect by proposing a formal, unified language capable of handling both deductive knowledge (facts and rules already present in the database) and induced knowledge (patterns discovered through mining). The goal is to realize the vision of an "Inductive Database," a system where the distinction between data and discovery is blurred through a common logical framework.

The Inductive Database Challenge

The primary obstacle to a unified KDD environment is the lack of a language that is expressive enough to define mining algorithms while remaining integrated with database query capabilities. Traditional SQL is ill-equipped for the iterative and combinatorial nature of data mining. Consequently, users are forced to export data to external tools, losing the benefits of database management systems, such as optimization, security, and concurrency control. The authors argue that by treating data mining as a specialized form of query, the entire KDD lifecycle can be managed within a single system.

Methodology: Logic-Based User-Defined Aggregates

The researchers utilize $LDL++$, a deductive database language based on logic programming (Datalog). The core innovation of their approach is the use of Logic-Based User-Defined Aggregates (UDAs) to represent mining functions.

In standard SQL, aggregates are limited to fixed functions like SUM or AVG. In $LDL++$, however, users can define complex, custom aggregates. These UDAs are defined using three specific predicates that govern the lifecycle of the aggregation:

  1. single: Initializes the computation state with the first element of the set.
  2. multi: Defines the recursive logic for updating the state as subsequent elements are processed.
  3. freturn: Specifies the final output format and applies any necessary post-processing or filtering conditions (e.g., "only return itemsets that meet a minimum support threshold").

By defining a patterns aggregate, the authors show that finding frequent itemsets becomes a declarative query. To maintain performance, the paper proposes a "middleware" approach: while the logic defines the what (the declarative mining task), the system can invoke external, optimized C++ engines (such as the Apriori algorithm) to handle the how, ensuring computational efficiency without sacrificing formal elegance.

Key Insights: Mining as Aggregation

The most significant conceptual shift presented in this work is the realization that data mining is essentially a sophisticated form of data aggregation. If a system can define how to "sum" or accumulate patterns across a dataset, it can perform KDD within the query language itself.

This logic-based approach offers several advantages:

  • Uniformity: Discovered patterns (induced knowledge) can immediately serve as input for subsequent deductive queries. There is no "wall" between the data and the insights.
  • Declarative KDD: Complex tasks, such as hierarchical mining (e.g., moving from specific brands like "Pilsner" to general categories like "Beer") or constrained mining, can be expressed in just a few lines of code. This moves KDD away from "black box" algorithms toward transparent, programmable logic.

Qualitative Results and Applications

The paper demonstrates the versatility of the $LDL++$ framework through several qualitative examples using simulated retail transaction data:

  • Association Rule Mining: The framework successfully formalizes the discovery of rules such as {pasta} -> {wine}.
  • Post-Processing and Filtering: The system allows for intuitive queries that filter discovered rules, such as identifying only those rules where a specific item appears as the consequent.
  • Multi-Level Mining: The authors illustrate how to "drill down" or "roll up" through item hierarchies while maintaining consistent support thresholds across different levels of abstraction.
  • Constraint-Based Mining: The framework can easily restrict mining to specific subsets of data, such as finding patterns unique to "high-spending" customers defined by a specific expenditure threshold.

Conclusion and Future Work

While the logic-based approach provides a powerful and elegant formalism for inductive databases, the authors acknowledge that efficiency remains a primary concern. General-purpose logic engines are typically slower than hand-tuned, specialized mining algorithms.

The proposed solution—a tight coupling where the logic language acts as a coordinator for optimized external engines—offers a path forward. Future research is directed toward deeper integration of optimization techniques directly into the Datalog compiler, allowing the system to handle constrained association rules more natively and efficiently on massive, real-world datasets.

Summary updated

BibTeX
@inproceedings{giannotti1999querying,
  author = {Fosca Giannotti and Giuseppe Manco},
  title = {{Querying Inductive Databases via Logic-Based User-Defined Aggregates}},
  booktitle = {PKDD},
  year = {1999},
  doi = {10.1007/978-3-540-48247-5\_14},
}
Figure