Search in sources :

Example 11 with RDF_Term

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

the class TestThriftTerm method rdfterm_01.

@Test
public void rdfterm_01() {
    RDF_Term rt = TRDF.tANY;
    Node n = ThriftConvert.convert(rt);
    assertEquals(Node.ANY, n);
}
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 12 with RDF_Term

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

the class TestThriftTerm method term_value_01.

@Test
public void term_value_01() {
    RDF_Term rt = testTermValue("123");
    assertTrue(rt.isSetValInteger());
    assertEquals(123, rt.getValInteger());
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 13 with RDF_Term

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

the class TestThriftTerm method term_bnode_01.

@Test
public void term_bnode_01() {
    Node n = SSE.parseNode("_:blanknode");
    RDF_Term rt = testTerm(n);
    assertEquals(rt.getBnode().getLabel(), n.getBlankNodeLabel());
}
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 14 with RDF_Term

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

the class TestThriftTerm method term_value_02.

@Test
public void term_value_02() {
    RDF_Term rt = testTermValue("'123'^^xsd:integer");
    assertTrue(rt.isSetValInteger());
    assertEquals(123, rt.getValInteger());
}
Also used : RDF_Term(org.apache.jena.riot.thrift.wire.RDF_Term) Test(org.junit.Test)

Example 15 with RDF_Term

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

the class TestThriftTerm method term_value_12.

@Test
public void term_value_12() {
    RDF_Term rt = testTermValue("50.0");
    assertTrue(rt.isSetValDecimal());
    assertEquals(500, rt.getValDecimal().getValue());
    assertEquals(1, rt.getValDecimal().getScale());
}
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