public abstract class FederationEvalStrategy extends StrictEvaluationStrategy
SailFederationEvalStrategy,
SparqlFederationEvalStrategy| Modifier and Type | Field and Description |
|---|---|
protected SourceSelectionCache |
cache |
protected Executor |
executor |
protected FederationContext |
federationContext |
dataset, serviceResolver, tripleSource| Constructor and Description |
|---|
FederationEvalStrategy(FederationContext federationContext) |
evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getLimit, getService, getUUID, getVarValue, getZeroLengthPathIterator, isReducedOrDistinct, isTrue, isUnbound, setFederatedServiceResolver, setOptimizerPipeline, setTrackResultSize, setTrackTimeprotected Executor executor
protected SourceSelectionCache cache
protected FederationContext federationContext
public FederationEvalStrategy(FederationContext federationContext)
protected SourceSelectionCache createSourceSelectionCache()
SourceSelectionCacheSourceSelectionCacheFedXConfig.getSourceSelectionCacheSpec()public TupleExpr optimize(TupleExpr expr, EvaluationStatistics evaluationStatistics, BindingSet bindings)
StrictEvaluationStrategyQueryOptimizerPipeline on the given TupleExpr to optimize its execution plan.optimize in interface EvaluationStrategyoptimize in class StrictEvaluationStrategyexpr - the TupleExpr to optimize.evaluationStatistics - this param is ignored!bindings - a-priori bindings supplied for the query, which can potentially be inlined.TupleExpr.StrictEvaluationStrategy.setOptimizerPipeline(QueryOptimizerPipeline)protected Set<Endpoint> performSourceSelection(List<Endpoint> members, SourceSelectionCache cache, QueryInfo queryInfo, GenericInfoOptimizer info)
members - cache - queryInfo - info - protected void optimizeJoinOrder(TupleExpr query, QueryInfo queryInfo, GenericInfoOptimizer info)
protected boolean propagateServices(List<Service> serviceNodes)
SingleSourceQuery containing SERVICE clauses. By default, the query is always
evaluated within the FedX engine if it contains a SERVICE clause.
Customized implementation may propagate a SingleSourceQuery including the SERVICE clause (e.g. for
Wikidata the Label service can only be accessed in the wikidata endpoint.
serviceNodes - true, a SingleSourceQuery containing SERVICE clauses is propagated as-isprotected void optimizeExclusiveExpressions(TupleExpr query, QueryInfo queryInfo, GenericInfoOptimizer info)
ExclusiveTupleExpr, e.g. restructure the exclusive parts of the query AST.query - queryInfo - info - public CloseableIteration<BindingSet,QueryEvaluationException> evaluate(TupleExpr expr, BindingSet bindings) throws QueryEvaluationException
EvaluationStrategyevaluate in interface EvaluationStrategyevaluate in class StrictEvaluationStrategyexpr - The Tuple Expression to evaluatebindings - The variables bindings to use for evaluating the expression, if applicable.QueryEvaluationExceptionpublic CloseableIteration<Statement,QueryEvaluationException> getStatements(QueryInfo queryInfo, Resource subj, IRI pred, Value obj, Resource... contexts) throws RepositoryException, MalformedQueryException, QueryEvaluationException
For a bound statement, i.e. a statement with no free variables, the statement itself is returned if some member has this statement, an empty iteration otherwise.
If the statement has free variables, i.e. one of the provided arguments in null, the union of
results from relevant statement sources is constructed.
subj - pred - obj - contexts - RepositoryExceptionMalformedQueryExceptionQueryEvaluationExceptionpublic CloseableIteration<BindingSet,QueryEvaluationException> evaluateService(FedXService service, BindingSet bindings) throws QueryEvaluationException
QueryEvaluationExceptionpublic CloseableIteration<BindingSet,QueryEvaluationException> evaluateSingleSourceQuery(SingleSourceQuery query, BindingSet bindings) throws QueryEvaluationException
QueryEvaluationExceptionpublic CloseableIteration<BindingSet,QueryEvaluationException> evaluateNJoin(NJoin join, BindingSet bindings) throws QueryEvaluationException
QueryEvaluationExceptionprotected CloseableIteration<BindingSet,QueryEvaluationException> evaluateLeftJoin(FedXLeftJoin leftJoin, BindingSet bindings) throws QueryEvaluationException
FedXLeftJoin (i.e. an OPTIONAL clause)leftJoin - bindings - QueryEvaluationExceptionStrictEvaluationStrategy.evaluate(org.eclipse.rdf4j.query.algebra.LeftJoin, BindingSet)public CloseableIteration<BindingSet,QueryEvaluationException> evaluateNaryUnion(NUnion union, BindingSet bindings) throws QueryEvaluationException
QueryEvaluationExceptionprotected abstract CloseableIteration<BindingSet,QueryEvaluationException> executeJoin(ControlledWorkerScheduler<BindingSet> joinScheduler, CloseableIteration<BindingSet,QueryEvaluationException> leftIter, TupleExpr rightArg, Set<String> joinVariables, BindingSet bindings, QueryInfo queryInfo) throws QueryEvaluationException
SynchronousJoin - SynchronousBoundJoin -
ControlledWorkerJoin - ControlledWorkerBoundJoin
For endpoint federation use controlled worker bound join, for local federation use controlled worker join. The
other operators are there for completeness.
Use executor to execute the join (it is a runnable).joinScheduler - leftIter - rightArg - joinVariables - bindings - QueryEvaluationExceptionpublic abstract CloseableIteration<BindingSet,QueryEvaluationException> evaluateExclusiveGroup(ExclusiveGroup group, BindingSet bindings) throws RepositoryException, MalformedQueryException, QueryEvaluationException
protected CloseableIteration<BindingSet,QueryEvaluationException> evaluateExclusiveTupleExpr(ExclusiveTupleExpr expr, BindingSet bindings) throws RepositoryException, MalformedQueryException, QueryEvaluationException
ExclusiveTupleExpr. The default implementation converts the given expression to a SELECT
query string and evaluates it at the source.expr - bindings - RepositoryExceptionMalformedQueryExceptionQueryEvaluationExceptionpublic abstract CloseableIteration<BindingSet,QueryEvaluationException> evaluateBoundJoinStatementPattern(StatementTupleExpr stmt, List<BindingSet> bindings) throws QueryEvaluationException
stmt - bindings - QueryEvaluationExceptionpublic abstract CloseableIteration<BindingSet,QueryEvaluationException> evaluateGroupedCheck(CheckStatementPattern stmt, List<BindingSet> bindings) throws QueryEvaluationException
stmt - bindings - QueryEvaluationExceptionpublic CloseableIteration<BindingSet,QueryEvaluationException> evaluateService(FedXService service, List<BindingSet> bindings) throws QueryEvaluationException
ControlledWorkerBoundJoin and FedXConfig.getEnableServiceAsBoundJoin()service - bindings - QueryEvaluationExceptionpublic Value evaluate(ValueExpr expr, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException
EvaluationStrategyevaluate in interface EvaluationStrategyevaluate in class StrictEvaluationStrategybindings - The variables bindings to use for evaluating the expression, if applicable.ValueExprEvaluationExceptionQueryEvaluationExceptionpublic Value evaluate(FilterExpr node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException
public Value evaluate(ConjunctiveFilterExpr node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException
protected CloseableIteration<BindingSet,QueryEvaluationException> evaluateAtStatementSources(Object preparedQuery, List<StatementSource> statementSources, QueryInfo queryInfo) throws QueryEvaluationException
QueryEvaluationExceptionprotected CloseableIteration<BindingSet,QueryEvaluationException> evaluateAtStatementSources(String preparedQuery, List<StatementSource> statementSources, QueryInfo queryInfo) throws QueryEvaluationException
QueryEvaluationExceptionprotected CloseableIteration<BindingSet,QueryEvaluationException> evaluateAtStatementSources(TupleExpr preparedQuery, List<StatementSource> statementSources, QueryInfo queryInfo) throws QueryEvaluationException
QueryEvaluationExceptionCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.