Skip to content

ADR-0015 — Adopt OntoLogos as Reasoner Backend

Status

Accepted

Context

ADR-0014 requires Rust-native reasoning with no JVM. Prior plans assumed OntoIndex would ship direct adapters to whelk-rs and reasonable, plus an in-tree OWL 2 DL engine in ontoindex-reasoner (REASONER_SPEC.md).

OntoLogos is a sibling Rust workspace (same maintainer) that already provides:

OntoLogos crate Role
ontologos-core In-memory OWL ontology model
ontologos-parser OWL/RDF load via horned-owl
ontologos-profile OWL profile detection
ontologos-bridge core ↔ horned-owl ↔ reasonable adapters
ontologos-rdfs RDFS materialization (→ reasonable)
ontologos-rl OWL RL saturation (→ reasonable)
ontologos-el OWL EL classification (in-house)
ontologos-query Taxonomy queries
ontologos-explain Proof graphs and explanations
ontologos-facade Multi-profile routing (classify --profile auto) — 1.0.0 workspace
ontologos-dl OWL 2 DL reasoner — 1.0.0 workspace, HermiT parity in progress
ontologos-watch File-watch reload — scoped as OntoCode hook

crates.io today: nine crates at 0.9.0 (EL, RL, RDFS, explain, query).
GitHub main: workspace 1.0.0 toward HermiT catalog parity (~64% at 2026-06-23).

Building a second DL reasoner and duplicate EL/RL facades inside OntoIndex would fork effort and drift from OntoLogos conformance tests.

Decision

  1. ontoindex-reasoner is a thin integration crate, not an in-tree DL engine. It implements OntoIndex's ReasonerAdapter trait (REASONER_SPEC.md) by delegating to OntoLogos crates.
  2. Version policy:
OntoCode milestone OntoLogos dependency Capabilities unlocked
v0.6 (initial reasoning) 0.9.0 (crates.io) EL (ontologos-el), RL (ontologos-rl), RDFS (ontologos-rdfs), profile detection, taxonomy query, EL-first explanations
v1.0 (DL parity gate) ≥ 1.0.0 (crates.io publish) ontologos-dl, ontologos-facade auto-routing, production DL explanations via ontologos-explain
v0.9 (incremental index) 0.9.0+ Evaluate ontologos-watch for file-change → reclassify hook
  1. Adapter mapping (OntoIndex surface → OntoLogos backend):
ReasonerAdapter id OntoLogos backend Notes
el ontologos-el Default for OBO / EL-detectable TBoxes
rl ontologos-rl OWL RL saturation
rdfs ontologos-rdfs Explicit RDFS materialization
dl ontologos-dl Requires OntoLogos 1.0.0; MVP blocked until publish
auto ontologos-facade Requires OntoLogos 1.0.0; profile routing
  1. Do not depend on whelk-rs directly in OntoIndex. EL classification goes through ontologos-el (OntoLogos may benchmark against whelk-rs internally).
  2. Do not depend on reasonable directly in OntoIndex. RL/RDFS go through ontologos-rl / ontologos-rdfs.
  3. Dual-stack boundary (ADR-0013): Oxigraph remains authoritative for SPARQL and triple-level SQL tables. Reasoning input is built from workspace files via ontologos-parser (or bridged from ontoindex-owl once v0.4b lands). Classification results are written back into the OntoIndex catalog cache for LSP/explorer inferred views.
  4. Honest parity: OntoCode v1.0 DL exit criteria track OntoLogos 1.0.0 HermiT parity, not a separate in-tree engine. Migration guide cites OntoLogos supported constructs.

Consequences

Positive:

  • Single Rust reasoner stack across CLI, LSP, and future Python tooling.
  • OntoLogos HermiT conformance suite becomes the shared quality gate.
  • ontoindex-reasoner stays small: trait, catalog bridge, cache, LSP JSON mapping.
  • ontologos-watch provides a ready integration point for v0.9 incremental workflows.

Negative:

  • OntoCode v1.0 DL timeline depends on OntoLogos 1.0.0 crates.io publish, not only OntoIndex UI work.
  • Two ontology models in memory (Oxigraph catalog + ontologos_core::Ontology) until bridge optimization.
  • Partial OWL mapping in OntoLogos (axiom_count() ≠ Protégé totals) applies to OntoCode reasoning until OntoLogos closes gaps.

Implementation notes

  • v0.6: add ontoindex-reasoner with el, rl, rdfs adapters; pin ontologos-* = "0.9.0".
  • v0.6 UI: reasoner profile picker shows el / rl / rdfs; dl disabled with "requires OntoLogos 1.0" until publish.
  • v1.0: bump to ontologos-* = "1.0"; enable dl and auto adapters; wire explanation panel to ontologos-explain.
  • CI: run OntoLogos golden fixtures alongside OntoIndex integration tests on shared fixtures/.