Coverage for lode / helpers / formats.py: 100%

2 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-11-22 15:54 +0000

1# lode/helpers/formats.py 

2"""The export formats shared by every layer. 

3 

4The artefact formats live in the profile registry (lode.profiles), which also gates them: 

5see lode.profiles.get_enabled. 

6""" 

7 

8# Export formats: triples of the loaded artefact only. Shared by the viewers, 

9# the static builder and the API, so they live here and not in a viewer. 

10SERIALIZATION_FORMATS = [ 

11 {"label": "Turtle", "fmt": "turtle", "mime": "text/turtle", "ext": "ttl", "icon": "bi-filetype-raw"}, 

12 {"label": "RDF/XML", "fmt": "xml", "mime": "application/rdf+xml", "ext": "xml", "icon": "bi-file-code"}, 

13 {"label": "JSON-LD", "fmt": "json-ld", "mime": "application/ld+json", "ext": "jsonld", "icon": "bi-filetype-json"}, 

14 {"label": "N-Triples", "fmt": "nt", "mime": "application/n-triples", "ext": "nt", "icon": "bi-file-text"}, 

15] 

16 

17# Provenance formats: quads, the named graph of each triple is always shown. 

18QUAD_SERIALIZATION_FORMATS = [ 

19 {"label": "TriG", "fmt": "trig", "mime": "application/trig", "ext": "trig", "icon": "bi-filetype-raw"}, 

20 {"label": "JSON-LD", "fmt": "json-ld", "mime": "application/ld+json", "ext": "jsonld", "icon": "bi-filetype-json"}, 

21 {"label": "N-Quads", "fmt": "nquads", "mime": "application/n-quads", "ext": "nq", "icon": "bi-file-text"}, 

22]