Skip to content

Conversation

@Ostrzyciel
Copy link

This PR adds support in the CLI tool for reading and writing files in Jelly, a high-performance binary RDF format.

Jelly is faster to parse and write than Turtle, so it may be useful when working with larger files.

It's a non-indexed streaming binary format, so it can work with arbitrarily large files, using constant memory (unlike HDT).

Implementation

I added the jelly-jena dependency, which integrates nicely with the Jena RIOT API. The remaining changes are to autodetect file format based on the extension, and to add the -outputFormat parameter.

From what I can see, adding support for more formats (e.g., JSON-LD, NT, RDF/XML) should be relatively simple, as these are already bundled with Jena.

Tests

I added a test that runs the infer and validate commands in an end-to-end setting. I don't think there was an end-to-end CLI test before in the suite, so this should help a little bit with test coverage.

I'm testing inference with some RDF data I created in a previous project (it's fine to be included here, I release it under Apache 2.0). The validation test case comes from RiverBench. This code is already under Apache 2.0, but just in case – I wrote the whole thing myself, so it's also fine to be included.

Using Jelly files

  • You can use jelly-cli to convert to/from Jelly files.
  • You can use it with Apache Jena Fuseki by installing the Jelly plugin for Jena.
  • You can also use pyjelly to read/write Jelly files with rdflib in Python.

Dependencies

This effectively only adds two small dependencies:

  • jelly-core – generic serialization code for Jelly (178 KB JAR)
  • jelly-jena – integration of jelly-core with Jena (33 KB JAR)

jelly-core also depends on protobuf-java, but that dependency is already included with Jena.

The Jelly libraries are extensively tested (8000+ test cases in the main suite) and have mitigations for known security risks tested in CI. They are production-grade and are currently being used for example in the nanopublication services for inter-service communication.

@Ostrzyciel Ostrzyciel requested a review from afs June 10, 2025 16:43
Ostrzyciel added a commit to Ostrzyciel/rmlmapper-java that referenced this pull request Jun 10, 2025
@afs
Copy link
Contributor

afs commented Jun 26, 2025

Could someone with the power please remove me as a reviewer - the UI isn't letting me do that (maybe because I'm not an official collaborator on this repo).

@ashleycaselli ashleycaselli requested review from afs and ashleycaselli and removed request for afs June 26, 2025 14:40
@ashleycaselli
Copy link
Collaborator

Coudl someone with the power please remove me as a reviewer - the UI isn't letting me do that (maybe because I'm not an official collaborator on this repo).

The UI for this doesn't look great. You end up on the reviewers' list because you left comments and reviewed changes in the past, and there is no way to remove yourself from there. Anyways, you won't be asked to do the final review before merging the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants