use of org.apache.jena.query.Query in project jena by apache.
the class ParserSPARQL11 method parseElement.
public static Element parseElement(String string) {
final Query query = new Query();
Action action = new Action() {
@Override
public void exec(SPARQLParser11 parser) throws Exception {
Element el = parser.GroupGraphPattern();
query.setQueryPattern(el);
}
};
perform(query, string, action);
return query.getQueryPattern();
}
use of org.apache.jena.query.Query in project jena by apache.
the class SPARQLParserBase method endSubSelect.
protected Query endSubSelect(int line, int column) {
Query subQuery = query;
if (!subQuery.isSelectType())
throwParseException("Subquery not a SELECT query", line, column);
popQuery();
return subQuery;
}
use of org.apache.jena.query.Query in project jena by apache.
the class ParserSPARQL10 method parseElement.
public static Element parseElement(String string) {
final Query query = new Query();
Action action = new Action() {
@Override
public void exec(SPARQLParser10 parser) throws Exception {
Element el = parser.GroupGraphPattern();
query.setQueryPattern(el);
}
};
perform(query, string, action);
return query.getQueryPattern();
}
use of org.apache.jena.query.Query in project jena by apache.
the class ParserSPARQL10 method parseTemplate.
public static Template parseTemplate(String string) {
final Query query = new Query();
Action action = new Action() {
@Override
public void exec(SPARQLParser10 parser) throws Exception {
Template t = parser.ConstructTemplate();
query.setConstructTemplate(t);
}
};
perform(query, string, action);
return query.getConstructTemplate();
}
use of org.apache.jena.query.Query in project jena by apache.
the class TestVarRename method checkRename.
private void checkRename(String queryString, String opExpectedString) {
Op opExpected = SSE.parseOp(opExpectedString);
queryString = "PREFIX : <http://example/>\n" + queryString;
Query query = QueryFactory.create(queryString);
Op op = Algebra.compile(query);
Op opRenamed = TransformScopeRename.transform(op);
assertEquals(opExpected, opRenamed);
}
Aggregations