Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
78de7d0
Add stub for RDFC-1.0 and prepare tests.
mielvds Feb 5, 2026
578ea4c
Add rdf-canon to submodules
mielvds Feb 16, 2026
b8d1b82
Add rdflib to dependencies
mielvds Apr 15, 2026
84831f6
Re-enable canon tests
mielvds Apr 15, 2026
c48b118
Introduce rdflib into canon.py and replace internal model.
mielvds Apr 15, 2026
3a0d08b
Don't normalize literals
mielvds Apr 16, 2026
77409b0
Fixes positions and does small touchups
mielvds Apr 20, 2026
72f7d6b
Replace permutations with stdlib
mielvds Apr 20, 2026
ec91c54
Fix identifier ordering
mielvds Apr 20, 2026
cbb5778
Switch from NT to NQ serialization
mielvds Apr 20, 2026
2465c6b
Remove legacy nquads parsing dependency by moving parsing to canon.py
mielvds Apr 21, 2026
6148356
Move triple data structure convert functions to util.py
mielvds Apr 21, 2026
1f5d776
Cleanup of old canon code
mielvds Apr 21, 2026
cc394f9
Add tests for conversion methods in util.py and do fixes
mielvds Apr 21, 2026
a3e63b0
Make NQ serialization part of class & add override for RDFC1.0
mielvds Apr 22, 2026
a4a1244
Fix RDFC1.0 literal encoding
mielvds Apr 22, 2026
e91f7e0
Add configurable hashAlgorithm
mielvds Apr 22, 2026
1d3cf3a
Add option to return the bnode map.
mielvds Apr 22, 2026
73bf6f6
Rename _main to _canonicalize, add docstring and move function
mielvds Apr 22, 2026
539f616
Minimize change
mielvds Apr 23, 2026
af3a371
Make bnode map merge from parser more simple and robust
mielvds Apr 27, 2026
04daeec
Make linter happy
mielvds Apr 27, 2026
57fb3c0
Separate triple and dataset conversion from legacy
mielvds Apr 27, 2026
2d26704
Fix passing graph as identifier
mielvds May 6, 2026
cf77288
Add rdflib and RDFC10 changes to changelog
mielvds May 11, 2026
a083289
Call rdf-canon tests in github actions
mielvds May 11, 2026
c8d8bda
Re-enable hashAlgorithm parameter in tests
mielvds May 11, 2026
0c5ecff
[#220]: Add RDF canonicalization test submodule
anatoly-scherbakov May 11, 2026
6c9fac2
Remove unnecessary join from _quote_encode
mielvds May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
pytest tests/test_manifests.py --tests=./specifications/json-ld-api/tests --loader=${{ matrix.loader }}
pytest tests/test_manifests.py --tests=./specifications/json-ld-framing/tests --loader=${{ matrix.loader }}
pytest tests/test_manifests.py --tests=./specifications/normalization/tests --loader=${{ matrix.loader }}
pytest tests/test_manifests.py --tests=./specifications/rdf-canon/tests --loader=${{ matrix.loader }}
pytest --ignore ./tests/test_manifests.py
env:
LOADER: ${{ matrix.loader }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "specifications/normalization"]
path = specifications/normalization
url = https://github.com/json-ld/normalization.git
[submodule "specifications/rdf-canon"]
path = specifications/rdf-canon
url = https://github.com/w3c/rdf-canon.git
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# pyld ChangeLog

## 4.0.0 - unreleased

### Added

- migrate `canon.py` to `rdflib`
- added `rdflib` dependency in all relevant config and code files.
- added `util.py`:
- added the functions `from_legacy_dataset()` and `to_legacy_dataset()` to convert an `rdflib.Dataset` to an RDFJS-like `dict` and back wherever needed.
- added unittests in `tests/test_util.py` for these functions.
- implement RDFC1.0
- added new class `RDFC10` (subclass of `URDNA2015`) in `canon.py`
- added the RDFC1.0 test-suite in `tests/runtests.py`
- added support for testing blank-node identifier maps.
- added support for testing with different hashing algorithms

### Changed
- migrate `canon.py` to `rdflib`:
- now use `rdflib` for RDF term type checking (e.g., checking is something is a bnode), looping over triples/quads, nquads serialization and constructing RDF terms (custom deepcopy is no longer needed)
- move nquads parsing from`JsonLdProcessor.normalize()` to `URDNA2015.main()` so all parsing and serialization is handled by the same class.
- move the main logic to `URDNA2015._canonicalize(self, dataset: Dataset)` while keeping input and output in `URDNA2015.main()`. The method `URDNA2015._canonicalize(self, dataset: Dataset)` accepts an `rdflib.Dataset` and returns a tuple with
- the canonicalized result as a nquads `str` and
- the blank node identifier map as `dict`.
- the method `URDNA2015 .main(self, dataset: str | dict | Dataset, options)` now
- accepts a `rdflib.Dataset` object in addition to an nquads `str` or the original RDFJS-like`dict`.
- returns
- a `str`: the serialized nquads result, or
- a `dict`: the result as RDFJS-like dataset or the blank node identifier map when the new parameter `outputMap` is `True`.
- the hashing algorithm is now an class attribute `URDNA2015.hash_algorithm` so it configurable (required for RDFC1.0)
- the `permutations()` function now uses `itertools.permutations` instead of a custom implementation.
- replacements for rdflib's `_nq_row` and `_quoteLiteral` (these should eventually move to a fix for rdflib's nquads serializer).
- (re-)enabled all skipped URDNA2015, URDNA2012 tests in `tests/runtests.py`
- if the result of a test is a dict and the expected value is a string, the expected value is now parsed as JSON (needed for testing blank-node identifier maps).

## 3.1.0 - unreleased

### Fixed
Expand Down
Loading
Loading