Diff OWL/RDF ontologies,
find what really changed
owlcompare goes beyond triple-level diff — it surfaces renames, restriction changes, and severity-classified breaking changes, in a report built for humans reviewing a pull request, not for compilers.
pip install owlcompare
See it in action
One command turns two ontology files into a self-contained, interactive report you can open offline, attach to an email, or commit to a PR.
Five output formats: terminal, beautiful HTML, PR-comment-ready Markdown, plus JSON and JUnit XML for automation. Open a live HTML report → · a rename example →
What makes it different
Existing tools list every added and removed axiom. owlcompare tells you what those axioms mean.
Beyond triple-level diff
A four-layer model — syntactic, structural, inferential, impact — collapses hundreds of axiom edits into the handful of semantic events that actually matter. A class move stops being 200 changes and becomes one.
Smart rename detection
An entity that was renamed shows up as one rename — not an add plus a remove — across three confidence tiers (label, structural fingerprint, user-asserted). When it isn't sure, it shows confidence, not certainty.
CI-ready
A three-line GitHub Action diffs your ontology on every pull request, posts the report as a comment, uploads HTML + JUnit artifacts, and fails the build on breaking changes. Exit codes and JUnit XML are first-class.
Install in 30 seconds
Pure Python, no JVM. Pick your tool.
# Install the CLI from PyPI pip install owlcompare # …or as an isolated tool pipx install owlcompare
# Add to a uv project uv add owlcompare # …or install as a global tool uv tool install owlcompare
# .github/workflows/ontology-diff.yml - uses: actions/checkout@v4 - uses: Ajala111/owlcompare@v1 with: ontology-path: ontology/my-ontology.ttl
# Your first diff — text report to the terminal owlcompare diff old.ttl new.ttl # …or a self-contained HTML report you can share owlcompare diff old.ttl new.ttl --format html --out report.html
From noise to signal
A real edit to a small example ontology, two versions apart.
$ owlcompare diff sample_v1.ttl sample_v2.ttl 9 triples added, 10 triples removed (1 breaking) Layer 1 — Structural (5 changes) [additive] Class added: ex:ElectricVehicle [breaking] Object property removed: ex:assembledAt [non_breaking] Restriction changed on ex:Car: ex:hasWheel max 4 → max 6 [info] Label changed on ex:Vehicle (fr) [info] Ontology metadata: versionInfo 1.0.0 → 2.0.0
19 raw triple changes become 5 meaningful events — and exactly one is flagged breaking, so your CI knows when to stop the merge.