Skip to content

Migrate from v0.8.x to v0.9.0

v0.9.0 completes the Python ecosystem milestone: in-memory ontologies, explain(), incremental mutations, and optional DataFrame export. Rust library APIs are unchanged from v0.8.0 except the workspace version bump.

Bump versions

ontologos-core = "0.9.0"
ontologos-bridge = "0.9.0"
ontologos-parser = "0.9.0"
ontologos-profile = "0.9.0"
ontologos-rdfs = "0.9.0"
ontologos-rl = "0.9.0"
ontologos-el = "0.9.0"
ontologos-query = "0.9.0"
ontologos-explain = "0.9.0"

Python: pip install ontologos==0.9.0

Python breaking changes

v0.8.x v0.9.0
Reasoner("file.owl", profile="el") Reasoner(path="file.owl", profile="el") — positional path still works
No in-memory API Ontology, OntologyBuilder, Reasoner(ontology=...)
No explain reasoner.explain() → proof graph dict
No mutation helpers add_subclass_of, remove_subclass_of, add_axiom_json

New Python APIs

API Purpose
Ontology.from_json / from_dict Load JSON v2 snapshot
OntologyBuilder Fluent TBox/ABox construction
Reasoner.explain() Proof graph (see trace limits in Python guide)
subsumptions_to_pandas / subsumptions_to_polars Optional taxonomy export

Incremental Python workflow

from ontologos import OntologyBuilder, Reasoner

builder = OntologyBuilder()
builder.add_class("http://example.org/A")
builder.add_class("http://example.org/B")
builder.subclass_of("http://example.org/A", "http://example.org/B")
reasoner = Reasoner(ontology=builder.build(), profile="el", incremental=True)
reasoner.classify()
reasoner.add_subclass_of("http://example.org/B", "http://example.org/C")
reasoner.classify()

Rust users

No API changes required. Re-bump crate versions only.