Class ResultReceiver
java.lang.Object
com.semedy.reasoner.reasoning.processes.ResultReceiver
- All Implemented Interfaces:
Receiver
container which collects reasoning results
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionResultReceiver(InterruptFlag interruptflag, Rule query, int arity, ReasoningMonitor monitor, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, long maxResults) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRelation(ReasoningRelation relation) add a whole relation at the beginningvoidgetAllReceivedTuples(boolean duplicatesEliminated) return a list of all received tuplesintgetArity()arity of the tuplesgetResults(boolean duplicatesEliminated) getResultsIterators(boolean duplicatesEliminated) return a list of all received tuplesget the basic tuple storebooleanreceive a whole relationfinal booleanreceiveTuple(int tuple) receive a single tuplebooleanreceiveTuple(long[] tuple) receive a single tuplefinal booleanreceiveTuple(TupleBuffer tuple) receive a single tuplebooleanstartTuples(Receiver source, boolean check4Duplicates) start delivering single tuplesvoidtuplesFinished(boolean isBottomUp) finish delivering single tuplesvoidtuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) Finish delivering single tuples.voidwithdrawRelation(ReasoningRelation relation) booleanwithdrawTuple(int tuple)
-
Constructor Details
-
ResultReceiver
public ResultReceiver(InterruptFlag interruptflag, Rule query, int arity, ReasoningMonitor monitor, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, long maxResults)
-
-
Method Details
-
getArity
public int getArity()Description copied from interface:Receiverarity of the tuples -
receiveTuple
Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerExceptionIOException
-
withdrawTuple
public boolean withdrawTuple(int tuple) -
receiveTuple
Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
ReasoningExceptionSemReasonerExceptionIOException
-
getAllReceivedTuples
- Throws:
IOExceptionEDBException
-
getAllReceivedTuples
public List<ReasoningRelation> getAllReceivedTuples(boolean duplicatesEliminated) throws IOException, EDBException return a list of all received tuples- Throws:
IOExceptionEDBException
-
getResultsIterators
public List<TupleEnumerator> getResultsIterators(boolean duplicatesEliminated) throws IOException, EDBException return a list of all received tuples- Throws:
IOExceptionEDBException
-
resultContainsEDBRelations
public boolean resultContainsEDBRelations() -
getResults
public List<ReasoningRelation> getResults(boolean duplicatesEliminated) throws IOException, EDBException - Throws:
IOExceptionEDBException
-
receiveRelation
public boolean receiveRelation(ReasoningRelation R) throws SemReasonerException, InterruptedException Description copied from interface:Receiverreceive a whole relation- Specified by:
receiveRelationin interfaceReceiver- Parameters:
R- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
ReasoningExceptionInterruptedExceptionSemReasonerException
-
startTuples
Description copied from interface:Receiverstart delivering single tuples- Specified by:
startTuplesin interfaceReceiver- Parameters:
source- , the delivering processcheck4Duplicates- , check for duplicates in the target store- Returns:
- an object receiving the results
-
tuplesFinished
Description copied from interface:Receiverfinish delivering single tuples- Specified by:
tuplesFinishedin interfaceReceiver- Parameters:
isBottomUp- TODO- Throws:
ReasoningExceptionSemReasonerExceptionInterruptedException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) throws SemReasonerException, InterruptedException Description copied from interface:ReceiverFinish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinishedin interfaceReceiver- Parameters:
annotation- , an annotation used for cachingR1- , the relations which have been combinedR2- , the relations which have been combined- Throws:
ReasoningExceptionSemReasonerExceptionInterruptedException
-
evaluationFinished
- Throws:
SemReasonerException
-
addRelation
Description copied from interface:Receiveradd a whole relation at the beginning- Specified by:
addRelationin interfaceReceiver- Parameters:
relation- the relation to be added
-
getTupleStore
Description copied from interface:Receiverget the basic tuple store- Specified by:
getTupleStorein interfaceReceiver- Returns:
- the tuple store
-
receiveTuple
public boolean receiveTuple(long[] tuple) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerExceptionInterruptedExceptionIOException
-
withdrawRelation
-