Interface FOQueryEvaluator<Formula extends FOFormula, QD extends QueryableData>

Type Parameters:
Formula - The type of FOFormula that the evaluator can evaluate
QD - The type of QueryableData evaluated 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 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 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:
      evaluate in interface QueryEvaluator<Formula extends FOFormula, QD extends QueryableData>
      Parameters:
      query - the query to evaluate
      queryableData - the data source against which the query is evaluated
      variablesThatMustBeMappedToConstants - variables constrained to constant answers
      preHomomorphism - 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:
      prepareQuery in interface QueryEvaluator<Formula extends FOFormula, QD extends QueryableData>
      Parameters:
      query - the query to prepare
      queryableData - the data source against which the query will run
      variablesThatMustBeMappedToGroundTerms - 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:
      prepareQuery in interface QueryEvaluator<Formula extends FOFormula, QD extends QueryableData>
      Parameters:
      query - the query to prepare
      queryableData - the data source against which the query will run
      answerVariablesMustBeGround - whether answer variables must map to ground terms
      Returns:
      a prepared query wrapper