use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class Binding2Thrift method output.
public void output(Binding binding) {
Iterator<Var> vIter = (vars == null ? null : vars.iterator());
if (vIter == null)
vIter = binding.vars();
// }) ;
while (vIter.hasNext()) {
Var v = vIter.next();
Node n = binding.get(v);
RDF_Term rt = (n == null) ? TRDF.tUNDEF : ThriftConvert.convert(n, encodeValues);
row.addToRow(rt);
}
try {
row.write(protocol);
} catch (TException e) {
TRDF.exception(e);
}
row.clear();
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class STriple 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, triple.getSubject());
SerializerRDF.write(protocol, tterm, triple.getPredicate());
SerializerRDF.write(protocol, tterm, triple.getObject());
TRDF.flush(protocol);
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class STriple method readObject.
private void readObject(java.io.ObjectInputStream in) throws IOException {
TProtocol protocol = TRDF.protocol(in);
RDF_Term tterm = new RDF_Term();
Node s = SerializerRDF.read(protocol, tterm);
Node p = SerializerRDF.read(protocol, tterm);
Node o = SerializerRDF.read(protocol, tterm);
triple = Triple.create(s, p, o);
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class TestThriftTerm method term_value_06.
@Test
public void term_value_06() {
RDF_Term rt = testTermValue("'123'^^xsd:byte");
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_value_11.
@Test
public void term_value_11() {
RDF_Term rt = testTermValue("0.005");
assertTrue(rt.isSetValDecimal());
assertEquals(5, rt.getValDecimal().getValue());
assertEquals(3, rt.getValDecimal().getScale());
}
Aggregations