Package com.semedy.reasoner.api.core
Class MaterializationReceiver
java.lang.Object
com.semedy.reasoner.reasoning.processes.ProcessImp
com.semedy.reasoner.api.core.EventResultReceiver
com.semedy.reasoner.api.core.MaterializationReceiver
Stores results during materialization in edb
Single events are buffered until reasoning is finished.
Single events are buffered until reasoning is finished.
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionMaterializationReceiver
(InterruptFlag interruptFlag, Literal literal, DeductiveDatabase ddb, ExtensionalDB edb, SymbolTable symbols, SymbolTable reasoningSymbols) -
Method Summary
Modifier and TypeMethodDescriptionvoid
After finishing the evaluation the buffered results (either in a main memory relation or in a file)
are stored in the edb.void
evaluationFinished
(long querykey) After finishing the evaluation the buffered results (either in a main memory relation or in a file)
are stored in the edb.get the symboltable to decode the resultsget the basic tuple storevoid
receiveResult
(long[] tuple) Receive a new result as a tuple of codes.void
receiveResult
(TupleBuffer result) Receive a new result as a tuple of codes.boolean
receiveTuple
(int tuple) receive a single tuplevoid
retractResult
(long[] result) a new result should be withdrawnvoid
setSymbolTable
(SymbolTable symbols) set the symbol table to decode the resultsstartTuples
(Receiver source, boolean check4Duplicates) start delivering single tuplessubstitute
(Object t, Object[] substitutions) void
tuplesFinished
(boolean isBottomUp) finish delivering single tuplesMethods inherited from class com.semedy.reasoner.api.core.EventResultReceiver
receiveRelation
Methods inherited from class com.semedy.reasoner.reasoning.processes.ProcessImp
addNextReceiver, addRelation, clear, dispose, evaluate, getArity, getPriority, getStratum, isNotQueuedSetQueued, isQueued, nextReceiver, operationFinished, receiveTuple, receiveTuple, setDataFlowGraph, setQueued, setStratum, tuplesFinished
-
Constructor Details
-
MaterializationReceiver
public MaterializationReceiver(InterruptFlag interruptFlag, Literal literal, DeductiveDatabase ddb, ExtensionalDB edb, SymbolTable symbols, SymbolTable reasoningSymbols)
-
-
Method Details
-
receiveTuple
public boolean receiveTuple(int tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Overrides:
receiveTuple
in classProcessImp
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedException
IOException
SemReasonerException
-
receiveResult
Receive a new result as a tuple of codes.
Buffer result either in a main memory relation (main memory case) or store it in a file (persistent case)- Specified by:
receiveResult
in classEventResultReceiver
- Throws:
IOException
SemReasonerException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws IOException, EDBException Description copied from interface:Receiver
start delivering single tuples- Specified by:
startTuples
in interfaceReceiver
- Overrides:
startTuples
in classProcessImp
- Parameters:
source
- , the delivering processcheck4Duplicates
- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
IOException
EDBException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
finish delivering single tuples- Specified by:
tuplesFinished
in interfaceReceiver
- Overrides:
tuplesFinished
in classProcessImp
- Parameters:
isBottomUp
- TODO- Throws:
InterruptedException
IOException
ReasoningException
SemReasonerException
-
getTupleStore
Description copied from interface:Receiver
get the basic tuple store- Specified by:
getTupleStore
in interfaceProcess
- Specified by:
getTupleStore
in interfaceReceiver
- Overrides:
getTupleStore
in classProcessImp
- Returns:
- the tuple store
-
receiveResult
Receive a new result as a tuple of codes.
Buffer result either in a main memory relation (main memory case) or store it in a file (persistent case)- Specified by:
receiveResult
in classEventResultReceiver
- Throws:
IOException
ReasoningException
-
setSymbolTable
Description copied from class:EventResultReceiver
set the symbol table to decode the results- Specified by:
setSymbolTable
in classEventResultReceiver
-
getSymbolTable
Description copied from class:EventResultReceiver
get the symboltable to decode the results- Specified by:
getSymbolTable
in classEventResultReceiver
- Returns:
-
evaluationFinished
After finishing the evaluation the buffered results (either in a main memory relation or in a file)
are stored in the edb.
Codes which have been generated during reasoning (by a built-in or by a function) have to be reencoded
as the reasoning symbol table has different codes compared to the base symbol table.- Overrides:
evaluationFinished
in classProcessImp
- Throws:
SemReasonerException
IOException
-
evaluationFinished
After finishing the evaluation the buffered results (either in a main memory relation or in a file)
are stored in the edb.
Codes which have been generated during reasoning (by a built-in or by a function) have to be reencoded
as the reasoning symbol table has different codes compared to the base symbol table.- Specified by:
evaluationFinished
in interfaceProcess
- Overrides:
evaluationFinished
in classProcessImp
- Throws:
ReasoningException
SemReasonerException
IOException
-
substitute
- Throws:
SemReasonerException
IOException
-
retractResult
Description copied from class:EventResultReceiver
a new result should be withdrawn- Specified by:
retractResult
in classEventResultReceiver
- Throws:
IOException
ReasoningException
-