use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class SQuad method readObject.
private void readObject(java.io.ObjectInputStream in) throws IOException {
TProtocol protocol = TRDF.protocol(in);
RDF_Term tterm = new RDF_Term();
Node g = SerializerRDF.read(protocol, tterm);
Node s = SerializerRDF.read(protocol, tterm);
Node p = SerializerRDF.read(protocol, tterm);
Node o = SerializerRDF.read(protocol, tterm);
quad = Quad.create(g, s, p, o);
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class SQuad 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, quad.getGraph());
SerializerRDF.write(protocol, tterm, quad.getSubject());
SerializerRDF.write(protocol, tterm, quad.getPredicate());
SerializerRDF.write(protocol, tterm, quad.getObject());
TRDF.flush(protocol);
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class TestThriftTerm method term_literal_01.
@Test
public void term_literal_01() {
RDF_Term rt = testTerm("'foo'");
assertFalse(rt.getLiteral().isSetDatatype());
assertFalse(rt.getLiteral().isSetDtPrefix());
assertFalse(rt.getLiteral().isSetLangtag());
}
use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.
the class TestThriftTerm method term_value_03.
@Test
public void term_value_03() {
RDF_Term rt = testTermValue("'123'^^xsd:long");
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_05.
@Test
public void term_value_05() {
RDF_Term rt = testTermValue("'123'^^xsd:short");
assertTrue(rt.isSetValInteger());
assertEquals(123, rt.getValInteger());
}
Aggregations