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 TypeMethodDescriptionbooleancheckSanity(String message, boolean shadow) check the sanity of a relationvoiddelete()remove all tuples and release filesvoiddeSelect()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 relationlonggetNumberOfDifferentValues(int argument) Returns the number of different values at the argument positions.longgetNumberOfDifferentValues(int argument, long value) Returns the number of values occurring at the argument positions
Used for statisticsreturns the predicate symbol for the relationlonglast modification timevoidreadBinaryFromBackup(String filepath) read tuples from a binary backup filevoidreadTupleFile(String filepath) read tuples from a (compressed) binary filevoidselect()initialize it before using itvoidbegin transactionvoidcommit last changesvoidrbort last changesvoidwriteBinary(String filepath) write tuples to a binary filevoidwriteBinaryToBackup(String filepath) write tuples to a binary backup filevoidwriteBinaryWithGrounds(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:
EDBExceptionIOException
-
getNumberOfDifferentValues
Returns the number of values occurring at the argument positions
Used for statistics- Parameters:
argument- , argument positionvalue- , the concrete value- Returns:
- Throws:
EDBExceptionIOException
-
delete
remove all tuples and release files- Throws:
IOException
-
writeBinary
write tuples to a binary file- Specified by:
writeBinaryin interfaceBaseRelation- Parameters:
filepath-- Throws:
IOExceptionEDBException
-
writeBinaryWithGrounds
write complete tuples to a binary file- Parameters:
filepath-- Throws:
IOExceptionEDBException
-
writeBinaryToBackup
write tuples to a binary backup file- Parameters:
filepath-- Throws:
IOExceptionEDBException
-
readBinaryFromBackup
read tuples from a binary backup file- Parameters:
filepath-- Throws:
IOExceptionEDBException
-
readTupleFile
read tuples from a (compressed) binary file- Specified by:
readTupleFilein interfaceBaseRelation- Parameters:
filepath-- Throws:
IOExceptionEDBException
-
getDataFilePath
String getDataFilePath()get standard path for binary file- Returns:
-
select
initialize it before using it- Specified by:
selectin interfaceBaseRelation- Throws:
EDBExceptionIOException
-
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:
EDBExceptionIOException
-
transactionCommit
commit last changes- Throws:
EDBExceptionIOException
-
transactionBegin
begin transaction- Throws:
EDBExceptionIOException
-
lastModificationTime
long lastModificationTime()last modification time- Specified by:
lastModificationTimein interfaceBaseRelation- Returns:
- time of last modification
-
checkSanity
check the sanity of a relation- Parameters:
message-shadow- , check in shadow tree- Throws:
IOExceptionEDBException
-
getGrounds
long[] getGrounds()get the grounds- Returns:
-