use of org.apache.jena.sparql.expr.E_Function in project jena by apache.
the class ExprFactoryTest method functionTest.
@Test
public void functionTest() {
Expr e = factory.function("name", factory.list());
assertTrue(e instanceof E_Function);
}
use of org.apache.jena.sparql.expr.E_Function in project jena by apache.
the class AggCustom method equals.
@Override
public boolean equals(Aggregator other, boolean bySyntax) {
if (other == null)
return false;
if (this == other)
return true;
if (!AggregateRegistry.isRegistered(iri)) {
E_Function f1 = asFunction();
if (!(other instanceof AggCustom))
return false;
E_Function f2 = ((AggCustom) other).asFunction();
return f1.equals(f2, bySyntax);
}
if (!(other instanceof AggCustom))
return false;
AggCustom agg = (AggCustom) other;
return Objects.equals(this.iri, agg.iri) && this.isDistinct == agg.isDistinct && this.getExprList().equals(agg.getExprList(), bySyntax);
}
use of org.apache.jena.sparql.expr.E_Function 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);
}
Aggregations