Interface MaterializedData

All Superinterfaces:
Iterable<Atom>, QueryableData, TermCompound
All Known Subinterfaces:
CSVCopyable, DatalogDelegable, FactBase, MaterializedDataCollection<T>, MaterializedWritableDataCollection<Q,W>
All Known Implementing Classes:
DefaultInMemoryAtomSet, FactBaseDelAtomsWrapper, FederatedFactBase, LightInMemoryGraphStore, RDBMSStore, SimpleInMemoryGraphStore, TripleStoreStore

public interface MaterializedData extends QueryableData, TermCompound, Iterable<Atom>
A queryable data source that can iterate over its materialized atoms.
  • Method Details

    • stream

      default Stream<Atom> stream()
      Streams every atom contained in this data source.
      Returns:
      a stream over all the atoms of the source
    • iterator

      default Iterator<Atom> iterator()
      Specified by:
      iterator in interface Iterable<Atom>
      Returns:
      an iterator over all the atoms of the source
    • getAtomSet

      default Set<Atom> getAtomSet()
      Returns a set of all the atoms in the source
      Returns:
      a set containing all the atoms of the source
    • getAtomsByTerm

      default Stream<Atom> getAtomsByTerm(Term term)
      Returns a stream over all atoms with the specified term.
      Parameters:
      term - to search
      Returns:
      a stream over all atoms with the specified term
    • getTermsByPredicatePosition

      Stream<Term> getTermsByPredicatePosition(Predicate p, int position)
      Returns a stream over terms which are in a specific position in at least one atom with the given predicate.
      Parameters:
      p - predicate
      position - the position of the term in atoms, positions starts from 0.
      Returns:
      a stream over terms which appear in the specified position of the specified predicate.
    • contains

      default boolean contains(Atom a)
      Tests whether a given atom is present in this data source.
      Parameters:
      a - the atom to find
      Returns:
      true iff this storage contains the given atom
    • size

      default long size()
      Counts the atoms contained in this data source.
      Returns:
      the number of atoms
    • getAtomsByPredicate

      default Stream<Atom> getAtomsByPredicate(Predicate predicate)
      Returns an iterator over all atoms with the specified predicate.
      Parameters:
      predicate - to search
      Returns:
      an iterator over all atoms with the specified predicate
    • isEmpty

      default boolean isEmpty()
      Indicates whether this data source contains no atoms.
      Returns:
      true when the data source is empty