Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Information Provided
-
Jena 3.16.0
-
None
-
None
Description
For streams of Model and Datesets (or Graphs and DatasetGraphs) there does not appear to be a 'push'-based RDF Writer.
Although there exists the deprecated method:
WriterDatasetRIOT ds = RDFDataMgr.createDatasetWriter(RDFFormat.TURTLE_PRETTY);
The documentation states that the returned object is for one-time use only.
The feature request is to make it possible to write out streams of Datasets in a push-based manner. Thereby the writer should maintain state information such that prefixes and base IRIs are not written out redundantly.
try(OutputStream out = ...} { StreamWriterDatasetRIOT sink = RDFDataMgr.createStreamDatasetWriter(out, RDFFormat.TURTLE_PRETTY); sink.start(); // May immediately trigger a write on the output stream for (Dataset ds : streamOfDatasets) { sink.send(ds); sink.flush(); } sink.finish(); // Write out footer and free resources // Is tthere is a need for sink.close()? } // close resources