Search in sources :

Example 1 with BoundPathElement

use of com.inova8.pathql.element.BoundPathElement in project com.inova8.intelligentgraph by peterjohnlawrence.

the class PathPatternVisitor method visitBoundPattern.

/**
 * Visit bound pattern.
 *
 * @param ctx the ctx
 * @return the path element
 */
@Override
public PathElement visitBoundPattern(PathPatternParser.BoundPatternContext ctx) {
    // boundPattern :  binding ('/'|'>') pathPatterns EOF
    PathElement pathElement = new BoundPathElement(this.repositoryContext);
    pathElement.setLeftPathElement((FactFilterElement) visit(ctx.binding()));
    if (ctx.pathPatterns() != null)
        pathElement.setRightPathElement(visit(ctx.pathPatterns()));
    else
        throw new ScriptFailedException(String.format("Bolund pattern %s must be followed by pathPatterns", ctx.getText()));
    return pathElement;
}
Also used : SequencePathElement(com.inova8.pathql.element.SequencePathElement) BoundPathElement(com.inova8.pathql.element.BoundPathElement) PathElement(com.inova8.pathql.element.PathElement) AlternativePathElement(com.inova8.pathql.element.AlternativePathElement) QueryOptionsPathElement(com.inova8.pathql.element.QueryOptionsPathElement) ScriptFailedException(com.inova8.intelligentgraph.exceptions.ScriptFailedException) BoundPathElement(com.inova8.pathql.element.BoundPathElement)

Aggregations

ScriptFailedException (com.inova8.intelligentgraph.exceptions.ScriptFailedException)1 AlternativePathElement (com.inova8.pathql.element.AlternativePathElement)1 BoundPathElement (com.inova8.pathql.element.BoundPathElement)1 PathElement (com.inova8.pathql.element.PathElement)1 QueryOptionsPathElement (com.inova8.pathql.element.QueryOptionsPathElement)1 SequencePathElement (com.inova8.pathql.element.SequencePathElement)1