Abstract
This paper introduces cq-programs, an extension to Description Logic (DL) programs that enables rules to perform complex Conjunctive Queries (CQs) against ontologies. By delegating relational reasoning to the DL reasoner and employing a suite of algebraic rewriting optimizations, the authors demonstrate significant performance improvements and enhanced expressivity, particularly in handling unnamed individuals.
Introduction
A major challenge in the Semantic Web is the integration of ontologies (Description Logics) with rule-based reasoning (Logic Programming). Previous approaches, such as dl-programs, were limited by their inability to reason about unnamed individuals and the performance overhead caused by frequent, simple queries to the ontology reasoner. This paper addresses these bottlenecks by allowing rules to ask complex "Conjunctive Queries" (CQs) or Unions of CQs (UCQs), effectively delegating complex joins to the highly optimized DL reasoner.
Methodology: The CQ-Program Approach
The core contribution is the cq-program framework. Unlike its predecessors, a cq-program can contain atoms representing full CQs. This allows the rule engine to offload structural logic to the DL reasoner in a single call.
To ensure efficiency, the authors developed several equivalence-preserving rewriting rules:
- Query Pushing: Consolidates multiple ontology calls into a single complex CQ.
- Fact Pushing: Injects known facts from the rule engine into the ontology query to prune the search space.
- Variable Elimination & Inequality Pushing: Optimizes query structure to minimize the reasoner's workload.
- Unfolding: Adapts classic logic programming techniques to pre-calculate rule steps.
The system was implemented in the dlvhex prototype, utilizing the RACER reasoner for the DL backend.
Experimental Results
The approach was evaluated across several benchmarks, including the Wine, VICODI, SEMINTEC, and LUBM ontologies. The results indicate that these optimizations are crucial for scalability.
In the Wine ontology tests (represented by the region program), the optimized version achieved orders of magnitude speedup. As shown in the figure above, the unoptimized version (P) hit performance limits at scale, while the optimized version (P') remained efficient even for the largest instances.
Similarly, the LUBM benchmark results demonstrate the scalability of the "Query Pushing" and "Variable Elimination" techniques. The gap between the unoptimized (P) and optimized (P') execution times widens significantly as the number of departments increases, highlighting the effectiveness of delegating joins to the DL reasoner.
Conclusion
The introduction of cq-programs and associated rewriting optimizations represents a significant step forward in combining rules and ontologies. By leveraging the strengths of both logic programming and description logic reasoners, the authors achieve both greater expressivity and superior performance. Future work includes developing a cost-based model for query optimization and exploring compatibility with other DL reasoners.
Summary updated