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
b7ae520
Add stub for RDFC-1.0 and prepare tests.
mielvds Feb 5, 2026
4e8b504
Add rdf-canon to submodules
mielvds Feb 16, 2026
6e2cddf
Add rdflib to dependencies
mielvds Apr 15, 2026
d75f2a2
Re-enable canon tests
mielvds Apr 15, 2026
d6cfbce
Introduce rdflib into canon.py and replace internal model.
mielvds Apr 15, 2026
5007bd2
Don't normalize literals
mielvds Apr 16, 2026
0a40fba
Fixes positions and does small touchups
mielvds Apr 20, 2026
1195d98
Replace permutations with stdlib
mielvds Apr 20, 2026
9dc7f02
Fix identifier ordering
mielvds Apr 20, 2026
e574dc2
Switch from NT to NQ serialization
mielvds Apr 20, 2026
0e33e86
Remove legacy nquads parsing dependency by moving parsing to canon.py
mielvds Apr 21, 2026
9bdde1d
Move triple data structure convert functions to util.py
mielvds Apr 21, 2026
cb0d6e7
Cleanup of old canon code
mielvds Apr 21, 2026
48ef8d2
Add tests for conversion methods in util.py and do fixes
mielvds Apr 21, 2026
a65cacc
Make NQ serialization part of class & add override for RDFC1.0
mielvds Apr 22, 2026
e9044fd
Fix RDFC1.0 literal encoding
mielvds Apr 22, 2026
151d884
Add configurable hashAlgorithm
mielvds Apr 22, 2026
b29604a
Add option to return the bnode map.
mielvds Apr 22, 2026
280bf44
Rename _main to _canonicalize, add docstring and move function
mielvds Apr 22, 2026
fc2b953
Minimize change
mielvds Apr 23, 2026
8685e1e
Make bnode map merge from parser more simple and robust
mielvds Apr 27, 2026
4058c7b
Make linter happy
mielvds Apr 27, 2026
7cdc9c1
Separate triple and dataset conversion from legacy
mielvds Apr 27, 2026
867a909
Fix passing graph as identifier
mielvds May 6, 2026
0e42099
Add rdflib and RDFC10 changes to changelog
mielvds May 11, 2026
438cb35
Call rdf-canon tests in github actions
mielvds May 11, 2026
d888c9f
Re-enable hashAlgorithm parameter in tests
mielvds May 11, 2026
21e16fe
[#220]: Add RDF canonicalization test submodule
anatoly-scherbakov May 11, 2026
a41ab1c
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