Skip to main content

rdfdiff

rdfdiff reads an RDF file's Git history as changes to its vocabulary, rather than as changed characters. It reports classes, properties, individuals,

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

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

uv sync --extra dev
uv run ruff check .
uv run ruff format --check .
uv run mypy semanticdiff
uv run pytest -q

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.

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/semanticdiff 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.

Release files for rdfdiff 0.1.0

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.0
File Size Uploaded
rdfdiff-0.1.0.tar.gz 42.0 kB Details

Built distribution (wheel)

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

Total release size: 62.1 kB

Release files / rdfdiff-0.1.0.tar.gz

Download URL rdfdiff-0.1.0.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
74e2a0777d44482e55d3df7f7210a68b44cda78a909b3799b86069097a5dfbf2
BLAKE2b-256 checksum
How to use checksums
f23233af8921a1f38a452c26bb4ed76c79d1a451931b8576856bcae4f8cd3f47
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 Sep 25, 2026.

Transparency log

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

Download URL rdfdiff-0.1.0-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02fd238695e8a687dd850f1d600ced651dcfb09458a6456468c80f98fc5a2f8a
BLAKE2b-256 checksum
How to use checksums
0595dc009c74a24b87495ec8c4a8015d99ec6a62fd09f0df19707227489ba9ea
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 Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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