|
2 | 2 |
|
3 | 3 | [Documentation](https://digitalbazaar.github.io/pyld/) | |
4 | 4 | [Installation](#installation) | [Usage](#usage) | [Advanced |
5 | | -Topics](#advanced-topics) | [Contributing](./CONTRIBUTING.md) | |
| 5 | +Topics](#advanced-topics) | [What's new in version 4](#whats-new-in-version-4) | |
| 6 | +[Contributing](./CONTRIBUTING.md) | |
6 | 7 | [Changelog](./CHANGELOG.md) |
7 | 8 |
|
8 | 9 | ## Introduction |
@@ -45,6 +46,27 @@ memory footprint in order to operate. |
45 | 46 | * [Requests](http://docs.python-requests.org/) (optional) |
46 | 47 | * [aiohttp](https://aiohttp.readthedocs.io/) (optional) |
47 | 48 |
|
| 49 | +## What's new in version 4 |
| 50 | + |
| 51 | +PyLD 4 moves RDF handling to [RDFLib](https://rdflib.readthedocs.io/) and adds |
| 52 | +RDF Dataset Canonicalization 1.0 support. |
| 53 | + |
| 54 | +The main developer-facing changes are: |
| 55 | + |
| 56 | +* `jsonld.to_rdf()` returns an `rdflib.Dataset` by default when no output |
| 57 | + `format` is requested. |
| 58 | +* `jsonld.to_rdf(doc, {'legacyMode': True})` returns the RDF.js-like dataset |
| 59 | + `dict` used by PyLD versions lower than 4. |
| 60 | +* `jsonld.from_rdf()` accepts `rdflib.Dataset`, N-Quads strings, and the legacy |
| 61 | + dataset `dict`. |
| 62 | +* `jsonld.normalize()` defaults to `RDFC10`; pass `{'algorithm': 'URDNA2015'}` |
| 63 | + if older canonicalization output must remain stable. |
| 64 | +* The internal `pyld.nquads` parser/serializer module has been removed. Use the |
| 65 | + JSON-LD APIs with `format: 'application/n-quads'` or RDFLib directly. |
| 66 | + |
| 67 | +See the full [version 4 upgrade notes](https://digitalbazaar.github.io/pyld/whats-new-version-4/) |
| 68 | +and the [`4.0.0` changelog entry](./CHANGELOG.md#400---unreleased). |
| 69 | + |
48 | 70 | ## Installation |
49 | 71 |
|
50 | 72 | PyLD can be installed with a [pip](http://www.pip-installer.org/) |
@@ -121,10 +143,10 @@ flattened = jsonld.flatten(doc) |
121 | 143 | framed = jsonld.frame(doc, frame) |
122 | 144 | # document transformed into a particular tree structure per the given frame |
123 | 145 |
|
124 | | -# normalize a document using the RDF Dataset Normalization Algorithm |
125 | | -# (URDNA2015), see: https://www.w3.org/TR/rdf-canon/ |
| 146 | +# normalize a document using RDF Dataset Canonicalization 1.0 |
| 147 | +# (RDFC10), see: https://www.w3.org/TR/rdf-canon/ |
126 | 148 | normalized = jsonld.normalize( |
127 | | - doc, {'algorithm': 'URDNA2015', 'format': 'application/n-quads'}) |
| 149 | + doc, {'algorithm': 'RDFC10', 'format': 'application/n-quads'}) |
128 | 150 | # normalized is a string that is a canonical representation of the document |
129 | 151 | # that can be used for hashing, comparison, etc. |
130 | 152 | ``` |
|
0 commit comments