Deterministic turtle serialization for rdflib.
Project description
ttlser
Deterministic turtle serialization for rdflib.
Documentation
See the docs for the full specification and details on the implemention.
ttlser also includes a number of other turtle serializers for
specific rendering needs.
ttlfmt
ttlser provides a ttlfmt script that can convert any rdflib supported
format into the output format supported by the serializers or any other
rdflib serializer. If you want to use it you should install with ttlser[ttlfmt].
Known issues
- symmetric predicates: If you have symmetric predicates like
owl:disjointWiththen ttlser needs to know about them so that it can do the reordering those cases appropriately, otherwise you will end up with situations where another tool reorders the serialization and ttlser has to assume that the ordering is semantically meaningful. Seesymmetric_predicatesin serializers.py. - multiple prefixes: If there is more than one curie prefix for the same iri prefix then the one that is selected will depend on the dicationary ordering (which while stable in newer version of python is not guranteed to be the same based on the contents of the data, rather on the history of the additions and removals).
- rdflib version: ttlser cannot produce deterministic results without the changes added in https://github.com/RDFLib/rdflib/pull/649. Hopefully those will be merged for rdflib-5.0.0, in the mean time ttlser depends on neurdflib which includes those changes. Once it is merged then ttlser will depend on versions of rdflib that come after and neurdflib will be deprecated.
- Random failures. Every once in awhile list serialization fails specatcuarly. The cause is not obvious (same input file every time for testing), but it is probably because the fixed point function used to implement bnode ranking has a bug.
- scottl is a broken mess. In principle this orders by the
rdfs:subClassOfhierarchy and thennatsort, however in practice it currently does whatever it wants. I'm also fairly certain that the test template scogood.ttl is not correct.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ttlser-1.1.0.tar.gz.
File metadata
- Download URL: ttlser-1.1.0.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fab8836b57d23b6b7a08c3c44e98f17aea29b614065811f96077d4f80d280e2b
|
|
| MD5 |
1dd89ecf9be1e5c24022057d420f8936
|
|
| BLAKE2b-256 |
afdcb323c181529c414dfd15342419a0fdebf63345bde46d0dd730596b54bb90
|
File details
Details for the file ttlser-1.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: ttlser-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0373fcfc7904808020a5574c9b3415c70018de019d26f93ed247d9fa564c49cb
|
|
| MD5 |
1f2f9ee38333b554b6f02cdc3cbc7b71
|
|
| BLAKE2b-256 |
b8deb909f0f58117bd0de15e7b5ee03595bce989c4c5b6c181549cd8c6ec444f
|