Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e8ca68a
Represent numbers without fractions but larger or equal to 1e21 as do…
mielvds Jul 9, 2026
419ff14
Use absolute value for test and allow custom datatype
mielvds Jul 16, 2026
82fbd9c
Add regression test for integer conversion with processing mode
mielvds Jul 16, 2026
4b66df7
Push options further down and gate integer conversion for 1.1
mielvds Jul 16, 2026
d25a25f
Adjust changelog
mielvds Jul 16, 2026
5b1a4d9
Add stub for RDFC-1.0 and prepare tests.
mielvds Feb 5, 2026
95070c1
Add rdf-canon to submodules
mielvds Feb 16, 2026
941315f
Add rdflib to dependencies
mielvds Apr 15, 2026
b325f40
Re-enable canon tests
mielvds Apr 15, 2026
1afbe18
Introduce rdflib into canon.py and replace internal model.
mielvds Apr 15, 2026
a6aaec4
Don't normalize literals
mielvds Apr 16, 2026
5f39936
Fixes positions and does small touchups
mielvds Apr 20, 2026
3391c82
Replace permutations with stdlib
mielvds Apr 20, 2026
6ffc456
Fix identifier ordering
mielvds Apr 20, 2026
0b237ba
Switch from NT to NQ serialization
mielvds Apr 20, 2026
f2b15a4
Remove legacy nquads parsing dependency by moving parsing to canon.py
mielvds Apr 21, 2026
dd45b25
Move triple data structure convert functions to util.py
mielvds Apr 21, 2026
8c3ce89
Cleanup of old canon code
mielvds Apr 21, 2026
c69a524
Add tests for conversion methods in util.py and do fixes
mielvds Apr 21, 2026
042959a
Make NQ serialization part of class & add override for RDFC1.0
mielvds Apr 22, 2026
0baf554
Fix RDFC1.0 literal encoding
mielvds Apr 22, 2026
da8eab3
Add configurable hashAlgorithm
mielvds Apr 22, 2026
3995213
Add option to return the bnode map.
mielvds Apr 22, 2026
9d053d9
Rename _main to _canonicalize, add docstring and move function
mielvds Apr 22, 2026
c9a902f
Minimize change
mielvds Apr 23, 2026
8977001
Make bnode map merge from parser more simple and robust
mielvds Apr 27, 2026
e750ee3
Make linter happy
mielvds Apr 27, 2026
b9f62aa
Separate triple and dataset conversion from legacy
mielvds Apr 27, 2026
3d27a9d
Fix passing graph as identifier
mielvds May 6, 2026
039f657
Add rdflib and RDFC10 changes to changelog
mielvds May 11, 2026
1fa4e72
Call rdf-canon tests in github actions
mielvds May 11, 2026
918c9b7
Re-enable hashAlgorithm parameter in tests
mielvds May 11, 2026
e27bb6d
[#220]: Add RDF canonicalization test submodule
anatoly-scherbakov May 11, 2026
10902a5
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
34 changes: 34 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.2.0 - unreleased

### Added
Expand All @@ -13,6 +46,7 @@
- Numbers with 0 as fractional part now parse to an `xsd:integer` instead of `xsd:double`. Fixes [toRdf#ttn02](https://w3c.github.io/json-ld-api/tests/toRdf-manifest.html#ttn02).
- Zeros are now truncated for numeric values with negative exponent.
- Blank node prefixes are now also used in IRI expansion.
- Numbers with no fractions but that are >= 1e21 are now represented as xsd:double in json-ld-1.1 processing mode.

## 3.1.0 - 2026-06-19

Expand Down
Loading
Loading