Skip to content

Conversation

@lapkinvladimir
Copy link
Contributor

This PR adds read/write support for the Jelly binary RDF serialization format in KGX

Jelly is a compact RDF format integrated with RDFLib via the pyjelly library and provides faster load/save performance for large graphs compared to N-Triples.

What was done

  • Added "jelly" to SOURCE_MAP and SINK_MAP
  • Implemented streaming Jelly parsing in rdf_source.py using pyjelly’s flat streaming API
  • Implemented a true streaming Jelly writer in rdf_sink.py using TripleStream.for_rdflib, avoiding graph construction and buffering
  • Added pyjelly = "0.6.2" (compatible with Python 3.9)

Added integration tests covering:

  • TSV to Jelly to TSV roundtrip
  • Jelly read/write
  • Jelly with node filters
  • Jelly to TSV export

Notes

Jelly support uses pyjelly 0.6.2, because KGX currently targets Python 3.9.
Once KGX upgrades to Python ≥ 3.10, this can be bumped to pyjelly ≥ 0.7.x

@caufieldjh
Copy link
Collaborator

Thanks @lapkinvladimir ! I haven't used Jelly in practice but this looks like a valuable addition.
I'm going to make some minor changes to the dependencies and tests before merging.

@caufieldjh caufieldjh merged commit 9942e50 into biolink:master Dec 19, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants