Interface FOQueryEvaluator<Formula extends FOFormula, QD extends QueryableData>
- Type Parameters:
Formula- The type ofFOFormulathat the evaluator can evaluateQD- The type ofQueryableDataevaluated by this evaluator
- All Superinterfaces:
QueryEvaluator<FOQuery<? extends Formula>, QD>
- All Known Implementing Classes:
AtomicFOQueryEvaluator, BacktrackEvaluator, FOQueryEvaluatorWithDBMSDelegation, GenericFOQueryEvaluator, InfAtomicFOQueryEvaluator, IntersectFOQueryConjunctionEvaluator, LegacyBacktrackEvaluator, NegationFOQueryEvaluator, UnfoldingAtomicFOQueryEvaluator
public interface FOQueryEvaluator<Formula extends FOFormula, QD extends QueryableData>
extends QueryEvaluator<FOQuery<? extends Formula>, QD>
An FOQuery evaluator is one possible algorithm to evaluate a
Evaluating a FOQuery means retrieving all the
FOQuery.
Evaluating a FOQuery means retrieving all the
Substitution of the
answer variables from the query with respect to the atoms from the
Readable.-
Method Summary
Modifier and TypeMethodDescriptionevaluate(FOQuery<? extends Formula> query, QD queryableData, Collection<Variable> variablesThatMustBeMappedToConstants, Substitution preHomomorphism) Evaluates a first-order query against a data source.default PreparedFOQuery<? extends Formula, QD> prepareQuery(FOQuery<? extends Formula> query, QD queryableData, boolean answerVariablesMustBeGround) Creates a prepared first-order query bound to a data source.default PreparedFOQuery<? extends Formula, QD> prepareQuery(FOQuery<? extends Formula> query, QD queryableData, Collection<Variable> variablesThatMustBeMappedToGroundTerms) Creates a prepared first-order query bound to a data source and ground-term policy.Methods inherited from interface QueryEvaluator
countAnswers, countHomomorphism, evaluate, evaluate, existAnswer, existAnswer, existHomomorphism, existHomomorphism, homomorphism, homomorphism, postprocessResult, postprocessResult
-
Method Details
-
evaluate
Stream<Substitution> evaluate(FOQuery<? extends Formula> query, QD queryableData, Collection<Variable> variablesThatMustBeMappedToConstants, Substitution preHomomorphism) throws EvaluationException Evaluates a first-order query against a data source.- Specified by:
evaluatein interfaceQueryEvaluator<Formula extends FOFormula, QD extends QueryableData>- Parameters:
query- the query to evaluatequeryableData- the data source against which the query is evaluatedvariablesThatMustBeMappedToConstants- variables constrained to constant answerspreHomomorphism- a partial substitution to extend- Returns:
- a stream of substitutions answering the query
- Throws:
EvaluationException- if the evaluation cannot be completed
-
prepareQuery
default PreparedFOQuery<? extends Formula, QD> prepareQuery(FOQuery<? extends Formula> query, QD queryableData, Collection<Variable> variablesThatMustBeMappedToGroundTerms) Creates a prepared first-order query bound to a data source and ground-term policy.- Specified by:
prepareQueryin interfaceQueryEvaluator<Formula extends FOFormula, QD extends QueryableData>- Parameters:
query- the query to preparequeryableData- the data source against which the query will runvariablesThatMustBeMappedToGroundTerms- variables constrained to ground answers- Returns:
- a prepared query wrapper
-
prepareQuery
default PreparedFOQuery<? extends Formula, QD> prepareQuery(FOQuery<? extends Formula> query, QD queryableData, boolean answerVariablesMustBeGround) Creates a prepared first-order query bound to a data source.- Specified by:
prepareQueryin interfaceQueryEvaluator<Formula extends FOFormula, QD extends QueryableData>- Parameters:
query- the query to preparequeryableData- the data source against which the query will runanswerVariablesMustBeGround- whether answer variables must map to ground terms- Returns:
- a prepared query wrapper
-