@Test public void testOptimize() throws Exception { QueryOptimizer optimizer1 = mock(QueryOptimizer.class); QueryOptimizer optimizer2 = mock(QueryOptimizer.class); strategy.setOptimizerPipeline(new QueryOptimizerPipeline() { @Override public Iterable<QueryOptimizer> getOptimizers() { return Arrays.asList(optimizer1, optimizer2); } }); TupleExpr expr = mock(TupleExpr.class); EvaluationStatistics stats = new EvaluationStatistics(); BindingSet bindings = new QueryBindingSet(); strategy.optimize(expr, stats, bindings); verify(optimizer1, times(1)).optimize(expr, null, bindings); verify(optimizer2, times(1)).optimize(expr, null, bindings); }
@Override public TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings) { TupleExpr optimizedExpr = expr; for (QueryOptimizer optimizer : pipeline.getOptimizers()) { optimizer.optimize(optimizedExpr, dataset, bindings); } return optimizedExpr; }
StrictEvaluationStrategy implements EvaluationStrategy, FederatedServiceResolverClient, UUIDable { @Override public TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings) { TupleExpr optimizedExpr = expr; for (QueryOptimizer optimizer : pipeline.getOptimizers()) { optimizer.optimize(optimizedExpr, dataset, bindings); } return optimizedExpr; } }
StrictEvaluationStrategy implements EvaluationStrategy, FederatedServiceResolverClient, UUIDable { @Override public TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings) { TupleExpr optimizedExpr = expr; for (QueryOptimizer optimizer : pipeline.getOptimizers()) { optimizer.optimize(optimizedExpr, dataset, bindings); } return optimizedExpr; } StrictEvaluationStrategy(TripleSource tripleSource, FederatedServiceResolver serviceResolver);  StrictEvaluationStrategy(TripleSource tripleSource, Dataset dataset,
			FederatedServiceResolver serviceResolver);  StrictEvaluationStrategy(TripleSource tripleSource, Dataset dataset,
			FederatedServiceResolver serviceResolver, long iterationCacheSyncTreshold,
			EvaluationStatistics evaluationStatistics); }
StrictEvaluationStrategy implements EvaluationStrategy, FederatedServiceResolverClient, UUIDable { @Override public TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings) { TupleExpr optimizedExpr = expr; for (QueryOptimizer optimizer : pipeline.getOptimizers()) { optimizer.optimize(optimizedExpr, dataset, bindings); } return optimizedExpr; } StrictEvaluationStrategy(TripleSource tripleSource, FederatedServiceResolver serviceResolver);  StrictEvaluationStrategy(TripleSource tripleSource, Dataset dataset,
			FederatedServiceResolver serviceResolver);  StrictEvaluationStrategy(TripleSource tripleSource, Dataset dataset,
			FederatedServiceResolver serviceResolver, long iterationCacheSyncTreshold,
			EvaluationStatistics evaluationStatistics); @Override UUID getUUID(); @Override void setFederatedServiceResolver(FederatedServiceResolver resolver); @Override FederatedService getService(String serviceUrl); @Override void setOptimizerPipeline(QueryOptimizerPipeline pipeline); @Override TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(TupleExpr expr, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(ArbitraryLengthPath alp,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(ZeroLengthPath zlp,
			final BindingSet bindings); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Service service, String serviceUri,
			CloseableIteration<BindingSet, QueryEvaluationException> bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Service service, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(DescribeOperator operator,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(StatementPattern sp,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(UnaryTupleOperator expr,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(BindingSetAssignment bsa,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Projection projection, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(MultiProjection multiProjection,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Filter filter, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Slice slice, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Extension extension, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Distinct distinct, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Reduced reduced, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Group node, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Order node, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(BinaryTupleOperator expr,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Join join, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(LeftJoin leftJoin,
			final BindingSet bindings); @SuppressWarnings("unchecked") CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Union union,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Intersection intersection,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Difference difference,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(SingletonSet singletonSet,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(EmptySet emptySet, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(ExternalSet external, BindingSet bindings); @Override Value evaluate(ValueExpr expr, BindingSet bindings); Value evaluate(Var var, BindingSet bindings); Value evaluate(ValueConstant valueConstant, BindingSet bindings); Value evaluate(BNodeGenerator node, BindingSet bindings); Value evaluate(Bound node, BindingSet bindings); Value evaluate(Str node, BindingSet bindings); Value evaluate(Label node, BindingSet bindings); Value evaluate(Lang node, BindingSet bindings); Value evaluate(Datatype node, BindingSet bindings); Value evaluate(Namespace node, BindingSet bindings); Value evaluate(LocalName node, BindingSet bindings); Value evaluate(IsResource node, BindingSet bindings); Value evaluate(IsURI node, BindingSet bindings); Value evaluate(IsBNode node, BindingSet bindings); Value evaluate(IsLiteral node, BindingSet bindings); Value evaluate(IsNumeric node, BindingSet bindings); IRI evaluate(IRIFunction node, BindingSet bindings); Value evaluate(Regex node, BindingSet bindings); Value evaluate(LangMatches node, BindingSet bindings); Value evaluate(Like node, BindingSet bindings); Value evaluate(FunctionCall node, BindingSet bindings); Value evaluate(And node, BindingSet bindings); Value evaluate(Or node, BindingSet bindings); Value evaluate(Not node, BindingSet bindings); Value evaluate(Now node, BindingSet bindings); Value evaluate(SameTerm node, BindingSet bindings); Value evaluate(Coalesce node, BindingSet bindings); Value evaluate(Compare node, BindingSet bindings); Value evaluate(MathExpr node, BindingSet bindings); Value evaluate(If node, BindingSet bindings); Value evaluate(In node, BindingSet bindings); Value evaluate(ListMemberOperator node, BindingSet bindings); Value evaluate(CompareAny node, BindingSet bindings); Value evaluate(CompareAll node, BindingSet bindings); Value evaluate(Exists node, BindingSet bindings); @Override boolean isTrue(ValueExpr expr, BindingSet bindings); }
StrictEvaluationStrategy implements EvaluationStrategy, FederatedServiceResolverClient, UUIDable { @Override public TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings) { TupleExpr optimizedExpr = expr; for (QueryOptimizer optimizer : pipeline.getOptimizers()) { optimizer.optimize(optimizedExpr, dataset, bindings); } return optimizedExpr; } StrictEvaluationStrategy(TripleSource tripleSource, FederatedServiceResolver serviceResolver);  StrictEvaluationStrategy(TripleSource tripleSource, Dataset dataset,
			FederatedServiceResolver serviceResolver);  StrictEvaluationStrategy(TripleSource tripleSource, Dataset dataset,
			FederatedServiceResolver serviceResolver, long iterationCacheSyncTreshold,
			EvaluationStatistics evaluationStatistics); @Override UUID getUUID(); @Override void setFederatedServiceResolver(FederatedServiceResolver resolver); @Override FederatedService getService(String serviceUrl); @Override void setOptimizerPipeline(QueryOptimizerPipeline pipeline); @Override TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(TupleExpr expr, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(ArbitraryLengthPath alp,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(ZeroLengthPath zlp,
			final BindingSet bindings); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Service service, String serviceUri,
			CloseableIteration<BindingSet, QueryEvaluationException> bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Service service, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(DescribeOperator operator,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(StatementPattern sp,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(UnaryTupleOperator expr,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(BindingSetAssignment bsa,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Projection projection, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(MultiProjection multiProjection,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Filter filter, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Slice slice, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Extension extension, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Distinct distinct, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Reduced reduced, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Group node, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Order node, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(BinaryTupleOperator expr,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Join join, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(LeftJoin leftJoin,
			final BindingSet bindings); @SuppressWarnings("unchecked") CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Union union,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Intersection intersection,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Difference difference,
			final BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(SingletonSet singletonSet,
			BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(EmptySet emptySet, BindingSet bindings); CloseableIteration<BindingSet, QueryEvaluationException> evaluate(ExternalSet external, BindingSet bindings); @Override Value evaluate(ValueExpr expr, BindingSet bindings); Value evaluate(Var var, BindingSet bindings); Value evaluate(ValueConstant valueConstant, BindingSet bindings); Value evaluate(BNodeGenerator node, BindingSet bindings); Value evaluate(Bound node, BindingSet bindings); Value evaluate(Str node, BindingSet bindings); Value evaluate(Label node, BindingSet bindings); Value evaluate(Lang node, BindingSet bindings); Value evaluate(Datatype node, BindingSet bindings); Value evaluate(Namespace node, BindingSet bindings); Value evaluate(LocalName node, BindingSet bindings); Value evaluate(IsResource node, BindingSet bindings); Value evaluate(IsURI node, BindingSet bindings); Value evaluate(IsBNode node, BindingSet bindings); Value evaluate(IsLiteral node, BindingSet bindings); Value evaluate(IsNumeric node, BindingSet bindings); IRI evaluate(IRIFunction node, BindingSet bindings); Value evaluate(Regex node, BindingSet bindings); Value evaluate(LangMatches node, BindingSet bindings); Value evaluate(Like node, BindingSet bindings); Value evaluate(FunctionCall node, BindingSet bindings); Value evaluate(And node, BindingSet bindings); Value evaluate(Or node, BindingSet bindings); Value evaluate(Not node, BindingSet bindings); Value evaluate(Now node, BindingSet bindings); Value evaluate(SameTerm node, BindingSet bindings); Value evaluate(Coalesce node, BindingSet bindings); Value evaluate(Compare node, BindingSet bindings); Value evaluate(MathExpr node, BindingSet bindings); Value evaluate(If node, BindingSet bindings); Value evaluate(In node, BindingSet bindings); Value evaluate(ListMemberOperator node, BindingSet bindings); Value evaluate(CompareAny node, BindingSet bindings); Value evaluate(CompareAll node, BindingSet bindings); Value evaluate(Exists node, BindingSet bindings); @Override boolean isTrue(ValueExpr expr, BindingSet bindings);  }