org.apache.jena.sparql.syntax.ElementSubQuery Java Examples

The following examples show how to use org.apache.jena.sparql.syntax.ElementSubQuery. 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: SPARQLExtFormatterElement.java    From sparql-generate with Apache License 2.0 5 votes vote down vote up
public void visitAsGroup(Element el) {
    boolean needBraces = !((el instanceof ElementGroup) || (el instanceof ElementSubQuery));

    if (needBraces) {
        out.print("{ ");
        out.incIndent(INDENT);
    }

    el.visit(this);

    if (needBraces) {
        out.decIndent(INDENT);
        out.print("}");
    }
}
 
Example #3
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 #4
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 #5
Source File: OutputClauseNormalizer.java    From sparql-generate with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(ElementSubQuery el) {
    LOG.warn("Should not reach this point");
}
 
Example #6
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);
}
 
Example #7
Source File: OutputClauseNormalizer.java    From sparql-generate with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(ElementSubQuery el) {
    LOG.warn("Should not reach this point");
}
 
Example #8
Source File: SPARQLExtElementVisitorBase.java    From sparql-generate with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(ElementSubQuery el) {
}
 
Example #9
Source File: OWLQLSPARQLCompiler.java    From quetzal with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(ElementSubQuery el) {
	 proc.visit(el) ;
}
 
Example #10
Source File: FindAllVariables.java    From quetzal with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(ElementSubQuery e) {
	vars.addAll(PatternVars.vars(e));
	e.getQuery().getQueryPattern().visit(this);
	
}