Search in sources :

Example 86 with Expr

use of org.apache.jena.sparql.expr.Expr in project jena by apache.

the class ExprFactoryTest method callTest_dynamic.

@Test
public void callTest_dynamic() {
    Expr e = factory.call(factory.none(), factory.list());
    assertTrue(e instanceof E_FunctionDynamic);
}
Also used : Expr(org.apache.jena.sparql.expr.Expr) E_FunctionDynamic(org.apache.jena.sparql.expr.E_FunctionDynamic) Test(org.junit.Test)

Example 87 with Expr

use of org.apache.jena.sparql.expr.Expr in project jena by apache.

the class ExprFactoryTest method langMatchesTest.

@Test
public void langMatchesTest() {
    Expr e = factory.langMatches(factory.none(), factory.none());
    assertTrue(e instanceof E_LangMatches);
}
Also used : Expr(org.apache.jena.sparql.expr.Expr) E_LangMatches(org.apache.jena.sparql.expr.E_LangMatches) Test(org.junit.Test)

Example 88 with Expr

use of org.apache.jena.sparql.expr.Expr in project jena by apache.

the class ExprFactoryTest method coalesceTest.

@Test
public void coalesceTest() {
    Expr e = factory.coalesce(factory.list());
    assertTrue(e instanceof E_Coalesce);
}
Also used : Expr(org.apache.jena.sparql.expr.Expr) E_Coalesce(org.apache.jena.sparql.expr.E_Coalesce) Test(org.junit.Test)

Example 89 with Expr

use of org.apache.jena.sparql.expr.Expr in project jena by apache.

the class QueryTransformOps method transformExprList.

// ** Mutates the List
private static void transformExprList(List<Expr> exprList, ExprTransform exprTransform) {
    for (int i = 0; i < exprList.size(); i++) {
        Expr e1 = exprList.get(0);
        Expr e2 = ExprTransformer.transform(exprTransform, e1);
        if (e2 == null || e2 == e1)
            continue;
        exprList.set(i, e2);
    }
}
Also used : Expr(org.apache.jena.sparql.expr.Expr)

Example 90 with Expr

use of org.apache.jena.sparql.expr.Expr in project jena by apache.

the class QueryTransformOps method transformSortConditions.

private static void transformSortConditions(List<SortCondition> conditions, ExprTransform exprTransform) {
    for (int i = 0; i < conditions.size(); i++) {
        SortCondition s1 = conditions.get(i);
        Expr e = ExprTransformer.transform(exprTransform, s1.expression);
        if (e == null || s1.expression.equals(e))
            continue;
        conditions.set(i, new SortCondition(e, s1.direction));
    }
}
Also used : SortCondition(org.apache.jena.query.SortCondition) Expr(org.apache.jena.sparql.expr.Expr)

Aggregations

Expr (org.apache.jena.sparql.expr.Expr)187 Test (org.junit.Test)102 ExprVar (org.apache.jena.sparql.expr.ExprVar)34 Var (org.apache.jena.sparql.core.Var)30 ExprList (org.apache.jena.sparql.expr.ExprList)16 Op (org.apache.jena.sparql.algebra.Op)15 NodeValue (org.apache.jena.sparql.expr.NodeValue)12 ContractTest (org.xenei.junit.contract.ContractTest)11 Query (org.apache.jena.query.Query)10 Node (org.apache.jena.graph.Node)9 E_Random (org.apache.jena.sparql.expr.E_Random)9 ArrayList (java.util.ArrayList)8 VarExprList (org.apache.jena.sparql.core.VarExprList)8 Triple (org.apache.jena.graph.Triple)6 SortCondition (org.apache.jena.query.SortCondition)6 E_Regex (org.apache.jena.sparql.expr.E_Regex)6 E_LessThan (org.apache.jena.sparql.expr.E_LessThan)5 LibTestExpr (org.apache.jena.sparql.expr.LibTestExpr)5 OpBGP (org.apache.jena.sparql.algebra.op.OpBGP)4 BasicPattern (org.apache.jena.sparql.core.BasicPattern)4