use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class TestThriftTerm method term_value_04.
@Test
public void term_value_04() {
RDF_Term rt = testTermValue("'123'^^xsd:int");
assertTrue(rt.isSetValInteger());
assertEquals(123, rt.getValInteger());
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class TestThriftTerm method term_literal_04.
@Test
public void term_literal_04() {
RDF_Term rt = testTerm("'foo'^^<http://dataype/>");
assertTrue(rt.getLiteral().isSetDatatype());
assertFalse(rt.getLiteral().isSetDtPrefix());
assertEquals(rt.getLiteral().getDatatype(), "http://dataype/");
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class Thift2Binding method moveToNext.
@Override
protected Binding moveToNext() {
b.reset();
try {
row.read(protocol);
} catch (TTransportException e) {
return null;
} catch (TException e) {
TRDF.exception(e);
}
if (row.getRowSize() != vars.size())
throw new RiotThriftException(String.format("Vars %d : Row length : %d", vars.size(), row.getRowSize()));
for (int i = 0; i < vars.size(); i++) {
// Old school
Var v = vars.get(i);
RDF_Term rt = row.getRow().get(i);
if (rt.isSetUndefined())
continue;
Node n = ThriftConvert.convert(rt);
b.add(v, n);
}
row.clear();
return b.build();
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class SNode method writeObject.
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
TProtocol protocol = TRDF.protocol(out);
RDF_Term tterm = new RDF_Term();
SerializerRDF.write(protocol, tterm, node);
TRDF.flush(protocol);
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class SNode method readObject.
private void readObject(java.io.ObjectInputStream in) throws IOException {
TProtocol protocol = TRDF.protocol(in);
RDF_Term tterm = new RDF_Term();
node = SerializerRDF.read(protocol, tterm);
}
Aggregations