java.lang.Object
org.apache.jena.riot.thrift.ThriftRDF
Operations on binary RDF (which uses Apache Thrift).
See also
ThriftConvert, for specific functions on binary RDF.
Encoding use Protobuf is available in ProtobufRDF.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapply(org.apache.thrift.protocol.TProtocol protocol, Consumer<RDF_StreamRow> action) Send the contents of a RDF-encoded Thrift file to an "action"static voiddump(OutputStream out, InputStream in) Debug help - print details of a Thrift stream.static voidfileToStream(String filename, StreamRDF dest) Decode the contents of the file and send to theStreamRDF.static voidinputStreamToStream(InputStream in, StreamRDF dest) Decode the contents of the input stream and send to theStreamRDF.static voidprotocolToStream(org.apache.thrift.protocol.TProtocol protocol, StreamRDF dest) Decode the contents of the TProtocol and send to theStreamRDF.static RowSetstatic RowSetreadRowSet(org.apache.thrift.protocol.TProtocol protocol) static StreamRDFstreamToFile(String filename) Create anStreamRDFfor output.static StreamRDFstreamToFile(String filename, boolean withValues) Create anStreamRDFfor output.static StreamRDFCreate anStreamRDFfor output.static StreamRDFstreamToOutputStream(OutputStream out, boolean withValues) Create anStreamRDFfor output.static StreamRDFstreamToTProtocol(org.apache.thrift.protocol.TProtocol protocol) Create anStreamRDFfor output.static StreamRDFstreamToTProtocol(org.apache.thrift.protocol.TProtocol protocol, boolean withValues) Create anStreamRDFfor output.static voidwriteRowSet(OutputStream out, RowSet rowSet) static voidwriteRowSet(OutputStream out, RowSet rowSet, boolean withValues) static voidwriteRowSet(org.apache.thrift.protocol.TProtocol protocol, RowSet rowSet) static voidwriteRowSet(org.apache.thrift.protocol.TProtocol protocol, RowSet rowSet, boolean encodeValues)
-
Constructor Details
-
ThriftRDF
public ThriftRDF()
-
-
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
Create anStreamRDFfor output. TheOutputStreamis closed whenStreamRDF.finish()is called unless it isSystem.out. CallStreamRDF.start()...StreamRDF.finish().- Parameters:
out- OutputStream- Returns:
- StreamRDF A stream to send to.
-
streamToOutputStream
Create anStreamRDFfor output. TheOutputStreamis closed whenStreamRDF.finish()is called unless it isSystem.out. CallStreamRDF.start()...StreamRDF.finish().- Parameters:
out- OutputStreamwithValues- - whether to encode numeric values as values.- Returns:
- StreamRDF A stream to send to.
-
streamToTProtocol
Create anStreamRDFfor output. TheOutputStreamis closed whenStreamRDF.finish()is called unless it isSystem.out. CallStreamRDF.start()...StreamRDF.finish().- Parameters:
protocol- Output and encoding.- Returns:
- StreamRDF A stream to send to.
-
streamToTProtocol
public static StreamRDF streamToTProtocol(org.apache.thrift.protocol.TProtocol protocol, boolean withValues) Create anStreamRDFfor output. TheOutputStreamis closed whenStreamRDF.finish()is called unless it isSystem.out. CallStreamRDF.start()...StreamRDF.finish().- Parameters:
protocol- Output and encoding.withValues- - whether to encode numeric values as values.- Returns:
- StreamRDF A stream to send to.
-
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
-
inputStreamToStream
Decode the contents of the input stream and send to theStreamRDF.- Parameters:
in- InputStreamdest- StreamRDF
-
protocolToStream
Decode the contents of the TProtocol and send to theStreamRDF.- Parameters:
protocol- TProtocoldest- Sink
-
apply
public static void apply(org.apache.thrift.protocol.TProtocol protocol, Consumer<RDF_StreamRow> action) Send the contents of a RDF-encoded Thrift file to an "action"- Parameters:
protocol- TProtocolaction- Code to act on the row.
-
dump
Debug help - print details of a Thrift stream. Destructive on the InputStream.- Parameters:
out- OutputStreamin- InputStream
-
readRowSet
-
readRowSet
-
writeRowSet
-
writeRowSet
-
writeRowSet
-
writeRowSet
public static void writeRowSet(org.apache.thrift.protocol.TProtocol protocol, RowSet rowSet, boolean encodeValues)
-