Class FOQueryEvaluatorWithDBMSDelegation
java.lang.Object
fr.inria.rules.integraal.query_evaluation.generic.FOQueryEvaluatorWithDBMSDelegation
- All Implemented Interfaces:
FOQueryEvaluator<FOFormula, QueryableData>, QueryEvaluator<FOQuery<? extends FOFormula>, QueryableData>
public class FOQueryEvaluatorWithDBMSDelegation
extends Object
implements FOQueryEvaluator<FOFormula, QueryableData>
Evaluates a
FOQuery by using the an (external) data management
system, if this is one is present.-
Constructor Summary
ConstructorsConstructorDescriptionCreates the delegating FO-query evaluator. -
Method Summary
Modifier and TypeMethodDescriptionlongcountAnswers(FOQuery<? extends FOFormula> query, QueryableData queryableData) If using a DBMS, we ask the DBMS storage to evaluate the whole query If anything throws an exception, we use theGenericFOQueryEvaluatoras a fallbackstatic FOQueryEvaluator<FOFormula, QueryableData> Returns the shared default configuration.evaluate(FOQuery<? extends FOFormula> query, QueryableData queryableData, Collection<Variable> variablesThatMustBeMappedToConstants, Substitution preHomomorphism) If using a DBMS, we ask the DBMS storage to evaluate the whole query If anything throws an exception, we use theGenericFOQueryEvaluatoras a fallbackMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FOQueryEvaluator
prepareQuery, prepareQueryMethods inherited from interface QueryEvaluator
countHomomorphism, evaluate, evaluate, existAnswer, existAnswer, existHomomorphism, existHomomorphism, homomorphism, homomorphism, postprocessResult, postprocessResult
-
Constructor Details
-
FOQueryEvaluatorWithDBMSDelegation
public FOQueryEvaluatorWithDBMSDelegation()Creates the delegating FO-query evaluator.
-
-
Method Details
-
defaultInstance
Returns the shared default configuration.- Returns:
- the default configuration
-
evaluate
public Stream<Substitution> evaluate(FOQuery<? extends FOFormula> query, QueryableData queryableData, Collection<Variable> variablesThatMustBeMappedToConstants, Substitution preHomomorphism) throws EvaluationException If using a DBMS, we ask the DBMS storage to evaluate the whole query If anything throws an exception, we use theGenericFOQueryEvaluatoras a fallback- Specified by:
evaluatein interfaceFOQueryEvaluator<FOFormula, QueryableData>- Specified by:
evaluatein interfaceQueryEvaluator<FOQuery<? extends FOFormula>, 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
-
countAnswers
If using a DBMS, we ask the DBMS storage to evaluate the whole query If anything throws an exception, we use theGenericFOQueryEvaluatoras a fallback- Specified by:
countAnswersin interfaceQueryEvaluator<FOQuery<? extends FOFormula>, QueryableData>- Parameters:
query- query to evaluatequeryableData- queryable data source in which atoms are stored- Returns:
- the number of answers to the query
-