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
f8c549d
Add stub for RDFC-1.0 and prepare tests.
mielvds Feb 5, 2026
0c876c3
Add rdf-canon to submodules
mielvds Feb 16, 2026
6a75f60
Add rdflib to dependencies
mielvds Apr 15, 2026
2dbd88c
Re-enable canon tests
mielvds Apr 15, 2026
1ff8a1f
Introduce rdflib into canon.py and replace internal model.
mielvds Apr 15, 2026
dc8235d
Don't normalize literals
mielvds Apr 16, 2026
7f18c27
Fixes positions and does small touchups
mielvds Apr 20, 2026
608187b
Replace permutations with stdlib
mielvds Apr 20, 2026
6634cd0
Fix identifier ordering
mielvds Apr 20, 2026
32ad5cc
Switch from NT to NQ serialization
mielvds Apr 20, 2026
bc3f38f
Remove legacy nquads parsing dependency by moving parsing to canon.py
mielvds Apr 21, 2026
955af85
Move triple data structure convert functions to util.py
mielvds Apr 21, 2026
4b1c059
Cleanup of old canon code
mielvds Apr 21, 2026
8f14c4f
Add tests for conversion methods in util.py and do fixes
mielvds Apr 21, 2026
5f9ef4b
Make NQ serialization part of class & add override for RDFC1.0
mielvds Apr 22, 2026
c76f568
Fix RDFC1.0 literal encoding
mielvds Apr 22, 2026
0dd4852
Add configurable hashAlgorithm
mielvds Apr 22, 2026
fb1dd55
Add option to return the bnode map.
mielvds Apr 22, 2026
73baf8d
Rename _main to _canonicalize, add docstring and move function
mielvds Apr 22, 2026
08f60bb
Minimize change
mielvds Apr 23, 2026
610ca7b
Make bnode map merge from parser more simple and robust
mielvds Apr 27, 2026
37f73d9
Make linter happy
mielvds Apr 27, 2026
72b3c8d
Separate triple and dataset conversion from legacy
mielvds Apr 27, 2026
0198863
Fix passing graph as identifier
mielvds May 6, 2026
ccaffa4
Add rdflib and RDFC10 changes to changelog
mielvds May 11, 2026
a8fa260
Call rdf-canon tests in github actions
mielvds May 11, 2026
dd6bca4
Re-enable hashAlgorithm parameter in tests
mielvds May 11, 2026
43dc809
[#220]: Add RDF canonicalization test submodule
anatoly-scherbakov May 11, 2026
e3258ce
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