Search in sources :

Example 31 with RDF_Term

use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.

the class TestThriftTerm method term_value_21.

@Test
public void term_value_21() {
    RDF_Term rt = testTermValue("50e-6");
    assertTrue(rt.isSetValDouble());
    assertEquals(50e-6, rt.getValDouble(), 0.001e6);
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 32 with RDF_Term

use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.

the class TestThriftTerm method term_bnode_02.

@Test
public void term_bnode_02() {
    String label = "abcdefghijklmn";
    Node n = NodeFactory.createBlankNode("abcdefghijklmn");
    RDF_Term rt = testTerm(n);
    assertTrue(rt.isSetBnode());
    assertEquals("abcdefghijklmn", rt.getBnode().getLabel());
}
Also used : Node(org.apache.jena.graph.Node) RDF_BNode(org.apache.jena.riot.thrift.wire.RDF_BNode) RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 33 with RDF_Term

use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.

the class TestThriftTerm method term_value_10.

@Test
public void term_value_10() {
    RDF_Term rt = testTermValue("123.6");
    assertTrue(rt.isSetValDecimal());
    assertEquals(1236, rt.getValDecimal().getValue());
    assertEquals(1, rt.getValDecimal().getScale());
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 34 with RDF_Term

use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.

the class TestThriftTerm method term_value_20.

@Test
public void term_value_20() {
    RDF_Term rt = testTermValue("50e6");
    assertTrue(rt.isSetValDouble());
    assertEquals(50e6, rt.getValDouble(), 0.001);
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 35 with RDF_Term

use of org.apache.jena.riot.thrift.wire.RDF_Term in project jena by apache.

the class TestThriftTerm method term_any_1.

@Test
public void term_any_1() {
    RDF_Term rt = testTerm(Node.ANY);
    assertTrue(rt.isSetAny());
}
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