Interface QueryableDataCollection<T extends QueryableData>

Type Parameters:
T - the type of queryable data stored in the collection
All Superinterfaces:
QueryableData
All Known Subinterfaces:
MaterializedDataCollection<T>, MaterializedWritableDataCollection<Q,W>, QueryableWritableDataCollection<Q,W>

public interface QueryableDataCollection<T extends QueryableData> extends QueryableData
A composite QueryableData backed by multiple predicate-specific data sources.
  • Method Details

    • getAllQueryableData

      Map<Predicate, T> getAllQueryableData()
      Returns every queryable data source indexed by predicate.
      Returns:
      a map from predicates to queryable data sources
    • getQueryableData

      default Optional<T> getQueryableData(Predicate predicate)
      Looks up the queryable data source that handles a predicate.
      Parameters:
      predicate - the predicate to resolve
      Returns:
      the matching queryable data, if present
    • getPredicates

      default Stream<Predicate> getPredicates()
      Description copied from interface: QueryableData
      Returns a collection of all predicates in this Readable.
      Specified by:
      getPredicates in interface QueryableData
      Returns:
      a collection of all predicates.
    • evaluate

      default Stream<List<Term>> evaluate(BasicQuery query) throws EvaluationException
      Description copied from interface: QueryableData
      Try to evaluate a basic query
      Specified by:
      evaluate in interface QueryableData
      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
    • estimateBound

      default Optional<Long> estimateBound(BasicQuery query)
      Description copied from interface: QueryableData
      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.
      Specified by:
      estimateBound in interface QueryableData
      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
    • getAtomicPattern

      default AtomicPattern getAtomicPattern(Predicate predicate)
      Description copied from interface: QueryableData
      Get the basic pattern for a given predicate
      Specified by:
      getAtomicPattern in interface QueryableData
      Parameters:
      predicate - the predicate for which we want to know the basic pattern
      Returns:
      a basic pattern for predicate