Skip to main content

ttlser

PyPI version

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

  1. 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. See symmetric_predicates in serializers.py.
  2. 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).
  3. 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.
  4. 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.
  5. scottl is a broken mess. In principle this orders by the rdfs:subClassOf hierarchy and then natsort, however in practice it currently does whatever it wants. I'm also fairly certain that the test template scogood.ttl is not correct.

Metadata

Release files for ttlser 1.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ttlser 1.1.7
File Size Uploaded
ttlser-1.1.7.tar.gz 33.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ttlser 1.1.7
File Interpreter ABI Platform
ttlser-1.1.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 60.5 kB

Release files / ttlser-1.1.7.tar.gz

Download URL ttlser-1.1.7.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
05bd5855b50a1d13ffa8a059ce38ad41b1c8e07c6da8050bd52dc23e7bfc8f6b
BLAKE2b-256 checksum
How to use checksums
8dcacc9560ab20e795aa573193be6b995fe4c0b2635cdc30d6aeaf18bb22e3fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / ttlser-1.1.7-py2.py3-none-any.whl

Download URL ttlser-1.1.7-py2.py3-none-any.whl
Size 26.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c76d830afb90b5cc066dfce4eeafb91499bc6b6ebe12f604369adc99cc8ee155
BLAKE2b-256 checksum
How to use checksums
b81e9d20f235e95607fccba54b85b8db22f46c9dde65cf627afcafd1a06cb0d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1.7 This release

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page