private void init(Expr pattern, Expr flags) { if ( pattern.isConstant() && pattern.getConstant().isString() && ( flags==null || flags.isConstant() ) ) regexEngine = makeRegexEngine(pattern.getConstant(), (flags==null)?null:flags.getConstant()) ; }
private void init(Expr pattern, Expr flags) { if ( pattern.isConstant() && pattern.getConstant().isString() && ( flags==null || flags.isConstant() ) ) regexEngine = makeRegexEngine(pattern.getConstant(), (flags==null)?null:flags.getConstant()) ; }
public E_StrReplace(Expr expr1, Expr expr2, Expr expr3, Expr expr4) { super(symbol, expr1, expr2, expr3, expr4) ; if ( isString(expr2) && (expr4 == null || isString(expr4) ) ) { int flags = 0 ; if ( expr4 != null && expr4.isConstant() && expr4.getConstant().isString() ) flags = RegexJava.makeMask(expr4.getConstant().getString()) ; pattern = Pattern.compile(expr2.getConstant().getString(), flags) ; } }
private static boolean isString(Expr expr) { return expr.isConstant() && expr.getConstant().isString() ; }
@Override final public Expr copySubstitute(Binding binding, boolean foldConstants) { Expr e1 = (expr1 == null ? null : expr1.copySubstitute(binding, foldConstants)) ; Expr e2 = (expr2 == null ? null : expr2.copySubstitute(binding, foldConstants)) ; if ( foldConstants) { try { if ( e1 != null && e2 != null && e1.isConstant() && e2.isConstant() ) return eval(e1.getConstant(), e2.getConstant()) ; } catch (ExprEvalException ex) { /* Drop through */ } } return copy(e1, e2) ; }
@Override final public Expr copySubstitute(Binding binding, boolean foldConstants) { Expr e1 = (expr1 == null ? null : expr1.copySubstitute(binding, foldConstants)) ; Expr e2 = (expr2 == null ? null : expr2.copySubstitute(binding, foldConstants)) ; Expr e3 = (expr3 == null ? null : expr3.copySubstitute(binding, foldConstants)) ; if ( foldConstants) { try { if ( e1 != null && e2 != null && e3 != null && e1.isConstant() && e2.isConstant() && e3.isConstant() ) return eval(e1.getConstant(), e2.getConstant(), e3.getConstant()) ; } catch (ExprEvalException ex) { /* Drop through */ } } return copy(e1, e2, e3) ; }
@Override final public Expr copySubstitute(Binding binding, boolean foldConstants) { Expr e1 = (expr1 == null ? null : expr1.copySubstitute(binding, foldConstants)) ; Expr e2 = (expr2 == null ? null : expr2.copySubstitute(binding, foldConstants)) ; Expr e3 = (expr3 == null ? null : expr3.copySubstitute(binding, foldConstants)) ; if ( foldConstants) { try { if ( e1 != null && e2 != null && e3 != null && e1.isConstant() && e2.isConstant() && e3.isConstant() ) return eval(e1.getConstant(), e2.getConstant(), e3.getConstant()) ; } catch (ExprEvalException ex) { /* Drop through */ } } return copy(e1, e2, e3) ; }
@Override final public Expr copySubstitute(Binding binding, boolean foldConstants) { Expr e1 = (expr1 == null ? null : expr1.copySubstitute(binding, foldConstants)) ; Expr e2 = (expr2 == null ? null : expr2.copySubstitute(binding, foldConstants)) ; if ( foldConstants) { try { if ( e1 != null && e2 != null && e1.isConstant() && e2.isConstant() ) return eval(e1.getConstant(), e2.getConstant()) ; } catch (ExprEvalException ex) { /* Drop through */ } } return copy(e1, e2) ; }
@Override final public Expr copySubstitute(Binding binding, boolean foldConstants) { Expr e = (expr == null ? null : expr.copySubstitute(binding, foldConstants)) ; if ( foldConstants) { try { if ( e != null && e.isConstant() ) return eval(e.getConstant(), new FunctionEnvBase()) ; } catch (ExprEvalException ex) { /* Drop through */ } } return copy(e) ; }
@Override final public Expr copySubstitute(Binding binding, boolean foldConstants) { Expr e = (expr == null ? null : expr.copySubstitute(binding, foldConstants)) ; if ( foldConstants) { try { if ( e != null && e.isConstant() ) return eval(e.getConstant(), new FunctionEnvBase()) ; } catch (ExprEvalException ex) { /* Drop through */ } } return copy(e) ; }
private static Pair<Var, NodeValue> preprocess(Expr e) { if (!(e instanceof E_NotEquals)) return null; ExprFunction2 eq = (ExprFunction2) e; Expr left = eq.getArg1(); Expr right = eq.getArg2(); Var var = null; NodeValue constant = null; if (left.isVariable() && right.isConstant()) { var = left.asVar(); constant = right.getConstant(); } else if (right.isVariable() && left.isConstant()) { var = right.asVar(); constant = left.getConstant(); } if (var == null || constant == null) return null; // Final check for "!=" where a FILTER != can do value matching when the // graph does not. // Value based? if (!ARQ.isStrictMode() && constant.isLiteral()) return null; return Pair.create(var, constant); }
constant = right.getConstant(); } else if (right.isVariable() && left.isConstant()) { var = right.asVar(); constant = left.getConstant();
constant = right.getConstant() ; constant = left.getConstant() ;
constant = right.getConstant() ; constant = left.getConstant() ;
constant = right.getConstant() ; constant = left.getConstant() ;
SemanticElement.removePrefix(NodeFactory.createURI(expr1.getConstant() .asString())); } else { constant = SemanticElement.removePrefix(NodeFactory.createURI(expr2.getConstant() .asString()));