Search in sources :

Example 36 with Item

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

the class TestResultSetThrift method make.

private static ResultSetRewindable make(String... strings) {
    String s = StrUtils.strjoinNL(strings);
    Item item = SSE.parse(s);
    ResultSetRewindable rs = ResultSetFactory.makeRewindable(BuilderResultSet.build(item));
    return rs;
}
Also used : Item(org.apache.jena.sparql.sse.Item) ResultSetRewindable(org.apache.jena.query.ResultSetRewindable)

Example 37 with Item

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

the class TestSSE_Basic method testNum_03.

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

Example 38 with Item

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

the class TestSSE_Basic method testNum_05.

@Test
public void testNum_05() {
    Item item = SSE.parse("<x>");
    try {
        item.getInt();
        fail("Succeeded where exception expected");
    } catch (ItemException ex) {
    }
}
Also used : Item(org.apache.jena.sparql.sse.Item) ItemException(org.apache.jena.sparql.sse.ItemException) Test(org.junit.Test)

Example 39 with Item

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

the class TestSSE_Basic method parseBad.

private void parseBad(String str) {
    try {
        Item item = SSE.parse(str);
        //System.out.println(str+" => "+item) ;
        fail("Did not get a parse failure");
    } catch (ARQException ex) {
    }
}
Also used : Item(org.apache.jena.sparql.sse.Item) ARQException(org.apache.jena.sparql.ARQException)

Example 40 with Item

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

the class TestSSE_Basic method testSymbol.

private void testSymbol(String str) {
    Item item = parse(str);
    assertTrue(item.isSymbol());
    assertEquals(item.getSymbol(), str);
}
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