public static BinaryRelation createRelation(Expr expr, boolean isInverse) { BinaryRelation result = new BinaryRelationImpl(new ElementFilter(expr), Vars.p, Vars.o); return result; }
@Override public Element transform(ElementFilter el, Expr expr2) { if ( el.getExpr() == expr2 ) return el ; return new ElementFilter(expr2) ; }
public static BinaryRelation asRelation(Expr expr) { ElementFilter e = new ElementFilter(expr); BinaryRelation result = new BinaryRelationImpl(e, Vars.p, Vars.o); return result; }
public ResourceShapeBuilder nav(Expr expr, boolean isInverse) { BinaryRelation relation = new BinaryRelationImpl(new ElementFilter(expr), Vars.p, Vars.o); ResourceShapeBuilder result = nav(relation, isInverse); return result; }
/** * add an expression as a filter. * * @param expr * The expression to add. */ public void addFilter(Expr expr) { getClause().addElement(new ElementFilter(expr)); }
/** * add an expression as a filter. * * @param expr * The expression to add. */ public void addFilter(Expr expr) { getClause().addElement(new ElementFilter(expr)); }
final public Element Filter() throws ParseException { Expr c ; jj_consume_token(FILTER); c = Constraint(); {if (true) return new ElementFilter(c) ;} throw new Error("Missing return statement in function"); }
final public Element Filter() throws ParseException { Expr c ; jj_consume_token(FILTER); c = Constraint(); {if (true) return new ElementFilter(c) ;} throw new Error("Missing return statement in function"); }
final public Element Filter() throws ParseException { Expr c ; jj_consume_token(FILTER); c = Constraint(); {if (true) return new ElementFilter(c) ;} throw new Error("Missing return statement in function"); }
/** * add an expression as a filter. * * @param expr * The expression to add. */ public void addFilter(Expr expr) { getClause().addElement(new ElementFilter(expr)); }
/** * add an expression as a filter. * * @param expr * The expression to add. */ public void addFilter(Expr expr) { getClause().addElement(new ElementFilter(expr)); }
/** * Add an expression string as a filter. * * @param expression * The expression string to add. * @throws ParseException * If the expression can not be parsed. */ public void addFilter(String expression) throws ParseException { getClause().addElement(new ElementFilter(ExprUtils.parse(query, expression, true))); }
/** * Add an expression string as a filter. * * @param expression * The expression string to add. * @throws ParseException * If the expression can not be parsed. */ public void addFilter(String expression) throws ParseException { getClause().addElement(new ElementFilter(parseExpr(expression))); }
/** * Add an expression string as a filter. * * @param expression * The expression string to add. * @throws ParseException * If the expression can not be parsed. */ public void addFilter(String expression) throws ParseException { getClause().addElement(new ElementFilter(parseExpr(expression))); }
/** * Add an expression string as a filter. * * @param expression * The expression string to add. * @throws ParseException * If the expression can not be parsed. */ public void addFilter(String expression) throws ParseException { getClause().addElement(new ElementFilter(ExprUtils.parse(query, expression, true))); }
@Override public void visit(ElementFilter el) { ExprRewriter exprRewriter = new ExprRewriter(values); el.getExpr().visit(exprRewriter); push(new ElementFilter(exprRewriter.getResult())); }
@Override public void visit(ElementFilter el) { ExprRewriter exprRewriter = new ExprRewriter(values); el.getExpr().visit(exprRewriter); push(new ElementFilter(exprRewriter.getResult())); }
@Override public Concept visit(OpFilter op) { Expr expr = op.getExpr(); Concept concept = op.getSubOp().accept(this); Var conceptVar = concept.getVar(); Map<Var, Var> varMap = Collections.singletonMap(Vars.lodash, conceptVar); Expr newExpr = ExprUtils.applyNodeTransform(expr, varMap); Element newElement = ElementUtils.mergeElements(concept.getElement(), new ElementFilter(newExpr)); Concept result = new Concept(newElement, conceptVar); return result; }
public static Concept createRelatedConcept(Collection<Node> nodes, BinaryRelation relation) { Var sourceVar = relation.getSourceVar(); Var targetVar = relation.getTargetVar(); Element relationEl = relation.getElement(); ExprVar ev = new ExprVar(sourceVar); ExprList el = ExprListUtils.nodesToExprs(nodes); ElementFilter filterEl = new ElementFilter(new E_OneOf(ev, el)); Element resultEl = ElementUtils.mergeElements(relationEl, filterEl); Concept result = new Concept(resultEl, targetVar); return result; }
@Override public void visit(OpFilter opFilter) { // (filter .. (filter ( ... )) (non-canonicalizing OpFilters) // Inner gets Grouped unnecessarily. Element e = asElement(opFilter.getSubOp()) ; if ( currentGroup() != e ) currentGroup().addElement(e) ; element = currentGroup() ; // Was cleared by asElement. ExprList exprs = opFilter.getExprs() ; for ( Expr expr : exprs ) { ElementFilter f = new ElementFilter(expr) ; currentGroup().addElement(f) ; } }