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:disjointWith
then 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_predicates
in 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:subClassOf
hierarchy 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ttlser-1.1.5.tar.gz
(30.1 kB
view hashes)
Built Distribution
ttlser-1.1.5-py2.py3-none-any.whl
(23.9 kB
view hashes)
Close
Hashes for ttlser-1.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24900bdd8212813c3bdddebf5cad2213401ba8881d6fe258fb8c1a7b51ffb760 |
|
MD5 | b5212764fae620f96a34912f891bb985 |
|
BLAKE2b-256 | 75892cf95c50aa52aea42dc245c7941b446a69a18a97510276ea9d5c2e7d7cc3 |