|
4 | 4 |
|
5 | 5 | ### Added |
6 | 6 |
|
7 | | -- migrate `canon.py` to `rdflib` |
8 | | - - added `rdflib` dependency in all relevant config and code files. |
9 | | - - added `util.py`: |
10 | | - - added the functions `from_legacy_dataset()` and `to_legacy_dataset()` to convert an `rdflib.Dataset` to an RDFJS-like `dict` and back wherever needed. |
11 | | - - added unittests in `tests/test_util.py` for these functions. |
12 | | -- implement RDFC1.0 |
13 | | - - added new class `RDFC10` (subclass of `URDNA2015`) in `canon.py` |
14 | | - - added the RDFC1.0 test-suite in `tests/runtests.py` |
15 | | - - added support for testing blank-node identifier maps. |
16 | | - - added support for testing with different hashing algorithms |
| 7 | +- Migrate `canon.py` to `rdflib` |
| 8 | + - Added `rdflib` dependency in all relevant config and code files. |
| 9 | + - Added `util.py`: |
| 10 | + - Added the functions `from_legacy_dataset()` and `to_legacy_dataset()` to convert an `rdflib.Dataset` to an RDFJS-like `dict` and back wherever needed. |
| 11 | + - Added unittests in `tests/test_util.py` for these functions. |
| 12 | +- Implement RDFC1.0 |
| 13 | + - Added new class `RDFC10` (subclass of `URDNA2015`) in `canon.py` |
| 14 | + - Added the RDFC1.0 test-suite in `tests/runtests.py` |
| 15 | + - Added support for testing blank-node identifier maps. |
| 16 | + - Added support for testing with different hashing algorithms |
| 17 | + |
| 18 | +### Removed |
| 19 | + |
| 20 | +- **BREAKING**: Removed the internal `pyld.nquads` parser/serializer module. |
| 21 | + |
| 22 | +### Fixed |
| 23 | + |
| 24 | +- Preserved RDF literal lexical forms when converting through RDFLib, including canonical double output, large numeric values, and compound literal handling. |
| 25 | +- Fixed `iri_resolver.unresolve()` query/fragment reconstruction while cleaning up the resolver docstring. |
17 | 26 |
|
18 | 27 | ### Changed |
19 | | - - migrate `canon.py` to `rdflib`: |
20 | | - - 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) |
21 | | - - move nquads parsing from`JsonLdProcessor.normalize()` to `URDNA2015.main()` so all parsing and serialization is handled by the same class. |
22 | | - - 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 |
23 | | - - the canonicalized result as a nquads `str` and |
24 | | - - the blank node identifier map as `dict`. |
25 | | - - the method `URDNA2015 .main(self, dataset: str | dict | Dataset, options)` now |
26 | | - - accepts a `rdflib.Dataset` object in addition to an nquads `str` or the original RDFJS-like`dict`. |
27 | | - - returns |
28 | | - - a `str`: the serialized nquads result, or |
29 | | - - a `dict`: the result as RDFJS-like dataset or the blank node identifier map when the new parameter `outputMap` is `True`. |
30 | | - - the hashing algorithm is now an class attribute `URDNA2015.hash_algorithm` so it configurable (required for RDFC1.0) |
31 | | - - the `permutations()` function now uses `itertools.permutations` instead of a custom implementation. |
32 | | - - replacements for rdflib's `_nq_row` and `_quoteLiteral` (these should eventually move to a fix for rdflib's nquads serializer). |
33 | | - - (re-)enabled all skipped URDNA2015, URDNA2012 tests in `tests/runtests.py` |
34 | | - - 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). |
| 28 | +- **BREAKING**: Migrated `jsonld.to_rdf()`, `jsonld.from_rdf()`, and N-Quads parsing/serialization to use `rdflib.Dataset` and RDFLib terms directly. |
| 29 | + - `jsonld.to_rdf()` now returns an `rdflib.Dataset` by default when no output `format` is requested. |
| 30 | + - Added `legacyMode` to `jsonld.to_rdf()` to return the previous RDF.js-like dataset `dict`. |
| 31 | + - `jsonld.from_rdf()` now accepts both `rdflib.Dataset` inputs and the previous legacy dataset `dict` shape. |
| 32 | + - Updated RDF-related tests for RDFLib dataset and N-Quads serialization behavior. |
| 33 | +- **BREAKING**: nquads input/output now delegates to RDFLib instead of PyLD’s custom parser and serializer. |
| 34 | +- Migrate `canon.py` to `rdflib`: |
| 35 | + - 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) |
| 36 | + - Move nquads parsing from`JsonLdProcessor.normalize()` to `URDNA2015.main()` so all parsing and serialization is handled by the same class. |
| 37 | + - 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 |
| 38 | + - the canonicalized result as a nquads `str` and |
| 39 | + - the blank node identifier map as `dict`. |
| 40 | + - The method `URDNA2015 .main(self, dataset: str | dict | Dataset, options)` now |
| 41 | + - accepts a `rdflib.Dataset` object in addition to an nquads `str` or the original RDFJS-like`dict`. |
| 42 | + - returns |
| 43 | + - a `str`: the serialized nquads result, or |
| 44 | + - a `dict`: the result as RDFJS-like dataset or the blank node identifier map when the new parameter `outputMap` is `True`. |
| 45 | + - The hashing algorithm is now an class attribute `URDNA2015.hash_algorithm` so it configurable (required for RDFC1.0) |
| 46 | + - The `permutations()` function now uses `itertools.permutations` instead of a custom implementation. |
| 47 | + - Replacements for rdflib's `_nq_row` and `_quoteLiteral` (these should eventually move to a fix for rdflib's nquads serializer). |
| 48 | + - Re-enabled all skipped URDNA2015, URDNA2012 tests in `tests/runtests.py` |
| 49 | +- 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). |
| 50 | +- **BREAKING**: Removed small Python 2-era compatibility code and simplified a few internal collection checks. |
35 | 51 |
|
36 | 52 | ## 3.2.0 - unreleased |
37 | 53 |
|
|
0 commit comments