Skip to main content

rdfdiff

checks PyPI License: MIT

rdfdiff reads an RDF file's Git history as changes to its vocabulary, rather than as changed characters. It reports classes, properties, individuals, concepts and ontologies as added, removed, modified, renamed, or deprecated.

Equivalent RDF serializations produce no semantic change, so reformatting, prefix changes, reordered triples, and blank-node relabeling do not hide actual ontology evolution.

Install

uv tool install rdfdiff

Or run the current checkout:

uv run semanticdiff log --repo /path/to/ontology-repository

Use

Summarize every commit that changed an RDF file:

semanticdiff log v0.1..v0.2 --repo /path/to/ontology-repository --file ontology.ttl

Trace one entity through a revision range:

semanticdiff show ex:Product v0.1..HEAD --repo /path/to/ontology-repository --file ontology.ttl

Export an interactive visual graph diff HTML page for a commit:

semanticdiff visual HEAD --repo /path/to/ontology-repository --file ontology.ttl -o diff.html

Filter visual diff elements by status (added, deleted, or updated):

semanticdiff visual HEAD --status added -o added.html

Options for visual:

  • -o, --output: Target output HTML file path.
  • -s, --status: Filter visual diff elements (added, deleted, or updated).

When a repository has exactly one tracked RDF file, --file is optional. Use --text with log to append Git's raw hunks after the semantic report.

Library API

from rdflib import Graph
from semanticdiff import compare

changes = compare(before_graph, after_graph)

read_history(repo, revision_range, path) pairs each commit touching path with its semantic change set. The public vocabulary is exported from the package root: Change, ChangeKind, ChangeSet, CommitChanges, and EntityKind.

Development

See CONTRIBUTING.md for setup, the branch/commit conventions, and the full local development workflow. Quick start:

uv sync --extra dev
bash scripts/install-hooks.sh   # one-time: pre-commit + pre-push hooks
bash scripts/ci.sh              # full local gate before every push

scripts/ci.sh runs on your current interpreter (fast feedback); GitHub Actions runs the full 3.12 / 3.13 matrix on every PR. Pass --fast to skip the patch-coverage gate during iteration, or --fix to let the linters auto-fix what they can before re-checking.

The distribution is named rdfdiff; its Python import and command-line command remain semanticdiff. The project deliberately has no dependency on Ster. Ster can consume it as an optional integration, but the diff engine and command-line tool remain usable with any RDF repository.

The test suite includes pure graph comparisons, Git-history and CLI tests, and BDD scenarios for semantic change reporting. The throw-away Git repositories in the tests exercise real Git plumbing rather than mocks.

Releases

Releases are published to PyPI by the pypi-publish.yml GitHub Actions workflow when a v* tag is pushed. PyPI trusted publishing must be configured for the gbelbe/rdfdiff repository, the pypi-publish.yml workflow, and the pypi environment before the first release tag is created. The pending PyPI publisher must use the rdfdiff project name.

Known gap: trusted publishing was not configured before v0.1.1 was tagged, so that publish failed (invalid-publisher) and only 0.1.0 is live on PyPI today. Configure the trusted publisher on PyPI's project settings before pushing another release tag.

Metadata

Release files for rdfdiff 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rdfdiff 0.1.2
File Size Uploaded Provenance Actions
rdfdiff-0.1.2.tar.gz 179.3 kB With provenance Details for rdfdiff-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rdfdiff 0.1.2
File Interpreter ABI Platform Actions
rdfdiff-0.1.2-py3-none-any.whl Python 3 none any Details for rdfdiff-0.1.2-py3-none-any.whl

Total release size: 206.3 kB

Release files / rdfdiff-0.1.2.tar.gz

Download URL rdfdiff-0.1.2.tar.gz
Size 179.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bcca34260ca73db770f8ef15d2c4561fd04350a0edb49d2fb1368bd4ada516c1
BLAKE2b-256 checksum
How to use checksums
fd19e3818fb8296c9730ccec5bef30bb5245d9ff69bfed9da5c5cd217fa8a3f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / rdfdiff-0.1.2-py3-none-any.whl

Download URL rdfdiff-0.1.2-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bde58d0487039b19bb2f96a32370acdc08c0f47268e2b89b9c1c32a57aef662
BLAKE2b-256 checksum
How to use checksums
053de7e9886dcc3ca1934f4f1eea40f23bb336f73fe00adabcb6c87f696206fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for rdfdiff 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rdfdiff-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page