Search in sources :

Example 56 with Item

use of org.apache.jena.sparql.sse.Item in project jena by apache.

the class TestSSE_Forms method testForm_01.

// ---- Form
@Test
public void testForm_01() {
    // Special form of nothing.
    Item item = SSE.parse("(prefix ((ex: <http://example/>)))");
    assertNull(item);
}
Also used : Item(org.apache.jena.sparql.sse.Item) Test(org.junit.Test)

Example 57 with Item

use of org.apache.jena.sparql.sse.Item in project jena by apache.

the class TestSSE_Basic method testTaggedList_2.

@Test
public void testTaggedList_2() {
    Item x = Item.createTagged("TAG");
    Item.addPair(x.getList(), "KEY", "VALUE");
    Item y = Item.find(x.getList(), "KEY");
    assertNotNull(y);
    Item z = Item.find(x.getList(), "KEYKEY");
    assertNull(z);
}
Also used : Item(org.apache.jena.sparql.sse.Item) Test(org.junit.Test)

Example 58 with Item

use of org.apache.jena.sparql.sse.Item in project jena by apache.

the class TestSSE_Builder method testBuildInt_01.

@Test
public void testBuildInt_01() {
    Item item = SSE.parseItem("1");
    int i = BuilderNode.buildInt(item);
    assertEquals(1, i);
}
Also used : Item(org.apache.jena.sparql.sse.Item) Test(org.junit.Test)

Example 59 with Item

use of org.apache.jena.sparql.sse.Item in project jena by apache.

the class TestSSE_Basic method testNum_02.

@Test
public void testNum_02() {
    Item item = SSE.parse("3");
    assertEquals(3d, item.getDouble(), 0);
}
Also used : Item(org.apache.jena.sparql.sse.Item) Test(org.junit.Test)

Example 60 with Item

use of org.apache.jena.sparql.sse.Item in project jena by apache.

the class TestSSE_Basic method testEquals.

// ---- Workers ----
private void testEquals(String x) {
    Item item1 = parse(x);
    Item item2 = parse(x);
    assertTrue(item1.equals(item2));
    assertTrue(item2.equals(item1));
}
Also used : Item(org.apache.jena.sparql.sse.Item)

Aggregations

Item (org.apache.jena.sparql.sse.Item)78 Test (org.junit.Test)31 Node (org.apache.jena.graph.Node)11 ItemList (org.apache.jena.sparql.sse.ItemList)10 Var (org.apache.jena.sparql.core.Var)6 ArrayList (java.util.ArrayList)5 Binding (org.apache.jena.sparql.engine.binding.Binding)3 Graph (org.apache.jena.graph.Graph)2 Triple (org.apache.jena.graph.Triple)2 ARQException (org.apache.jena.sparql.ARQException)2 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)2 VarExprList (org.apache.jena.sparql.core.VarExprList)2 ItemException (org.apache.jena.sparql.sse.ItemException)2 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)1 RDFDatatype (org.apache.jena.datatypes.RDFDatatype)1 QueryParseException (org.apache.jena.query.QueryParseException)1 ResultSetRewindable (org.apache.jena.query.ResultSetRewindable)1 Model (org.apache.jena.rdf.model.Model)1 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)1 Table (org.apache.jena.sparql.algebra.Table)1