Interface PreparedQuery<QueryType extends Query, DataSource, AnswerType, AssignationType>

Type Parameters:
QueryType - the concrete query type
DataSource - the prepared data-source type
AnswerType - the answer type produced on execution
AssignationType - the type of runtime assignation accepted by the prepared query
All Superinterfaces:
fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, fr.inria.rules.dlgpemodel.api.sentences.ISentence, Labeled, Query, Sentence
All Known Subinterfaces:
PreparedFOQuery<Formula,QD>
All Known Implementing Classes:
PreparedFOQueryImpl, PreparedQueryImpl

public interface PreparedQuery<QueryType extends Query, DataSource, AnswerType, AssignationType> extends Query
A query pre-bound to a specific data source.
  • Field Summary

    Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo

    IDENT

    Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable

    WRITER

    Fields inherited from interface Labeled

    NOLABEL
  • Method Summary

    Modifier and Type
    Method
    Description
    default long
    Estimate the number of answers' bound If no precise bound can be provided, returns Long.MAX_VALUE
    execute(AssignationType assignation)
    Execute the prepared query with the given pre-homomorphism
    Returns the ordered answer variables of this query.
    Returns the data source against which this query was prepared.
    default String
    Returns the current label.
    Returns the query from which this prepared query was created.

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo

    getIdentifier, getInfo, getItemInfo, setIdentifier, setInfo, setItemInfo

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable

    toDLGPE

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.ISentence

    setPatterns

    Methods inherited from interface Sentence

    getPatterns, setLabel
  • Method Details

    • getQuery

      QueryType getQuery()
      Returns the query from which this prepared query was created.
      Returns:
      the query which was prepared
    • getDataSource

      DataSource getDataSource()
      Returns the data source against which this query was prepared.
      Returns:
      the datasource on which the query was prepared
    • execute

      Stream<AnswerType> execute(AssignationType assignation) throws EvaluationException
      Execute the prepared query with the given pre-homomorphism
      Parameters:
      assignation - the assignation of the values to use
      Returns:
      The answers to the query
      Throws:
      EvaluationException - if execution fails
    • getLabel

      default String getLabel()
      Description copied from interface: Labeled
      Returns the current label.
      Specified by:
      getLabel in interface Labeled
      Specified by:
      getLabel in interface Sentence
      Returns:
      the label of this object
    • getAnswerVariables

      default Collection<Variable> getAnswerVariables()
      Description copied from interface: Query
      Returns the ordered answer variables of this query.
      Specified by:
      getAnswerVariables in interface Query
      Returns:
      an ordered collection of variable representing the variables of this query that are used as answers.
    • estimateBound

      default long estimateBound(AssignationType assignation) throws EvaluationException
      Estimate the number of answers' bound If no precise bound can be provided, returns Long.MAX_VALUE
      Parameters:
      assignation - the assignation of the values to use
      Returns:
      An estimation for the number of answers' bound
      Throws:
      EvaluationException - if the bound cannot be estimated