Java Code Examples for org.apache.jena.sparql.syntax.ElementSubQuery#getQuery()

The following examples show how to use org.apache.jena.sparql.syntax.ElementSubQuery#getQuery() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SPARQLExtFormatterElement.java    From sparql-generate with Apache License 2.0 5 votes vote down vote up
@Override
public void visit(ElementSubQuery el) {
    out.print("{ ");
    out.incIndent(INDENT);
    Query q = el.getQuery();

    // Serialize with respect to the existing context
    QuerySerializerFactory factory = SerializerRegistry.get().getQuerySerializerFactory(SPARQLExt.SYNTAX);
    QueryVisitor serializer = factory.create(SPARQLExt.SYNTAX, context, out);
    q.visit(serializer);

    out.decIndent(INDENT);
    out.print("}");
}
 
Example 2
Source File: QueryPatternSimplification.java    From quetzal with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void visit(ElementSubQuery e) {
	Query sq = e.getQuery();
	QueryPatternSimplification qps = new QueryPatternSimplification();
	sq.getQueryPattern().visit(qps);
	Element newelt = qps.getResult();
	Query newsq = sq.cloneQuery();
	newsq.setQueryPattern(newelt);
	result = new ElementSubQuery(newsq);
}
 
Example 3
Source File: RuleSystemToUnionQuery.java    From quetzal with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void visit(ElementSubQuery e) {
	Query sq = e.getQuery();
	VariableSubstitutionElementVisitor qps = new VariableSubstitutionElementVisitor(oldVar2NewValue);
	sq.getQueryPattern().visit(qps);
	Element newelt = qps.getResult();
	Query newsq = sq.cloneQuery();
	newsq.setQueryPattern(newelt);
	result = new ElementSubQuery(newsq);
}
 
Example 4
Source File: QueryPatternNormalizer.java    From sparql-generate with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(ElementSubQuery el) {
    SPARQLExtQuery query = (SPARQLExtQuery) el.getQuery();
    query.normalizeXExpr();
    result = new ElementSubQuery(query);
}