Search in sources :

Example 1 with ASTPathExpr

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

the class QueryModelBuilder method visit.

@Override
public Object visit(ASTPathExprUnion node, Object data) throws VisitorException {
    Iterator<ASTPathExpr> args = node.getPathExprList().iterator();
    // Create new sub-graph pattern for optional path expressions
    TupleExpr unionExpr = parseGraphPattern(args.next()).buildTupleExpr();
    while (args.hasNext()) {
        TupleExpr argExpr = parseGraphPattern(args.next()).buildTupleExpr();
        unionExpr = new Union(unionExpr, argExpr);
    }
    graphPattern.addRequiredTE(unionExpr);
    return null;
}
Also used : ASTPathExpr(org.eclipse.rdf4j.query.parser.serql.ast.ASTPathExpr) TupleExpr(org.eclipse.rdf4j.query.algebra.TupleExpr) ASTGraphUnion(org.eclipse.rdf4j.query.parser.serql.ast.ASTGraphUnion) Union(org.eclipse.rdf4j.query.algebra.Union) ASTPathExprUnion(org.eclipse.rdf4j.query.parser.serql.ast.ASTPathExprUnion) ASTTupleUnion(org.eclipse.rdf4j.query.parser.serql.ast.ASTTupleUnion)

Aggregations

TupleExpr (org.eclipse.rdf4j.query.algebra.TupleExpr)1 Union (org.eclipse.rdf4j.query.algebra.Union)1 ASTGraphUnion (org.eclipse.rdf4j.query.parser.serql.ast.ASTGraphUnion)1 ASTPathExpr (org.eclipse.rdf4j.query.parser.serql.ast.ASTPathExpr)1 ASTPathExprUnion (org.eclipse.rdf4j.query.parser.serql.ast.ASTPathExprUnion)1 ASTTupleUnion (org.eclipse.rdf4j.query.parser.serql.ast.ASTTupleUnion)1