Class FederatedFactBase
java.lang.Object
fr.inria.rules.dlgpemodel.HasItemInfoImpl
fr.inria.rules.dlgpemodel.SentenceImpl
fr.inria.rules.integraal.views.FederatedFactBase
- All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo, fr.inria.rules.dlgpemodel.api.sentences.IFact, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, fr.inria.rules.dlgpemodel.api.sentences.ISentence, Labeled, Printable, Sentence, MaterializedData, QueryableData, Writable, FactBase, TermCompound, Iterable<Atom>
@Deprecated
public class FederatedFactBase
extends fr.inria.rules.dlgpemodel.SentenceImpl
implements FactBase
Deprecated.
A factBase made of several FactBases. This storage system assumes that the
Predicate of the Atom is enough to determine to which sub-storage-system we
need to delegate the queries
- Author:
- Florent Tornil
-
Field Summary
Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo
IDENTFields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
WRITER -
Constructor Summary
ConstructorsConstructorDescriptionFederatedFactBase(FactBase default_base) Deprecated.Constructor with only a local storageFederatedFactBase(FactBase default_base, Predicate p, QueryableData storage) Deprecated.Constructor with a local storage and another storageFederatedFactBase(FactBase default_base, Collection<DataSource<String, ?>> views) Deprecated.Constructor with a local storage and a colelction of view wrappersFederatedFactBase(FactBase default_base, Map<Predicate, QueryableData> facts_by_storage) Deprecated.Constructor with multiple storages associated to predicates -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Stores the given atomsbooleanDeprecated.//////////////////////////////////////////////booleanaddAll(Collection<Atom> atoms) Deprecated.Stores the given atomsvoidaddStorage(Predicate p, QueryableData s) Deprecated.Add the given associationestimateBound(BasicQuery query) Deprecated.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.evaluate(BasicQuery query) Deprecated.Try to evaluate a basic querygetAtomicPattern(Predicate predicate) Deprecated.Get the basic pattern for a given predicategetAtomsByPredicate(Predicate predicate) Deprecated.Returns an iterator over all atoms with the specified predicate.Deprecated.Returns the default writable storage used by this federated fact base.getDescription(Predicate viewPredicate) Deprecated.Returns the storage description associated with a predicate.Deprecated.Returns a collection of all predicates in this Readable.getTerms()Deprecated.Streams the first-level terms contained in this object.getTermsByPredicatePosition(Predicate p, int position) Deprecated.Returns a stream over terms which are in a specific position in at least one atom with the given predicate.Deprecated.Returns the storage type associated with a predicate.Deprecated.Returns the view definitions registered in this federated fact base.booleanDeprecated.Allows checking if this QueryableData provides the predicate pbooleanDeprecated.Removes the given atomsbooleanDeprecated.Removes the given atombooleanremoveAll(Collection<Atom> atoms) Deprecated.Removes the given atomsvoidDeprecated.Add the given storage as default storage.longsize()Deprecated.Counts the atoms contained in this data source.stream()Deprecated.//////////////////////////////////////////////toDLGP()Deprecated.Renders this object in DLGP form.Methods inherited from class fr.inria.rules.dlgpemodel.SentenceImpl
getPatterns, setPatternsMethods inherited from class fr.inria.rules.dlgpemodel.HasItemInfoImpl
getItemInfo, setItemInfoMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FactBase
clear, getColumnsType, getHeadMethods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.HasItemInfo
getIdentifier, getInfo, getItemInfo, setIdentifier, setInfo, setItemInfoMethods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
toDLGPEMethods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.ISentence
setPatternsMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface MaterializedData
contains, getAtomsByTerm, getAtomSet, isEmpty, iteratorMethods inherited from interface QueryableData
estimateBound, evaluate, getSupportedOperationsMethods inherited from interface Sentence
getLabel, getPatterns, setLabelMethods inherited from interface TermCompound
getAllNestedTerms, getConstants, getLiterals, getNestedTerms, getVariables
-
Constructor Details
-
FederatedFactBase
Deprecated.Constructor with only a local storage- Parameters:
default_base- the default storage in writing mode
-
FederatedFactBase
Deprecated.Constructor with a local storage and another storage- Parameters:
default_base- the default storage in writing modep- a predicatestorage- a storage associated with p
-
FederatedFactBase
Deprecated.Constructor with a local storage and a colelction of view wrappers- Parameters:
default_base- the default storage in writing modeviews- the views
-
FederatedFactBase
Deprecated.Constructor with multiple storages associated to predicates- Parameters:
default_base- the default storage in writing modefacts_by_storage- a map of storage by predicate
-
-
Method Details
-
addStorage
Deprecated.Add the given association- Parameters:
p- the predicates- the storage
-
getDefaultStorage
Deprecated.Returns the default writable storage used by this federated fact base.- Returns:
- the default storage
-
setDefaultStorage
Deprecated.Add the given storage as default storage. Replace the existing one is any exists- Parameters:
s- the storage
-
getViewDefinitions
Deprecated.Returns the view definitions registered in this federated fact base.- Returns:
- the mappings
-
add
-
add
-
addAll
-
remove
-
remove
-
removeAll
-
size
public long size()Deprecated.Description copied from interface:MaterializedDataCounts the atoms contained in this data source.- Specified by:
sizein interfaceMaterializedData- Returns:
- the number of atoms
-
stream
Deprecated.//////////////////////////////////////////////- Specified by:
streamin interfaceMaterializedData- Returns:
- a stream over all the atoms of the source
-
getAtomsByPredicate
Deprecated.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
-
getPredicates
Deprecated.Description copied from interface:QueryableDataReturns a collection of all predicates in this Readable.- Specified by:
getPredicatesin interfaceQueryableData- Returns:
- a collection of all predicates.
-
hasPredicate
Deprecated.Description copied from interface:QueryableDataAllows checking if this QueryableData provides the predicate p- Specified by:
hasPredicatein interfaceQueryableData- Parameters:
p- the predicate to look up- Returns:
- boolean that is true iff the QueryableData provides this predicate
-
evaluate
Deprecated.Description copied from interface:QueryableDataTry to evaluate a basic query- Specified by:
evaluatein interfaceQueryableData- 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
Deprecated.Description copied from interface:QueryableDataEstimate 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:
estimateBoundin interfaceQueryableData- 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
Deprecated.Description copied from interface:QueryableDataGet the basic pattern for a given predicate- Specified by:
getAtomicPatternin interfaceQueryableData- Parameters:
predicate- the predicate for which we want to know the basic pattern- Returns:
- a basic pattern for predicate
-
getTermsByPredicatePosition
Deprecated.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.
-
getDescription
Deprecated.Description copied from interface:FactBaseReturns the storage description associated with a predicate.- Specified by:
getDescriptionin interfaceFactBase- Parameters:
viewPredicate- a predicate- Returns:
- the description of the storage
-
getType
Deprecated.Description copied from interface:FactBaseReturns the storage type associated with a predicate. -
getTerms
Deprecated.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.
-
toDLGP
-