use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class NodeTableTRDF method writeNodeToTable.
@Override
protected NodeId writeNodeToTable(Node node) {
RDF_Term term = ThriftConvert.convert(node, true);
try {
long x = diskFile.length();
// Paired : [*]
NodeId nid = NodeIdFactory.createPtr(x);
term.write(protocol);
// transport.flush();
return nid;
} catch (TransactionException ex) {
throw ex;
} catch (Exception ex) {
throw new TDBException("NodeTableThrift/Write", ex);
}
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class NodeTableTRDF method readNodeFromTable.
@Override
protected Node readNodeFromTable(NodeId id) {
try {
// Paired : [*]
long x = id.getPtrLocation();
transport.readPosition(x);
RDF_Term term = new RDF_Term();
term.read(protocol);
Node n = ThriftConvert.convert(term);
return n;
} catch (TException ex) {
throw new TDBException("NodeTableTRDF/Read", ex);
} catch (RiotThriftException ex) {
Log.error(this, "Bad encoding: NodeId = " + id);
throw ex;
}
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class tdbdumpnodes method readOne.
private static Node readOne(TProtocol protocol) throws TException {
RDF_Term term = new RDF_Term();
term.read(protocol);
Node n = ThriftConvert.convert(term);
return n;
}
Aggregations