OWL DL API Reference¶
OWL 2 DL classification and consistency via ontologos-dl, routed through ontologos-facade.
Install channel
PyPI / crates.io 1.0.0: Profile::Dl is production-supported. Validate on your corpus — see Evaluator scope and Install channels.
Narrative: Production integration — OWL DL · Evaluator scope.
Entry points¶
Prefer the facade for CLI/Python parity:
use ontologos_core::{Profile, Reasoner, ReasonerConfig};
use ontologos_facade::{check_consistency, classify, ClassifyOutcome};
use ontologos_parser::load_ontology;
let mut reasoner = Reasoner::builder()
.profile(Profile::Dl)
.config(ReasonerConfig {
budget_secs: Some(30),
..ReasonerConfig::default()
})
.build(load_ontology(path)?)?;
let result = check_consistency(&reasoner)?;
if !result.complete {
// budget or tableau limit — do not treat as proof
}
if result.consistent {
match classify(&mut reasoner)? {
ClassifyOutcome::Taxonomy(t) => { /* use taxonomy */ }
_ => unreachable!("Profile::Dl yields Taxonomy"),
}
}
Direct engine access (tests, benchmarks):
Consistency¶
| API | Returns | When to use |
|---|---|---|
ontologos_facade::check_consistency |
ConsistencyResult { consistent, complete } |
Production — inspect complete |
ontologos_facade::is_consistent |
Result<bool> |
Scripts only; Err on incomplete checks |
When complete == false, the DL engine hit a wall-clock or tableau budget. Increase budget_secs or fail closed.
Budget configuration¶
| Mechanism | Description |
|---|---|
ReasonerConfig::budget_secs |
Per-reasoner wall-clock limit (seconds) |
ONTOLOGOS_DL_BUDGET_SECS |
Env fallback when budget_secs is None |
CLI --budget-secs |
Global option on classify / consistency paths |
Without a budget, DL may run until natural completion — risky on pathological inputs.
Profile::Dl vs Profile::DlPreview¶
| Profile | Status | Behavior |
|---|---|---|
Dl |
Stable on v1.0.0 | Full DL engine |
DlPreview |
Preview | Same engine with explicit preview gating — see Preview profiles |
Hybrid routing (Profile::Auto)¶
Mixed EL/DL ontologies may route modules separately (MORe-style hybrid). CLI profile JSON may include hybrid_modules. Validate on your corpus — catalog parity does not cover every production ontology.
Python¶
On PyPI 1.0.0:
from ontologos import Reasoner
reasoner = Reasoner(path="ontology.owl", profile="dl", budget_secs=30)
consistency = reasoner.check_consistency()
if not consistency["complete"]:
raise RuntimeError("DL consistency incomplete")
report = reasoner.classify()
CLI¶
Production checklist¶
- Always use
check_consistency— notis_consistentalone. - Set
budget_secsfor every DL request. - Do not set
ONTOLOGOS_CONFORMANCE,ONTOLOGOS_STRICT_TAXONOMY, orONTOLOGOS_CI_PROMOTED_ONLYin production. - Validate on your corpus — HermiT catalog parity applies to gated test corpora only.
- Serialize OWL loads — horned-owl parsing uses a process-wide mutex.
See Security and Production integration.
Errors¶
DL errors surface as ontologos_facade::Error::Dl or ontologos_dl::Error:
| Variant | Meaning |
|---|---|
IncompleteConsistency / IncompleteReasoning |
Budget or tableau limit hit |
Inconsistent |
Proved inconsistent |
PreviewLimit |
Preview profile cap exceeded |
ResourceLimit |
Axiom/entity cap exceeded |
WrongProfile |
Ontology/profile mismatch |
Full table: Error reference.