Search in sources :

Example 1 with E_Equals

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

the class ExprFactoryTest method eqTest.

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

Example 2 with E_Equals

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

the class WhereHandlerTest method testAddFilterWithNamespace.

@Test
public void testAddFilterWithNamespace() throws ParseException {
    query.setPrefix("afn", "http://jena.apache.org/ARQ/function#");
    handler.addFilter("afn:namespace(?one) = 'foo'");
    handler.build();
    ExprFactory fact = new ExprFactory();
    E_Function func = new E_Function("http://jena.apache.org/ARQ/function#namespace", fact.asList("?one"));
    E_Equals expr = fact.eq(func, "foo");
    WhereValidator visitor = new WhereValidator(new ElementFilter(expr));
    handler.getQueryPattern().visit(visitor);
    assertTrue(visitor.matching);
}
Also used : WhereValidator(org.apache.jena.arq.querybuilder.WhereValidator) E_Equals(org.apache.jena.sparql.expr.E_Equals) ElementFilter(org.apache.jena.sparql.syntax.ElementFilter) E_Function(org.apache.jena.sparql.expr.E_Function) ExprFactory(org.apache.jena.arq.querybuilder.ExprFactory) Test(org.junit.Test)

Aggregations

E_Equals (org.apache.jena.sparql.expr.E_Equals)2 Test (org.junit.Test)2 ExprFactory (org.apache.jena.arq.querybuilder.ExprFactory)1 WhereValidator (org.apache.jena.arq.querybuilder.WhereValidator)1 E_Function (org.apache.jena.sparql.expr.E_Function)1 Expr (org.apache.jena.sparql.expr.Expr)1 ElementFilter (org.apache.jena.sparql.syntax.ElementFilter)1