Class LigerRefinementOperator
- java.lang.Object
-
- org.aksw.limes.core.execution.engine.partialrecallengine.refinement.PartialRecallRefinementOperator
-
- org.aksw.limes.core.execution.engine.partialrecallengine.refinement.LigerRefinementOperator
-
public class LigerRefinementOperator extends PartialRecallRefinementOperator
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.Loggerlogger-
Fields inherited from class org.aksw.limes.core.execution.engine.partialrecallengine.refinement.PartialRecallRefinementOperator
best, buffer, desiredSelectivity, k, maxOpt, root, source, target, thresholds, timeLimit, total
-
-
Constructor Summary
Constructors Constructor Description LigerRefinementOperator(ACache s, ACache t, double recall, long optTime, LinkSpecification spec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSpecifications(List<LinkSpecification> specs)Creates the set of to-be-refined nodes by adding specification that does not already exists in total set and their selectivity is higher or equal to the desired selectivity.HashMap<LinkSpecification,Plan>getNewNodes()List<LinkSpecification>merge(LinkSpecification parent, List<LinkSpecification> leftChildren, List<LinkSpecification> rightChildren, boolean isLeft)Creates a set of new specification by cloning the input specification, keeping one child specification as is, and substitutes the other child specification with the set of specification retrieved by refining the other child.voidoptimize()Implements the basic idea of LIGER: Link Discovery with Guaranteed Recall.List<LinkSpecification>refine(LinkSpecification currentSpec)Implements the refinement operator for guaranteed recall.LinkSpecificationrefineAtomicLinkSpecification(LinkSpecification currentSpec)Refines an atomic link specification by calling the next(threshold) function.-
Methods inherited from class org.aksw.limes.core.execution.engine.partialrecallengine.refinement.PartialRecallRefinementOperator
checkSelectivity, getBest, getDesiredSelectivity, getOptimizationTime, getRecall, init, next
-
-
-
-
Constructor Detail
-
LigerRefinementOperator
public LigerRefinementOperator(ACache s, ACache t, double recall, long optTime, LinkSpecification spec)
-
-
Method Detail
-
getNewNodes
public HashMap<LinkSpecification,Plan> getNewNodes()
-
optimize
public void optimize()
Implements the basic idea of LIGER: Link Discovery with Guaranteed Recall. The algorithm's main loop starts and run until the total optimization time has exceeded maxOpt, the buffer or unrefined specification is empty or the selectivity of the best subsumed LS is equal to the desired selectivity. At the beginning of each iteration, the first element of the buffer queue is popped out and the algorithm checks if it receives a better run time score compared to the best specification's runtime estimation. If the new specifications achieves a better runtime estimation, the algorithm assigns it as the best specification. If the new best specification has achieved the desired selectivity, the algorithm terminates. Then, LIGER calls the function refine(), which implements the refinement operator. A new subsumed specification resulted from the refinement is stored iff it does not already exists in total set and its selectivity is higher or equal to the desired selectivity. Finally, the algorithm performs a hierarchical ordering of the specifications in the buffer queue with respect to runtime estimations.- Specified by:
optimizein classPartialRecallRefinementOperator
-
addSpecifications
public void addSpecifications(List<LinkSpecification> specs)
Creates the set of to-be-refined nodes by adding specification that does not already exists in total set and their selectivity is higher or equal to the desired selectivity.- Parameters:
specs- , the input set of unchecked specifications
-
refine
public List<LinkSpecification> refine(LinkSpecification currentSpec)
Implements the refinement operator for guaranteed recall.- Parameters:
currentSpec- , an input specification- Returns:
- a list of refined specifications
-
refineAtomicLinkSpecification
public LinkSpecification refineAtomicLinkSpecification(LinkSpecification currentSpec)
Refines an atomic link specification by calling the next(threshold) function.- Parameters:
currentSpec- ,an input specification- Returns:
- null if the currentSpec can not be refine anymore, or a refined atomic specification
-
merge
public List<LinkSpecification> merge(LinkSpecification parent, List<LinkSpecification> leftChildren, List<LinkSpecification> rightChildren, boolean isLeft)
Creates a set of new specification by cloning the input specification, keeping one child specification as is, and substitutes the other child specification with the set of specification retrieved by refining the other child.- Parameters:
parent- , an input specificationleftChildren- , a set of left (refined) children specificationsrightChildren- , a set of right (refined) children specificationsisLeft- , flag that indicates with child, left or right, has been refined previously- Returns:
- a set of specifications subsumed by the parent specification
-
-