Search in sources :

Example 21 with RDF_Term

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);
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) Node(org.apache.jena.graph.Node) RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term)

Example 22 with RDF_Term

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);
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term)

Example 23 with RDF_Term

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());
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 24 with RDF_Term

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());
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 25 with RDF_Term

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());
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Aggregations

RDF_Term (org.apache.jena.riot.thrift.wire.RDF_Term)38 Test (org.junit.Test)25 Node (org.apache.jena.graph.Node)12 RDF_BNode (org.apache.jena.riot.thrift.wire.RDF_BNode)6 TProtocol (org.apache.thrift.protocol.TProtocol)6 TException (org.apache.thrift.TException)4 RiotThriftException (org.apache.jena.riot.thrift.RiotThriftException)2 Var (org.apache.jena.sparql.core.Var)2 TDBException (org.apache.jena.tdb2.TDBException)2 TransactionException (org.apache.jena.dboe.transaction.txn.TransactionException)1 RDF_IRI (org.apache.jena.riot.thrift.wire.RDF_IRI)1 RDF_Literal (org.apache.jena.riot.thrift.wire.RDF_Literal)1 NodeId (org.apache.jena.tdb2.store.NodeId)1 TTransportException (org.apache.thrift.transport.TTransportException)1