Class PartialRecallRefinementOperator
- java.lang.Object
-
- org.aksw.limes.core.execution.engine.partialrecallengine.refinement.PartialRecallRefinementOperator
-
- Direct Known Subclasses:
LigerRefinementOperator
public abstract class PartialRecallRefinementOperator extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected PartialRecallRefinementNodebestprotected LinkedList<PartialRecallRefinementNode>bufferprotected doubledesiredSelectivityprotected doublekprotected static org.apache.log4j.Loggerloggerprotected longmaxOptprotected PartialRecallRefinementNoderootprotected ACachesourceprotected ACachetargetprotected List<Double>thresholdsprotected longtimeLimitprotected HashSet<String>total
-
Constructor Summary
Constructors Constructor Description PartialRecallRefinementOperator(ACache s, ACache t, double recall, long optTime, LinkSpecification spec)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intcheckSelectivity(double selectivity)Compares an input selectivity value with the desired selectivity.PartialRecallRefinementNodegetBest()doublegetDesiredSelectivity()longgetOptimizationTime()doublegetRecall()protected voidinit(LinkSpecification spec)Initializes refinement procedure.protected doublenext(double currentThreshold)Implements the next function.abstract voidoptimize()
-
-
-
Field Detail
-
logger
protected static final org.apache.log4j.Logger logger
-
root
protected PartialRecallRefinementNode root
-
best
protected PartialRecallRefinementNode best
-
desiredSelectivity
protected double desiredSelectivity
-
source
protected ACache source
-
target
protected ACache target
-
timeLimit
protected long timeLimit
-
k
protected double k
-
maxOpt
protected long maxOpt
-
buffer
protected LinkedList<PartialRecallRefinementNode> buffer
-
-
Constructor Detail
-
PartialRecallRefinementOperator
public PartialRecallRefinementOperator(ACache s, ACache t, double recall, long optTime, LinkSpecification spec)
-
-
Method Detail
-
getRecall
public double getRecall()
-
getOptimizationTime
public long getOptimizationTime()
-
getBest
public PartialRecallRefinementNode getBest()
-
getDesiredSelectivity
public double getDesiredSelectivity()
-
optimize
public abstract void optimize()
-
checkSelectivity
protected int checkSelectivity(double selectivity)
Compares an input selectivity value with the desired selectivity. If the input selectivity is equal to the desired selectivity, the function returns 0. If the input selectivity is lower than the desired selectivity, it returns a value lower than 0. If the input selectivity is larger than the desired selectivity, it returns a value larger than 0.- Parameters:
selectivity-- Returns:
-
next
protected double next(double currentThreshold)
Implements the next function. For an input threshold, it returns the first larger threshold from a set of predefined thresholds. The returned value can be at most 1.0. If the input threshold is already 1.0, it returns a negative number that indicates that the link specification, to which the input threshold belongs to, can not be refined any further.- Parameters:
currentThreshold- , the input threshold- Returns:
- a value that is the first larger value than currentThreshold from a set of predefined values, or a negative number if the currentThreshold is already 1.0
-
init
protected void init(LinkSpecification spec)
Initializes refinement procedure. It computes the canonical plan of the input LS and based on its estimated selectivity, it computes the minimum expected selectivity that a rapidly executable link specification subsumed by L must achieve, based on the minimal expected recall requirement set by the user. It also adds the input link specification to the buffer and total structure. The buffer structure serves as a queue and includes link specifications obtained by refining the initial specifications, but have not yet been refined. All specifications, that were generated through the refinement procedure as well as the input specification, are stored in the total set. By keeping track of these specifications, LIGER avoids refining a specification more than once and address the redundancy of the refinement operator. This function also initializes the best specification with the initial specification. The best specification is updated via the main LIGER function, optimize(). The best specification is the subsumed specification with the lowest runtime estimation, that abides to the minimal expected recall requirement.- Parameters:
spec- , the input link specification
-
-