use of org.apache.jena.sparql.core.VarExprList in project jena by apache.
the class BuilderExpr method buildNamedExpr.
public static VarExprList buildNamedExpr(Item item) {
VarExprList varExprList = new VarExprList();
buildNamedExpr(item, varExprList);
return varExprList;
}
use of org.apache.jena.sparql.core.VarExprList in project jena by apache.
the class TestOptimizer method combine_extend_02.
@Test
public void combine_extend_02() {
Op extend = OpExtend.create(OpTable.unit(), new VarExprList(Var.alloc("x"), new NodeValueInteger(1)));
extend = OpExtend.create(extend, new VarExprList(Var.alloc("y"), new ExprVar("x")));
String opExpectedString = StrUtils.strjoinNL("(extend ((?x 1) (?y ?x))", " (table unit))");
check(extend, new TransformExtendCombine(), opExpectedString);
}
use of org.apache.jena.sparql.core.VarExprList in project jena by apache.
the class TestOptimizer method combine_assign_01.
@Test
public void combine_assign_01() {
Op assign = OpAssign.create(OpTable.unit(), new VarExprList(Var.alloc("x"), new NodeValueInteger(1)));
assign = OpAssign.create(assign, new VarExprList(Var.alloc("y"), new NodeValueInteger(2)));
String opExpectedString = StrUtils.strjoinNL("(assign ((?x 1) (?y 2))", " (table unit))");
check(assign, new TransformExtendCombine(), opExpectedString);
}
use of org.apache.jena.sparql.core.VarExprList in project jena by apache.
the class TestOptimizer method combine_extend_03.
@Test
public void combine_extend_03() {
// Technically illegal SPARQL here but useful to validate that the optimizer doesn't do the wrong thing
Op extend = OpExtend.create(OpTable.unit(), new VarExprList(Var.alloc("x"), new NodeValueInteger(1)));
extend = OpExtend.create(extend, new VarExprList(Var.alloc("x"), new NodeValueInteger(2)));
String opExpectedString = StrUtils.strjoinNL("(extend ((?x 2))", " (extend ((?x 1))", " (table unit)))");
check(extend, new TransformExtendCombine(), opExpectedString);
}
use of org.apache.jena.sparql.core.VarExprList in project jena by apache.
the class TestOptimizer method combine_assign_02.
@Test
public void combine_assign_02() {
Op assign = OpAssign.create(OpTable.unit(), new VarExprList(Var.alloc("x"), new NodeValueInteger(1)));
assign = OpAssign.create(assign, new VarExprList(Var.alloc("y"), new ExprVar("x")));
String opExpectedString = StrUtils.strjoinNL("(assign ((?x 1) (?y ?x))", " (table unit))");
check(assign, new TransformExtendCombine(), opExpectedString);
}
Aggregations