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 ;
if ( !patternVars.contains(var) )
return null ;
// Corner case: sameTerm is false for string/plain literal,
// but true in the graph for graph matching.
if (e instanceof E_SameTerm)
{
if ( ! ARQ.isStrictMode() && constant.isString() )
return null ;
}
// Final check for "=" where a FILTER = can do value matching when the graph does not.
if ( e instanceof E_Equals )
{
// Value based?
// XXX Optimize here.
if ( ! ARQ.isStrictMode() && constant.isLiteral() )
return null ;
}
return subst(subOp, var, constant) ;
}