use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class ResultSetFactory method fromSSE.
/**
* Read from an input stream which is the format of the SPARQL result set
* format in SSE.
*
* @param in
* InputStream
* @return ResultSet
*/
public static ResultSet fromSSE(InputStream in) {
Item item = SSE.parse(in);
Log.warn(ResultSet.class, "Reading SSE result set not full implemented");
// See SPARQLResult. Have a level of ResultSetFactory that does
// "get SPARQLResult".
// Or just boolean/result set because those are both srx. etc.
BuilderTable.build(item);
return null;
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestPath method parse.
private void parse(String string, boolean expectLegal) {
Prologue prologue = new Prologue(pmap);
Path p = null;
try {
p = PathParser.parse(string, prologue);
// System.out.println(PathWriterSSE.asString(p, new Prologue(pmap))) ;
if (!expectLegal)
fail("Expected error; " + string);
} catch (QueryParseException ex) {
if (expectLegal)
fail("Expected success: " + string + ": " + ex.getMessage());
return;
}
String x = p.toString(prologue);
Path p2 = PathParser.parse(x, prologue);
assertEquals(p, p2);
String sse = WriterPath.asString(p, prologue);
Item item = SSE.parseItem(sse, pmap);
p2 = BuilderPath.buildPath(item);
assertEquals(p, p2);
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestSolverLib method matcher.
// private static StatsMatcher matcher(String str)
// {
// String s1 = "(prefix ((: <http://example/>))\n(stats " ;
// String s2 = "))" ;
// Item item = SSE.parse(s1+str+s2) ;
// return new StatsMatcher(item) ;
// }
//
public static StatsMatcher matcher(String... str) {
String s1 = "(prefix ((: <http://example/>))\n(stats ";
String s2 = "))";
String x = StrUtils.strjoinNL(str);
Item item = SSE.parse(s1 + x + s2);
return new StatsMatcher(item);
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestSSE_Basic method testNum_01.
@Test
public void testNum_01() {
Item item = SSE.parse("1");
assertEquals(1, item.getInt());
}
use of org.apache.jena.sparql.sse.Item in project jena by apache.
the class TestSSE_Basic method testTaggedList_1.
@Test
public void testTaggedList_1() {
Item x = Item.createTagged("TAG");
assertTrue(x.isTagged());
assertTrue(x.isTagged("TAG"));
}
Aggregations