use of org.apache.jena.sparql.expr.Expr in project jena by apache.
the class VarExprList method addAll.
public void addAll(VarExprList other) {
for (Var v : other.vars) {
Expr e = other.getExpr(v);
add(v, e);
}
}
use of org.apache.jena.sparql.expr.Expr in project jena by apache.
the class TestVarRename method renameExpr.
private void renameExpr(String inputStr, String expectedStr, String... varNames) {
Set<Var> s = set(varNames);
Expr exOrig = SSE.parseExpr(inputStr);
Expr exExpected = SSE.parseExpr(expectedStr);
Expr exprActual = Rename.renameVars(exOrig, s);
if (DEV && !exExpected.equals(exprActual)) {
System.err.println("**** Test: " + name.getMethodName());
System.err.println("::Expected::");
System.err.println(exExpected);
System.err.println("::Got::");
System.err.println(exprActual);
}
assertEquals(exExpected, exprActual);
}
use of org.apache.jena.sparql.expr.Expr in project jena by apache.
the class TestSSE_Builder method testBuildExpr_01.
@Test
public void testBuildExpr_01() {
Expr e = SSE.parseExpr("(sameTerm (?x) (?y))");
assertTrue(e instanceof E_SameTerm);
}
use of org.apache.jena.sparql.expr.Expr in project jena by apache.
the class BuilderOp method scBuilder.
SortCondition scBuilder(Item item) {
int direction = Query.ORDER_DEFAULT;
if (item.isTagged("asc") || item.isTagged("desc")) {
BuilderLib.checkList(item);
BuilderLib.checkLength(2, item.getList(), "Direction corrupt");
if (item.isTagged("asc"))
direction = Query.ORDER_ASCENDING;
else
direction = Query.ORDER_DESCENDING;
item = item.getList().get(1);
}
Expr expr = BuilderExpr.buildExpr(item);
if (expr.isVariable())
return new SortCondition(expr.getExprVar().asVar(), direction);
else
return new SortCondition(expr, direction);
}
use of org.apache.jena.sparql.expr.Expr in project jena by apache.
the class ApplyElementTransformVisitor method visit.
@Override
public void visit(ElementBind el) {
Var v = el.getVar();
Var v1 = TransformElementLib.applyVar(v, exprTransform);
Expr expr = el.getExpr();
Expr expr1 = ExprTransformer.transform(exprTransform, expr);
Element el2 = transform.transform(el, v1, expr1);
push(el2);
}
Aggregations