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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapply(InputStream input, VisitorStreamRowProtoRDF action) Send the contents of a RDF-encoded protobuf file to an "action"static voidfileToStream(String filename, StreamRDF dest) Decode the contents of the file and send to theStreamRDF.static voidinputStreamToStreamRDF(InputStream input, StreamRDF stream) Read an input stream and send item to theStreamRDF.static RowSetreadRowSet(InputStream input) Return a streamingRowSetread from an input stream (with delimiters per row)static StreamRDFstreamToFile(String filename) Create anStreamRDFfor output.static StreamRDFstreamToFile(String filename, boolean withValues) Create anStreamRDFfor output.static StreamRDFstreamToOutputStream(OutputStream output) AnStreamRDFthat writes to an output stream.static StreamRDFstreamToOutputStream(OutputStream output, boolean withValues) AnStreamRDFthat writes to an output stream.static voidwriteRowSet(OutputStream out, RowSet rowSet) Write aRowSetto an output stream (with delimiters per row)static voidwriteRowSet(OutputStream out, RowSet rowSet, boolean withValues) Write aRowSetto an output stream (with delimiters per row)
-
Constructor Details
-
ProtobufRDF
public ProtobufRDF()
-
-
Method Details
-
streamToFile
Create anStreamRDFfor output. A filename ending.gzwill 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 anStreamRDFfor output. A filenames ending.gzor.bz2will 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
AnStreamRDFthat writes to an output stream. The output stream is written with "writeDelimitedTo". -
streamToOutputStream
AnStreamRDFthat 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.gzwill 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 streamingRowSetread from an input stream (with delimiters per row) -
writeRowSet
Write aRowSetto an output stream (with delimiters per row) -
writeRowSet
Write aRowSetto an output stream (with delimiters per row)
-