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 Summary
Modifier and TypeMethodDescriptiondefault booleanTests whether a given atom is present in this data source.Streams all nested terms contained in this object.getAtomsByPredicate(Predicate predicate) Returns an iterator over all atoms with the specified predicate.getAtomsByTerm(Term term) Returns a stream over all atoms with the specified term.Returns a set of all the atoms in the sourceRecursively list all constantsRecursively list all literalsgetNestedTerms(Class<TT> classType) Returns all nested terms filtered by the supplied type.getTerms()Streams the first-level terms contained in this object.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.Recursively list all variablesdefault longsize()Counts the atoms contained in this data source.stream()Streams every atom contained in this data source.Methods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface MaterializedData
isEmpty, iteratorMethods inherited from interface QueryableData
estimateBound, evaluate, getSupportedOperations, hasPredicateMethods inherited from interface QueryableDataCollection
estimateBound, evaluate, getAllQueryableData, getAtomicPattern, getPredicates, getQueryableData
-
Method Details
-
stream
Description copied from interface:MaterializedDataStreams every atom contained in this data source.- Specified by:
streamin interfaceMaterializedData- Returns:
- a stream over all the atoms of the source
-
getAtomSet
Description copied from interface:MaterializedDataReturns a set of all the atoms in the source- Specified by:
getAtomSetin interfaceMaterializedData- Returns:
- a set containing all the atoms of the source
-
getAtomsByTerm
Description copied from interface:MaterializedDataReturns a stream over all atoms with the specified term.- Specified by:
getAtomsByTermin interfaceMaterializedData- Parameters:
term- to search- Returns:
- a stream over all atoms with the specified term
-
getTermsByPredicatePosition
Description copied from interface:MaterializedDataReturns a stream over terms which are in a specific position in at least one atom with the given predicate.- Specified by:
getTermsByPredicatePositionin interfaceMaterializedData- Parameters:
p- predicateposition- 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
Description copied from interface:MaterializedDataTests whether a given atom is present in this data source.- Specified by:
containsin interfaceMaterializedData- Parameters:
a- the atom to find- Returns:
- true iff this storage contains the given atom
-
size
default long size()Description copied from interface:MaterializedDataCounts the atoms contained in this data source.- Specified by:
sizein interfaceMaterializedData- Returns:
- the number of atoms
-
getAtomsByPredicate
Description copied from interface:MaterializedDataReturns an iterator over all atoms with the specified predicate.- Specified by:
getAtomsByPredicatein interfaceMaterializedData- Parameters:
predicate- to search- Returns:
- an iterator over all atoms with the specified predicate
-
getTerms
Description copied from interface:TermCompoundStreams the first-level terms contained in this object.- Specified by:
getTermsin interfaceTermCompound- 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
Description copied from interface:TermCompoundRecursively list all variables- Specified by:
getVariablesin interfaceTermCompound- Returns:
- the set of variables included in this term
-
getLiterals
Description copied from interface:TermCompoundRecursively list all literals- Specified by:
getLiteralsin interfaceTermCompound- Returns:
- the set of literals included in this term
-
getConstants
Description copied from interface:TermCompoundRecursively list all constants- Specified by:
getConstantsin interfaceTermCompound- Returns:
- the set of constants included in this term
-
getAllNestedTerms
Description copied from interface:TermCompoundStreams all nested terms contained in this object.- Specified by:
getAllNestedTermsin interfaceTermCompound- Returns:
- the set of all nested terms. For instance, for f(a,g(b)), it returns a, g(b), and b.
-
getNestedTerms
Description copied from interface:TermCompoundReturns all nested terms filtered by the supplied type. Recursively enumerate all terms- Specified by:
getNestedTermsin interfaceTermCompound- 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
-