Interface QueryableData

All Known Subinterfaces:
CSVCopyable, DatalogDelegable, DataSource<NativeQueryType, NativeResultType>, FactBase, MaterializedData, MaterializedDataCollection<T>, MaterializedWritableDataCollection<Q,W>, QueryableDataCollection<T>, QueryableWritableDataCollection<Q,W>
All Known Implementing Classes:
AbstractDataSource, DefaultInMemoryAtomSet, FactBaseDelAtomsWrapper, FederatedFactBase, LightInMemoryGraphStore, MongoDBDataSource, QueryableDataDelAtomsWrapper, QueryableRelationalFunctions, RDBMSStore, SimpleInMemoryGraphStore, SPARQLDataSource, SQLDataSource, TripleStoreStore, WebAPIDataSource

public interface QueryableData
This interface describes data sources that can be accessed with read rights.
Author:
Guillaume Pérution-Kihli
  • Method Details

    • getPredicates

      Stream<Predicate> getPredicates()
      Returns a collection of all predicates in this Readable.
      Returns:
      a collection of all predicates.
    • hasPredicate

      boolean hasPredicate(Predicate p)
      Allows checking if this QueryableData provides the predicate p
      Parameters:
      p - the predicate to look up
      Returns:
      boolean that is true iff the QueryableData provides this predicate
    • evaluate

      Stream<List<Term>> evaluate(BasicQuery query) throws EvaluationException
      Try to evaluate a basic query
      Parameters:
      query - the query to evaluate
      Returns:
      Empty if the query is not evaluable, otherwise a stream containing substitutions that are the answers to the query
      Throws:
      EvaluationException - if query evaluation fails
    • evaluate

      default Stream<List<Term>> evaluate(BasicQuery query, List<Integer> sequenceOfAnswerVariables) throws EvaluationException
      Try to evaluate a basic query
      Parameters:
      query - the query to evaluate
      sequenceOfAnswerVariables - the sequence of answer variables that define the signature of the resulting tuple
      Returns:
      Empty if the query is not evaluable, otherwise a stream containing lists of term ; each list corresponds to the substitution of the answer variables with the corresponding terms
      Throws:
      EvaluationException - if query evaluation fails
    • estimateBound

      Optional<Long> estimateBound(BasicQuery query)
      Estimate the number of answers to a query The estimation is the upper bound, meaning the actual number of answers will not exceed this number. Implementations may return an empty Optional if they cannot provide an estimation.
      Parameters:
      query - the query for which we want to know the upper bound
      Returns:
      an Optional containing the estimated upper bound of answers, or an empty Optional if estimation is not possible
    • estimateBound

      default Optional<Long> estimateBound(Predicate predicate)
      Estimate the number of tuples in a predicate The estimation is the upper bound, meaning the actual number of answers will not exceed this number. Implementations may return an empty Optional if they cannot provide an estimation.
      Parameters:
      predicate - the query for which we want to know the upper bound
      Returns:
      an Optional containing the estimated upper bound of answers, or an empty Optional if estimation is not possible
    • getAtomicPattern

      AtomicPattern getAtomicPattern(Predicate predicate)
      Get the basic pattern for a given predicate
      Parameters:
      predicate - the predicate for which we want to know the basic pattern
      Returns:
      a basic pattern for predicate
    • getSupportedOperations

      default Collection<OperationsSupported> getSupportedOperations()
      Returns:
      the set of operations and optimizations that are supported by the datasource