Class AtomicFOQueryEvaluator<QD extends QueryableData>
java.lang.Object
fr.inria.rules.integraal.query_evaluation.atomic.AtomicFOQueryEvaluator<QD>
- Type Parameters:
QD- concreteQueryableDatatype
- All Implemented Interfaces:
FOQueryEvaluator<Atom,QD>, QueryEvaluator<FOQuery<? extends Atom>, QD>
public class AtomicFOQueryEvaluator<QD extends QueryableData>
extends Object
implements FOQueryEvaluator<Atom,QD>
Specialised evaluator for atomic first-order queries.
The implementation is optimised for both function-free and
function-enabled formulas. Equalities and answer reconstruction are
delegated to the shared utility classes in fr.inria.rules.integraal.query_evaluation.util.
- Author:
- Guillaume Perution-Kihli
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(FOQuery<? extends Atom> query, QD qd, Collection<Variable> mustGround, Substitution assign) Evaluates a first-order query against a data source.prepareQuery(FOQuery<? extends Atom> query, QD qd, Collection<Variable> mustGround) Creates a prepared first-order query bound to a data source and ground-term policy.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FOQueryEvaluator
prepareQueryMethods inherited from interface QueryEvaluator
countAnswers, countHomomorphism, evaluate, evaluate, existAnswer, existAnswer, existHomomorphism, existHomomorphism, homomorphism, homomorphism, postprocessResult, postprocessResult
-
Constructor Details
-
AtomicFOQueryEvaluator
public AtomicFOQueryEvaluator()Creates an atomic query evaluator.
-
-
Method Details
-
evaluate
public Stream<Substitution> evaluate(FOQuery<? extends Atom> query, QD qd, Collection<Variable> mustGround, Substitution assign) throws EvaluationException Description copied from interface:FOQueryEvaluatorEvaluates a first-order query against a data source.- Specified by:
evaluatein interfaceFOQueryEvaluator<Atom, QD extends QueryableData>- Specified by:
evaluatein interfaceQueryEvaluator<FOQuery<? extends Atom>, QD extends QueryableData>- Parameters:
query- the query to evaluateqd- the data source against which the query is evaluatedmustGround- variables constrained to constant answersassign- a partial substitution to extend- Returns:
- a stream of substitutions answering the query
- Throws:
EvaluationException- if the evaluation cannot be completed
-
prepareQuery
public PreparedFOQuery<Atom,QD> prepareQuery(FOQuery<? extends Atom> query, QD qd, Collection<Variable> mustGround) Description copied from interface:FOQueryEvaluatorCreates a prepared first-order query bound to a data source and ground-term policy.- Specified by:
prepareQueryin interfaceFOQueryEvaluator<Atom, QD extends QueryableData>- Specified by:
prepareQueryin interfaceQueryEvaluator<FOQuery<? extends Atom>, QD extends QueryableData>- Parameters:
query- the query to prepareqd- the data source against which the query will runmustGround- variables constrained to ground answers- Returns:
- a prepared query wrapper
-