Class ReasoningRelation
java.lang.Object
com.semedy.reasoner.reasoning.processes.ReasoningRelation
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionReasoningRelation
(int arity, BaseRelation tuples, ReasoningMonitor monitor, boolean cepReasoning) ReasoningRelation
(int arity, Relation tuples, ReasoningMonitor monitor, boolean cepReasoning) ReasoningRelation
(int arity, TupleStore tuplestore, ReasoningMonitor monitor, boolean cepReasoning) ReasoningRelation
(Relation T, String p, ReasoningMonitor monitor, boolean streamReasoningWithRetracts) create a reasoning relation out of an edb relationReasoningRelation
(String name, int arity, TupleStore tuplestore, boolean duplicates, ReasoningMonitor monitor, boolean cepReasoning) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addTuple
(int tupleaddress) boolean
addTuple
(long[] tuple) boolean
addTuple
(TupleBuffer tuple) blockJoin
(InterruptFlag interrupt, ReasoningRelation[] relations) void
clear()
clone()
void
close()
elements()
int
getArity()
get the base relationlong[]
long[]
getName()
get the predicate the relation stands forint[]
boolean
may relation contain duplicates ?boolean
isDirectEncoded
(int arg) are all values at argument direct encodedboolean
isEmpty()
is relation emptyboolean
join
(InterruptFlag interrupt, int[] compare1, ReasoningRelation R, int[] compare2, int[] source1, int[] dest1, int[] source2, int[] dest2, long[] externalFilter1, long[] externalFilter2, int destarity, Receiver receiver, com.semedy.reasoner.reasoning.processes.EvaluationThread evalThread, boolean streamReasoning, com.semedy.reasoner.reasoning.processes.SystemMonitor.JoinType joinType) void
project
(int[] map, int newArity) project to selected arguments
E.g. if map = [2,1] this means that argument at position 2 gets mapped to position 0
and argument at position 1 gets mapped to argument at position 1boolean
removeTuple
(int tupleaddress) boolean
removeTuple
(long[] tuple) boolean
removeTuple
(TupleBuffer tuple) boolean
select
(long[] filter) boolean
setGrounds
(long[] grounds) void
void
void
setPredicate
(String predicate) set the predicate the relation representsvoid
shrinkArity
(int arity) long
size()
long
toString()
void
union
(ReasoningRelation tuples)
-
Field Details
-
bulk
public static boolean bulk
-
-
Constructor Details
-
ReasoningRelation
public ReasoningRelation(int arity, BaseRelation tuples, ReasoningMonitor monitor, boolean cepReasoning) -
ReasoningRelation
public ReasoningRelation(int arity, Relation tuples, ReasoningMonitor monitor, boolean cepReasoning) -
ReasoningRelation
public ReasoningRelation(int arity, TupleStore tuplestore, ReasoningMonitor monitor, boolean cepReasoning) -
ReasoningRelation
public ReasoningRelation(String name, int arity, TupleStore tuplestore, boolean duplicates, ReasoningMonitor monitor, boolean cepReasoning) -
ReasoningRelation
public ReasoningRelation(Relation T, String p, ReasoningMonitor monitor, boolean streamReasoningWithRetracts) throws EDBException, IOException create a reasoning relation out of an edb relation- Parameters:
T
-p
-streamReasoningWithRetracts
-- Throws:
IOException
EDBException
-
-
Method Details
-
hasDuplicates
public boolean hasDuplicates()may relation contain duplicates ?- Returns:
-
setPredicate
set the predicate the relation represents- Parameters:
predicate
-
-
getPredicate
get the predicate the relation stands for- Returns:
-
getBaseRelation
get the base relation- Returns:
-
isDirectEncoded
public boolean isDirectEncoded(int arg) are all values at argument direct encoded- Parameters:
arg
-- Returns:
-
sizeInBytes
public long sizeInBytes() -
clone
-
toString
-
size
- Throws:
IOException
EDBException
-
shrinkArity
public void shrinkArity(int arity) -
setOrigin
-
getOrigin
-
setGrounds
public boolean setGrounds(long[] grounds) -
select
public boolean select(long[] filter) -
addTuple
- Throws:
IOException
EDBException
-
addTuple
- Throws:
IOException
EDBException
-
addTuple
- Throws:
IOException
EDBException
-
removeTuple
- Throws:
IOException
EDBException
-
removeTuple
- Throws:
IOException
EDBException
-
removeTuple
- Throws:
IOException
EDBException
-
isPersistent
public boolean isPersistent() -
blockJoin
public JoinStatistics blockJoin(InterruptFlag interrupt, ReasoningRelation[] relations) throws EDBException, IOException - Throws:
EDBException
IOException
-
project
project to selected arguments
E.g. if map = [2,1] this means that argument at position 2 gets mapped to position 0
and argument at position 1 gets mapped to argument at position 1- Parameters:
map
-newArity
-- Throws:
IOException
EDBException
-
getProjection
public int[] getProjection() -
getGrounds
public long[] getGrounds() -
getName
-
setName
-
getIdentifier
-
getFilter
public long[] getFilter() -
getTupleStore
-
getArity
public int getArity() -
clear
- Throws:
IOException
EDBException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
union
- Throws:
IOException
EDBException
-
elements
- Throws:
IOException
EDBException
-
isEmpty
is relation empty- Parameters:
R
-- Returns:
- Throws:
IOException
EDBException
-
join
public JoinStatistics join(InterruptFlag interrupt, int[] compare1, ReasoningRelation R, int[] compare2, int[] source1, int[] dest1, int[] source2, int[] dest2, long[] externalFilter1, long[] externalFilter2, int destarity, Receiver receiver, com.semedy.reasoner.reasoning.processes.EvaluationThread evalThread, boolean streamReasoning, com.semedy.reasoner.reasoning.processes.SystemMonitor.JoinType joinType) throws InterruptedException, IOException, SemReasonerException
-