Package org.apache.jena.riot.thrift
Class BinRDF
- java.lang.Object
-
- org.apache.jena.riot.thrift.BinRDF
-
public class BinRDF extends java.lang.ObjectOperations on binary RDF (which uses Apache Thrift). See alsoThriftConvert, for specific functions on binary RDF.- See Also:
ThriftConvert
-
-
Constructor Summary
Constructors Constructor Description BinRDF()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapply(org.apache.thrift.protocol.TProtocol protocol, java.util.function.Consumer<RDF_StreamRow> action)Send the contents of a RDF-encoded Thrift file to an "action"static voiddump(java.io.OutputStream out, java.io.InputStream in)Debug help - print details of a Thrift stream.static voidfileToStream(java.lang.String filename, StreamRDF dest)Decode the contents of the file and send to theStreamRDF.static voidinputStreamToStream(java.io.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 ResultSetreadResultSet(java.io.InputStream in)static ResultSetreadResultSet(org.apache.thrift.protocol.TProtocol protocol)static StreamRDFstreamToFile(java.lang.String filename)Create anStreamRDFfor output.static StreamRDFstreamToFile(java.lang.String filename, boolean withValues)Create anStreamRDFfor output.static StreamRDFstreamToOutputStream(java.io.OutputStream out)Create anStreamRDFfor output.static StreamRDFstreamToOutputStream(java.io.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 voidwriteResultSet(java.io.OutputStream out, ResultSet resultSet)static voidwriteResultSet(java.io.OutputStream out, ResultSet resultSet, boolean withValues)static voidwriteResultSet(org.apache.thrift.protocol.TProtocol protocol, ResultSet resultSet)static voidwriteResultSet(org.apache.thrift.protocol.TProtocol protocol, ResultSet resultSet, boolean encodeValues)
-
-
-
Method Detail
-
streamToFile
public static StreamRDF streamToFile(java.lang.String filename)
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
public static StreamRDF streamToFile(java.lang.String filename, boolean withValues)
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
public static StreamRDF streamToOutputStream(java.io.OutputStream out)
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
public static StreamRDF streamToOutputStream(java.io.OutputStream out, boolean withValues)
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
public static StreamRDF streamToTProtocol(org.apache.thrift.protocol.TProtocol protocol)
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
public static void fileToStream(java.lang.String filename, StreamRDF dest)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
public static void inputStreamToStream(java.io.InputStream in, StreamRDF dest)Decode the contents of the input stream and send to theStreamRDF.- Parameters:
in- InputStreamdest- StreamRDF
-
protocolToStream
public static void protocolToStream(org.apache.thrift.protocol.TProtocol protocol, StreamRDF dest)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, java.util.function.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
public static void dump(java.io.OutputStream out, java.io.InputStream in)Debug help - print details of a Thrift stream. Destructive on the InputStream.- Parameters:
out- OutputStreamin- InputStream
-
readResultSet
public static ResultSet readResultSet(java.io.InputStream in)
-
readResultSet
public static ResultSet readResultSet(org.apache.thrift.protocol.TProtocol protocol)
-
writeResultSet
public static void writeResultSet(java.io.OutputStream out, ResultSet resultSet)
-
writeResultSet
public static void writeResultSet(java.io.OutputStream out, ResultSet resultSet, boolean withValues)
-
writeResultSet
public static void writeResultSet(org.apache.thrift.protocol.TProtocol protocol, ResultSet resultSet)
-
writeResultSet
public static void writeResultSet(org.apache.thrift.protocol.TProtocol protocol, ResultSet resultSet, boolean encodeValues)
-
-