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, supporting RDF 1.2 dirLangString alongside the i18n datatype.
// Reading N-Quads
try (var reader = new NQuadsReader(input)) {
reader.provide((...) -> {
// N-Quad processing
);
}
// Writing N-Quads
try (var writer = new NQuadsWriter(output)) {
writer.quad(...);
writer.quad(...);
writer.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.
try (var reader = new NQuadsReader(input);
var writer = new NQuadsWriter(output)) {
reader.provide(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>${nquads.version}</version>
</dependency>Contributions of all kinds are welcome - whether it’s code, documentation, testing, or community support! Please open PR or issue to get started.
Commercial support and consulting are available. For inquiries, please contact: filip26@gmail.com