java.lang.Object
org.apache.jena.riot.protobuf.ProtobufRDF
Operations on binary RDF using Google Protobuf.
An encoding use Apache Thrift is available in ThriftRDF
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
apply
(InputStream input, VisitorStreamRowProtoRDF action) Send the contents of a RDF-encoded protobuf file to an "action"static void
fileToStream
(String filename, StreamRDF dest) Decode the contents of the file and send to theStreamRDF
.static void
inputStreamToStreamRDF
(InputStream input, StreamRDF stream) Read an input stream and send item to theStreamRDF
.static RowSet
readRowSet
(InputStream input) Return a streamingRowSet
read from an input stream (with delimiters per row)static StreamRDF
streamToFile
(String filename) Create anStreamRDF
for output.static StreamRDF
streamToFile
(String filename, boolean withValues) Create anStreamRDF
for output.static StreamRDF
streamToOutputStream
(OutputStream output) AnStreamRDF
that writes to an output stream.static StreamRDF
streamToOutputStream
(OutputStream output, boolean withValues) AnStreamRDF
that writes to an output stream.static void
writeRowSet
(OutputStream out, RowSet rowSet) Write aRowSet
to an output stream (with delimiters per row)static void
writeRowSet
(OutputStream out, RowSet rowSet, boolean withValues) Write aRowSet
to an output stream (with delimiters per row)
-
Constructor Details
-
ProtobufRDF
public ProtobufRDF()
-
-
Method Details
-
streamToFile
Create anStreamRDF
for output. A filename ending.gz
will have a gzip compressor added to the output path. A filename of "-" isSystem.out
. The file is closed whenStreamRDF.finish()
is called unless it isSystem.out
. CallStreamRDF.start()
...StreamRDF.finish()
.- Parameters:
filename
- The file- Returns:
- StreamRDF A stream to send to.
-
streamToFile
Create anStreamRDF
for output. A filenames ending.gz
or.bz2
will have the respective compressor added to the output path. A filename of "-" isSystem.out
. The file is closed whenStreamRDF.finish()
is called unless it isSystem.out
. CallStreamRDF.start()
...StreamRDF.finish()
.- Parameters:
filename
- The filewithValues
- - whether to encode numeric values as values.- Returns:
- StreamRDF A stream to send to.
-
streamToOutputStream
AnStreamRDF
that writes to an output stream. The output stream is written with "writeDelimitedTo". -
streamToOutputStream
AnStreamRDF
that writes to an output stream. The output stream is written with "writeDelimitedTo". -
fileToStream
Decode the contents of the file and send to theStreamRDF
. A filename ending.gz
will have a gzip decompressor added. A filename of "-" isSystem.in
.- Parameters:
filename
- The file.dest
- Sink
-
inputStreamToStreamRDF
Read an input stream and send item to theStreamRDF
. The input stream will be read with "parseDelimitedTo".- Parameters:
input
- InputStreamstream
- StreamRDF
-
apply
Send the contents of a RDF-encoded protobuf file to an "action"- Parameters:
input
- InputStreamaction
- Code to act on the row.
-
readRowSet
Return a streamingRowSet
read from an input stream (with delimiters per row) -
writeRowSet
Write aRowSet
to an output stream (with delimiters per row) -
writeRowSet
Write aRowSet
to an output stream (with delimiters per row)
-