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 TypeMethodDescriptionvoidAfter finishing the evaluation the buffered results (either in a main memory relation or in a file)
are stored in the edb.voidevaluationFinished(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 storevoidreceiveResult(long[] tuple) Receive a new result as a tuple of codes.voidreceiveResult(TupleBuffer result) Receive a new result as a tuple of codes.booleanreceiveTuple(int tuple) receive a single tuplevoidretractResult(long[] result) a new result should be withdrawnvoidsetSymbolTable(SymbolTable symbols) set the symbol table to decode the resultsstartTuples(Receiver source, boolean check4Duplicates) start delivering single tuplessubstitute(Object t, Object[] substitutions) voidtuplesFinished(boolean isBottomUp) finish delivering single tuplesMethods inherited from class com.semedy.reasoner.api.core.EventResultReceiver
receiveRelationMethods 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:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Overrides:
receiveTuplein classProcessImp- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedExceptionIOExceptionSemReasonerException
-
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:
receiveResultin classEventResultReceiver- Throws:
IOExceptionSemReasonerException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws IOException, EDBException Description copied from interface:Receiverstart delivering single tuples- Specified by:
startTuplesin interfaceReceiver- Overrides:
startTuplesin classProcessImp- Parameters:
source- , the delivering processcheck4Duplicates- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
IOExceptionEDBException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverfinish delivering single tuples- Specified by:
tuplesFinishedin interfaceReceiver- Overrides:
tuplesFinishedin classProcessImp- Parameters:
isBottomUp- TODO- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
getTupleStore
Description copied from interface:Receiverget the basic tuple store- Specified by:
getTupleStorein interfaceProcess- Specified by:
getTupleStorein interfaceReceiver- Overrides:
getTupleStorein 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:
receiveResultin classEventResultReceiver- Throws:
IOExceptionReasoningException
-
setSymbolTable
Description copied from class:EventResultReceiverset the symbol table to decode the results- Specified by:
setSymbolTablein classEventResultReceiver
-
getSymbolTable
Description copied from class:EventResultReceiverget the symboltable to decode the results- Specified by:
getSymbolTablein 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:
evaluationFinishedin classProcessImp- Throws:
SemReasonerExceptionIOException
-
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:
evaluationFinishedin interfaceProcess- Overrides:
evaluationFinishedin classProcessImp- Throws:
ReasoningExceptionSemReasonerExceptionIOException
-
substitute
- Throws:
SemReasonerExceptionIOException
-
retractResult
Description copied from class:EventResultReceivera new result should be withdrawn- Specified by:
retractResultin classEventResultReceiver- Throws:
IOExceptionReasoningException
-