Package com.semedy.reasoner.api.edb
Interface Relation
- All Superinterfaces:
BaseRelation
- All Known Implementing Classes:
MainMemoryRelation
,MainMemorySubRelation
,MixedRelation
,PersistentRelation
,ReasoningMonitorRelation
,RelationAdapter
A relation is a container for a set of tuples with same arity.
Tuples are tuples of longs, which are links into the symbol table.
Tuples are tuples of longs, which are links into the symbol table.
- Author:
- angele
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkSanity
(String message, boolean shadow) check the sanity of a relationvoid
delete()
remove all tuples and release filesvoid
deSelect()
release ressources because relation is currently not usedget standard path for binary filereturns the file name for the relationlong[]
get the groundsgetName()
get a unique name of the relationlong
getNumberOfDifferentValues
(int argument) Returns the number of different values at the argument positions.long
getNumberOfDifferentValues
(int argument, long value) Returns the number of values occurring at the argument positions
Used for statisticsreturns the predicate symbol for the relationlong
last modification timevoid
readBinaryFromBackup
(String filepath) read tuples from a binary backup filevoid
readTupleFile
(String filepath) read tuples from a (compressed) binary filevoid
select()
initialize it before using itvoid
begin transactionvoid
commit last changesvoid
rbort last changesvoid
writeBinary
(String filepath) write tuples to a binary filevoid
writeBinaryToBackup
(String filepath) write tuples to a binary backup filevoid
writeBinaryWithGrounds
(String filepath) write complete tuples to a binary fileMethods inherited from interface com.semedy.reasoner.api.edb.BaseRelation
addTuple, addTuple, addTuple, clear, close, containsTuple, containsTuple, containsTuple, createIndex, createSortedIndex, elements, elements, flush, getArity, getCacheInfo, getDirectEncodedType, getIdentifier, getIndex, getInputBuffer, getInternalArity, getMaxValue, getMinValue, getSortedIndex, hasDuplicates, isDirectEncoded, isEmpty, isOverwrittenByTuple, isPersistent, isTemporary, mayContainDuplicates, overwriteTuple, overwriteTuple, registerListener, removeTuple, removeTuple, removeTuple, size, sizeInBytes, union
-
Method Details
-
getName
String getName()get a unique name of the relation- Returns:
-
getNumberOfDifferentValues
Returns the number of different values at the argument positions.
Used for statistics.- Parameters:
argument
- , argument position- Returns:
- Throws:
EDBException
IOException
-
getNumberOfDifferentValues
Returns the number of values occurring at the argument positions
Used for statistics- Parameters:
argument
- , argument positionvalue
- , the concrete value- Returns:
- Throws:
EDBException
IOException
-
delete
remove all tuples and release files- Throws:
IOException
-
writeBinary
write tuples to a binary file- Specified by:
writeBinary
in interfaceBaseRelation
- Parameters:
filepath
-- Throws:
IOException
EDBException
-
writeBinaryWithGrounds
write complete tuples to a binary file- Parameters:
filepath
-- Throws:
IOException
EDBException
-
writeBinaryToBackup
write tuples to a binary backup file- Parameters:
filepath
-- Throws:
IOException
EDBException
-
readBinaryFromBackup
read tuples from a binary backup file- Parameters:
filepath
-- Throws:
IOException
EDBException
-
readTupleFile
read tuples from a (compressed) binary file- Specified by:
readTupleFile
in interfaceBaseRelation
- Parameters:
filepath
-- Throws:
IOException
EDBException
-
getDataFilePath
String getDataFilePath()get standard path for binary file- Returns:
-
select
initialize it before using it- Specified by:
select
in interfaceBaseRelation
- Throws:
EDBException
IOException
-
deSelect
release ressources because relation is currently not used- Throws:
IOException
-
getPredicateSymbol
String getPredicateSymbol()returns the predicate symbol for the relation- Returns:
-
getFilename
String getFilename()returns the file name for the relation- Returns:
-
transactionRollback
rbort last changes- Throws:
EDBException
IOException
-
transactionCommit
commit last changes- Throws:
EDBException
IOException
-
transactionBegin
begin transaction- Throws:
EDBException
IOException
-
lastModificationTime
long lastModificationTime()last modification time- Specified by:
lastModificationTime
in interfaceBaseRelation
- Returns:
- time of last modification
-
checkSanity
check the sanity of a relation- Parameters:
message
-shadow
- , check in shadow tree- Throws:
IOException
EDBException
-
getGrounds
long[] getGrounds()get the grounds- Returns:
-