use of org.apache.jena.sdb.exprmatch.ActionMatchString in project jena by apache.
the class StringEqualsSqlGen method recognize.
// private static ExprPattern equalsString3 = new ExprPattern("str(?a1) = ?a2",
// new Var[]{ Var.alloc("a1") , Var.alloc("a2") },
// new Action[]{ new ActionMatchVar() ,
// new ActionMatchString()}) ;
//// As equalsString3 but reverse the arguments.
// private static ExprPattern equalsString4 = new ExprPattern("?a1 = str(?a2)",
// new Var[]{ Var.alloc("a1") , Var.alloc("a2") },
// new Action[]{ new ActionMatchString() ,
// new ActionMatchVar() }) ;
@Override
public SDBConstraint recognize(Expr expr) {
MapResult rMap = null;
if ((rMap = equalsString1.match(expr)) != null) {
Var var = rMap.get("a1").getExprVar().asVar();
String str = rMap.get("a2").getConstant().getString();
return new StringEqualsSqlGen(expr, equalsString1, true);
}
return null;
}
Aggregations