Interface MaterializedDataCollection<T extends MaterializedData>

Type Parameters:
T - the materialized data type
All Superinterfaces:
Iterable<Atom>, MaterializedData, QueryableData, QueryableDataCollection<T>, TermCompound
All Known Subinterfaces:
MaterializedWritableDataCollection<Q,W>

public interface MaterializedDataCollection<T extends MaterializedData> extends QueryableDataCollection<T>, MaterializedData
A queryable data collection whose members expose materialized atoms.
  • Method Details

    • stream

      default Stream<Atom> stream()
      Description copied from interface: MaterializedData
      Streams every atom contained in this data source.
      Specified by:
      stream in interface MaterializedData
      Returns:
      a stream over all the atoms of the source
    • getAtomSet

      default Set<Atom> getAtomSet()
      Description copied from interface: MaterializedData
      Returns a set of all the atoms in the source
      Specified by:
      getAtomSet in interface MaterializedData
      Returns:
      a set containing all the atoms of the source
    • getAtomsByTerm

      default Stream<Atom> getAtomsByTerm(Term term)
      Description copied from interface: MaterializedData
      Returns a stream over all atoms with the specified term.
      Specified by:
      getAtomsByTerm in interface MaterializedData
      Parameters:
      term - to search
      Returns:
      a stream over all atoms with the specified term
    • getTermsByPredicatePosition

      default Stream<Term> getTermsByPredicatePosition(Predicate p, int position)
      Description copied from interface: MaterializedData
      Returns a stream over terms which are in a specific position in at least one atom with the given predicate.
      Specified by:
      getTermsByPredicatePosition in interface MaterializedData
      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)
      Description copied from interface: MaterializedData
      Tests whether a given atom is present in this data source.
      Specified by:
      contains in interface MaterializedData
      Parameters:
      a - the atom to find
      Returns:
      true iff this storage contains the given atom
    • size

      default long size()
      Description copied from interface: MaterializedData
      Counts the atoms contained in this data source.
      Specified by:
      size in interface MaterializedData
      Returns:
      the number of atoms
    • getAtomsByPredicate

      default Stream<Atom> getAtomsByPredicate(Predicate predicate)
      Description copied from interface: MaterializedData
      Returns an iterator over all atoms with the specified predicate.
      Specified by:
      getAtomsByPredicate in interface MaterializedData
      Parameters:
      predicate - to search
      Returns:
      an iterator over all atoms with the specified predicate
    • getTerms

      default Stream<Term> getTerms()
      Description copied from interface: TermCompound
      Streams the first-level terms contained in this object.
      Specified by:
      getTerms in interface TermCompound
      Returns:
      a stream over all the non-nested terms (i.e., all terms that are not themselves in a compound term) For instance, for p(a,g(b)), it returns a and g(b) but not b.
    • getVariables

      default Stream<Variable> getVariables()
      Description copied from interface: TermCompound
      Recursively list all variables
      Specified by:
      getVariables in interface TermCompound
      Returns:
      the set of variables included in this term
    • getLiterals

      default Stream<Literal<?>> getLiterals()
      Description copied from interface: TermCompound
      Recursively list all literals
      Specified by:
      getLiterals in interface TermCompound
      Returns:
      the set of literals included in this term
    • getConstants

      default Stream<Constant> getConstants()
      Description copied from interface: TermCompound
      Recursively list all constants
      Specified by:
      getConstants in interface TermCompound
      Returns:
      the set of constants included in this term
    • getAllNestedTerms

      default Stream<Term> getAllNestedTerms()
      Description copied from interface: TermCompound
      Streams all nested terms contained in this object.
      Specified by:
      getAllNestedTerms in interface TermCompound
      Returns:
      the set of all nested terms. For instance, for f(a,g(b)), it returns a, g(b), and b.
    • getNestedTerms

      default <TT extends Term> Stream<TT> getNestedTerms(Class<TT> classType)
      Description copied from interface: TermCompound
      Returns all nested terms filtered by the supplied type. Recursively enumerate all terms
      Specified by:
      getNestedTerms in interface TermCompound
      Type Parameters:
      TT - the nested term subtype to extract
      Parameters:
      classType - class type filters the terms by type
      Returns:
      the set of variables included in this term