Class ResultReceiver
java.lang.Object
com.semedy.reasoner.reasoning.processes.ResultReceiver
- All Implemented Interfaces:
Receiver
container which collects reasoning results
- Author:
- angele
-
Constructor Summary
ConstructorDescriptionResultReceiver
(InterruptFlag interruptflag, Rule query, int arity, ReasoningMonitor monitor, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, long maxResults) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRelation
(ReasoningRelation relation) add a whole relation at the beginningvoid
getAllReceivedTuples
(boolean duplicatesEliminated) return a list of all received tuplesint
getArity()
arity of the tuplesgetResults
(boolean duplicatesEliminated) getResultsIterators
(boolean duplicatesEliminated) return a list of all received tuplesget the basic tuple storeboolean
receive a whole relationfinal boolean
receiveTuple
(int tuple) receive a single tupleboolean
receiveTuple
(long[] tuple) receive a single tuplefinal boolean
receiveTuple
(TupleBuffer tuple) receive a single tupleboolean
startTuples
(Receiver source, boolean check4Duplicates) start delivering single tuplesvoid
tuplesFinished
(boolean isBottomUp) finish delivering single tuplesvoid
tuplesFinished
(String annotation, ReasoningRelation R1, ReasoningRelation R2) Finish delivering single tuples.void
withdrawRelation
(ReasoningRelation relation) boolean
withdrawTuple
(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:Receiver
arity of the tuples -
receiveTuple
Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerException
IOException
-
withdrawTuple
public boolean withdrawTuple(int tuple) -
receiveTuple
Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
ReasoningException
SemReasonerException
IOException
-
getAllReceivedTuples
- Throws:
IOException
EDBException
-
getAllReceivedTuples
public List<ReasoningRelation> getAllReceivedTuples(boolean duplicatesEliminated) throws IOException, EDBException return a list of all received tuples- Throws:
IOException
EDBException
-
getResultsIterators
public List<TupleEnumerator> getResultsIterators(boolean duplicatesEliminated) throws IOException, EDBException return a list of all received tuples- Throws:
IOException
EDBException
-
resultContainsEDBRelations
public boolean resultContainsEDBRelations() -
getResults
public List<ReasoningRelation> getResults(boolean duplicatesEliminated) throws IOException, EDBException - Throws:
IOException
EDBException
-
receiveRelation
public boolean receiveRelation(ReasoningRelation R) throws SemReasonerException, InterruptedException Description copied from interface:Receiver
receive a whole relation- Specified by:
receiveRelation
in interfaceReceiver
- Parameters:
R
- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
ReasoningException
InterruptedException
SemReasonerException
-
startTuples
Description copied from interface:Receiver
start delivering single tuples- Specified by:
startTuples
in interfaceReceiver
- Parameters:
source
- , the delivering processcheck4Duplicates
- , check for duplicates in the target store- Returns:
- an object receiving the results
-
tuplesFinished
Description copied from interface:Receiver
finish delivering single tuples- Specified by:
tuplesFinished
in interfaceReceiver
- Parameters:
isBottomUp
- TODO- Throws:
ReasoningException
SemReasonerException
InterruptedException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) throws SemReasonerException, InterruptedException Description copied from interface:Receiver
Finish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinished
in interfaceReceiver
- Parameters:
annotation
- , an annotation used for cachingR1
- , the relations which have been combinedR2
- , the relations which have been combined- Throws:
ReasoningException
SemReasonerException
InterruptedException
-
evaluationFinished
- Throws:
SemReasonerException
-
addRelation
Description copied from interface:Receiver
add a whole relation at the beginning- Specified by:
addRelation
in interfaceReceiver
- Parameters:
relation
- the relation to be added
-
getTupleStore
Description copied from interface:Receiver
get the basic tuple store- Specified by:
getTupleStore
in interfaceReceiver
- Returns:
- the tuple store
-
receiveTuple
public boolean receiveTuple(long[] tuple) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerException
InterruptedException
IOException
-
withdrawRelation
-