NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PAGOdA: Pay-As-You-Go Ontology Query Answering Using a Datalog Reasoner

Yujiao Zhou, Bernardo Cuenca Grau, Yavor Nenov, Mark Kaminski, Ian Horrocks

Researchers from the University of Oxford have introduced PAGOdA, a novel "pay-as-you-go" framework designed to answer complex queries over large-scale knowledge bases. By combining high-speed, approximate Datalog reasoning with slow, exact OWL 2 reasoning, the system achieves full sound and complete accuracy without the typical performance penalties associated with expressive logic.

The Scalability Challenge in Semantic Web Querying

In the Semantic Web, knowledge is often represented using RDF and the OWL 2 language. Querying this data (typically via Conjunctive Queries or SPARQL) is computationally expensive because OWL 2 is highly expressive. It allows for complex relationships, such as existential axioms (describing unnamed objects) and disjunctions (logical "OR" statements), which lead to high worst-case complexity.

Existing reasoning systems generally fall into two categories:

  1. Scalable but Incomplete: These systems use Datalog engines or restricted "profiles" of OWL 2. They are fast but may miss valid answers if the ontology exceeds their logical limits.
  2. Complete but Unscalable: Full-fledged reasoners like HermiT or Pellet handle the entire logic of OWL 2 but often fail to process medium-to-large datasets within a reasonable timeframe.

The challenge addressed by PAGOdA is providing sound and complete answers—ensuring no results are missing and no incorrect results are returned—while maintaining the scalability required for real-world datasets.

The PAGOdA Framework

PAGOdA (Pay-As-you-GO dAtalog) operates through a multi-step pipeline that prioritizes speed while guaranteeing correctness.

1. Computing Lower and Upper Bounds

The system first utilizes a high-performance Datalog reasoner (RDFox) to compute two sets of answers. The lower bound contains only guaranteed correct answers (sound but potentially incomplete). The upper bound is a relaxation of the ontology that contains all possible answers (complete but potentially unsound).

Mapping OWL 2 axioms to Datalog rules for upper-bound reasoning.

As shown in the table above, complex OWL 2 axioms are translated into Datalog-like rules. For example, existential axioms (O10) are simplified to ensure the Datalog engine can process them, even if it introduces some "noise" into the upper bound.

2. Gap Identification and Fragment Extraction

If the lower and upper bounds match, the query is finished. If a "gap" exists—tuples present in the upper bound but not the lower—these are treated as candidate answers requiring verification. To avoid re-processing the entire dataset, PAGOdA identifies the specific "fragment" of the ontology and data responsible for these gap tuples by tracking logical proofs within the Datalog engine.

3. Pruning and Summarization

Before invoking a heavy-duty reasoner, PAGOdA applies two optimization techniques:

  • Summarization: It "shrinks" the data by merging individuals with identical types (unary predicates). This allows the reasoner to quickly discard many false candidates by checking a simplified model.
  • Dependency Analysis: It determines if one candidate answer logically depends on another, significantly reducing the number of individual checks required.

4. Final Verification

The slow OWL 2 reasoner (HermiT) is only called to verify the remaining, pruned gap tuples against the small, extracted fragments. This turns a "big data" problem into a series of "small data" tasks.

Experimental Evaluation

The authors evaluated PAGOdA against several prominent benchmarks and realistic datasets, including LUBM, UOBM, and the complex Fly Anatomy ontology.

  • Efficiency: On the LUBM benchmark, PAGOdA answered 22 out of 24 queries using only the fast Datalog bounds, averaging just 12 seconds per query.
  • Handling Complexity: For the Fly Anatomy ontology, which is rich in existential axioms, PAGOdA provided answers in 0.2 seconds. In contrast, the standard reasoner Pellet failed to return any results after an hour.
  • Scalability: On DBPedia+, the system matched bounds for 439 out of 441 concepts immediately. For the remaining two, summarization and fragment extraction allowed the system to finish in under 3 seconds.

Conclusion

PAGOdA demonstrates that Datalog is not just for simple reasoning; it can serve as a rigorous filter for much more complex logics. By isolating the "hard" parts of a query into small fragments, the system provides a scalable path toward full OWL 2 reasoning. Future work aims to refine fragment extraction and integrate more efficient equality reasoning to further enhance performance on non-Horn ontologies.

Summary updated

BibTeX
@article{zhou2015pagoda,
  author = {Yujiao Zhou and Bernardo Cuenca Grau and Yavor Nenov and Mark Kaminski and Ian Horrocks},
  title = {{PAGOdA: Pay-As-You-Go Ontology Query Answering Using a Datalog Reasoner}},
  journal = {J. Artif. Intell. Res.},
  year = {2015},
  doi = {10.1613/jair.4757},
}
Figure