Metadata-Version: 2.5
Name: rdfdiff
Version: 0.1.0
Summary: Read an RDF file's Git history as semantic change rather than text
Project-URL: Homepage, https://github.com/gbelbe/semanticdiff
Project-URL: Repository, https://github.com/gbelbe/semanticdiff
Project-URL: Issues, https://github.com/gbelbe/semanticdiff/issues
License: MIT License
        
        Copyright (c) 2024 gbelbe
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: diff,git,ontology,owl,rdf,semantic-web,skos
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Version Control
Requires-Python: >=3.12
Requires-Dist: rdflib>=7.0
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=9.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# 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

```sh
uv tool install rdfdiff
```

Or run the current checkout:

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

## Use

Summarize every commit that changed an RDF file:

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

Trace one entity through a revision range:

```sh
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

```python
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

```sh
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.
