Search in sources :

Example 1 with ASTWhere

use of org.eclipse.rdf4j.query.parser.serql.ast.ASTWhere in project rdf4j by eclipse.

the class QueryModelBuilder method visit.

@Override
public Object visit(ASTOptPathExprTail tailNode, Object data) throws VisitorException {
    List<Var> subjVars = (List<Var>) data;
    // Create new sub-graph pattern for optional path expressions
    graphPattern = new GraphPattern(graphPattern);
    // optional path expression tail
    tailNode.getOptionalTail().jjtAccept(this, subjVars);
    ASTWhere whereNode = tailNode.getWhereClause();
    if (whereNode != null) {
        // boolean contraint on optional path expression tail
        whereNode.jjtAccept(this, null);
    }
    graphPattern.getParent().addOptionalTE(graphPattern);
    graphPattern = graphPattern.getParent();
    ASTPathExprTail nextTailNode = tailNode.getNextTail();
    if (nextTailNode != null) {
        // branch after optional path expression tail
        nextTailNode.jjtAccept(this, subjVars);
    }
    return null;
}
Also used : ASTVar(org.eclipse.rdf4j.query.parser.serql.ast.ASTVar) Var(org.eclipse.rdf4j.query.algebra.Var) ASTWhere(org.eclipse.rdf4j.query.parser.serql.ast.ASTWhere) ASTInList(org.eclipse.rdf4j.query.parser.serql.ast.ASTInList) ArrayList(java.util.ArrayList) List(java.util.List) ProjectionElemList(org.eclipse.rdf4j.query.algebra.ProjectionElemList) ASTPathExprTail(org.eclipse.rdf4j.query.parser.serql.ast.ASTPathExprTail)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 ProjectionElemList (org.eclipse.rdf4j.query.algebra.ProjectionElemList)1 Var (org.eclipse.rdf4j.query.algebra.Var)1 ASTInList (org.eclipse.rdf4j.query.parser.serql.ast.ASTInList)1 ASTPathExprTail (org.eclipse.rdf4j.query.parser.serql.ast.ASTPathExprTail)1 ASTVar (org.eclipse.rdf4j.query.parser.serql.ast.ASTVar)1 ASTWhere (org.eclipse.rdf4j.query.parser.serql.ast.ASTWhere)1