A Java implementation of a streaming RDF N-Quads reader and writer, optimized for efficient parsing, serialization, and handling of large RDF datasets. It enables scalable processing of RDF statements in a memory-efficient, streaming fashion.
Formerly part of Titanium JSON-LD
// Reading N-Quads
new NQuadsReader(reader).provide(RdfQuadConsumer);
// Writing N-Quads
new NQuadsWriter(writer).quad(...).quad(...).quad(...);
// Demonstrating RdfQuadConsumer usage by reading and writing in one step
// Since NQuadsWriter implements the RdfQuadConsumer interface,
// it can be directly used as a consumer, e.g. with JsonLd.toRdf.
new NQuadsReader(reader).provide(new NQuadsWriter(writer));
// Static access to NQuadsWriter methods
var encoded = NQuadsWriter.nquad(...);
var encodedLiteral = NQuadsWriter.literal(...);
<dependency>
<groupId>com.apicatalog</groupId>
<artifactId>titanium-rdf-n-quads</artifactId>
<version>1.0.2</version>
</dependency>
implementation("com.apicatalog:titanium-rdf-n-quads:1.0.2")
All PR's welcome!
Fork and clone the project repository.
> cd titanium-rdf-n-quads
> mvn package