Class HeliosPlanner
- java.lang.Object
-
- org.aksw.limes.core.execution.planning.planner.Planner
-
- org.aksw.limes.core.execution.planning.planner.HeliosPlanner
-
-
Constructor Summary
Constructors Constructor Description HeliosPlanner(ACache source, ACache target)Constructor of the Helios planner class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetAtomicMappingSizes(String measure, double threshold)Computes atomic mapping sizes for a measure.doublegetAtomicRuntimeCosts(String measure, double threshold)Computes atomic costs for a metric expression.NestedPlangetBestConjunctivePlan(LinkSpecification spec, List<NestedPlan> plans, double selectivity)Computes the left-order best instructionList for a list of plans.NestedPlangetBestConjunctivePlan(LinkSpecification spec, NestedPlan left, List<NestedPlan> plans, double selectivity)Computes the best conjunctive instructionList for a instructionList against a list of plans by calling back the method.NestedPlangetBestConjunctivePlan(LinkSpecification spec, NestedPlan left, NestedPlan right, double selectivity)Find the least costly plan for a link specification with AND operator.doublegetFilterCosts(List<String> measures, int mappingSize)Computes costs for a filtering instruction.booleanisStatic()Returns the status of the planner.LinkSpecificationnormalize(LinkSpecification spec)Normalization of input link specification.NestedPlanplan(LinkSpecification spec)Generates a NestedPlan for a link specification.NestedPlanplan(LinkSpecification spec, ACache source, ACache target, AMapping sourceMapping, AMapping targetMapping)Generates a NestedPlan based on the optimality assumption used in databases.
-
-
-
Field Detail
-
source
public ACache source
Source cache.
-
target
public ACache target
Target cache.
-
lang
public IMapper.Language lang
Language of the source/target data.
-
-
Method Detail
-
getAtomicRuntimeCosts
public double getAtomicRuntimeCosts(String measure, double threshold)
Computes atomic costs for a metric expression. If the metric expression of is not supported by the framework, it throws an InvalidMeasureException exception.- Parameters:
measure- Measure of metric expressionthreshold- Threshold of metric expression- Returns:
- estimated runtime cost of the metric expression
-
getAtomicMappingSizes
public double getAtomicMappingSizes(String measure, double threshold)
Computes atomic mapping sizes for a measure. If the metric expression of is not supported by the framework, it throws an InvalidMeasureException exception.- Parameters:
measure- Measure of metric expressionthreshold- Threshold of metric expression- Returns:
- estimated size of returned mapping
-
getFilterCosts
public double getFilterCosts(List<String> measures, int mappingSize)
Computes costs for a filtering instruction. If the metric expression of the filtering instruction is not supported by the framework, it throws an InvalidMeasureException exception.- Parameters:
measures- The set of expressions used to filtermappingSize- Size of mapping- Returns:
- estimated runtime cost of filteringInstruction(s)
-
plan
public NestedPlan plan(LinkSpecification spec)
Generates a NestedPlan for a link specification.- Parameters:
spec- Input link specification- Returns:
- the corresponding NestedPlan of the input link specification
-
plan
public NestedPlan plan(LinkSpecification spec, ACache source, ACache target, AMapping sourceMapping, AMapping targetMapping)
Generates a NestedPlan based on the optimality assumption used in databases. If the input link specification has an AND operator, then the plan function will find the least costly plan from a set of alternatives (seegetBestConjunctivePlan(org.aksw.limes.core.io.ls.LinkSpecification, java.util.List<org.aksw.limes.core.execution.planning.plan.NestedPlan>, double)}.- Parameters:
spec- Input link specificationsource- Source cachetarget- Target cachesourceMapping- Size of source mappingtargetMapping- Size of target mapping- Returns:
- a NestedPlan for the input link specification
-
getBestConjunctivePlan
public NestedPlan getBestConjunctivePlan(LinkSpecification spec, List<NestedPlan> plans, double selectivity)
Computes the left-order best instructionList for a list of plans. Only needed when AND has more than 2 children. Simply splits the task in computing the best instructionList for (leftmost, all others).- Parameters:
spec- Input link specificationplans- List of plansselectivity- Selectivity of the instructionList (known beforehand)- Returns:
- a NestedPlan of the input link specification
-
getBestConjunctivePlan
public NestedPlan getBestConjunctivePlan(LinkSpecification spec, NestedPlan left, List<NestedPlan> plans, double selectivity)
Computes the best conjunctive instructionList for a instructionList against a list of plans by calling back the method.- Parameters:
spec- Input link specificationleft- Left instructionListplans- List of other plansselectivity- Overall selectivity- Returns:
- a NestedPlan of the input link specification
-
getBestConjunctivePlan
public NestedPlan getBestConjunctivePlan(LinkSpecification spec, NestedPlan left, NestedPlan right, double selectivity)
Find the least costly plan for a link specification with AND operator. Computes all possible nested plans given the children plans: (1) Execute both children plans, perform intersection and filter the resulting mapping using the threshold of the link specification. (2) Execute the plan of the left child, use the right child measure expression as a filer and then filter the resulting mapping using the threshold of the link specification. (3) Execute the plan of the right child, use the left child measure expression as a filer and then filter the resulting mapping using the threshold of the link specification. The selection of the best alternative is based upon runtime estimations obtained for each of the atomic measure expressions included in the children specifications.- Parameters:
spec- The link specificationleft- Left child nested planright- Right child nested planselectivity- , The overall selectivity- Returns:
- the resulting nested plan for the input spec, that is least costly
-
isStatic
public boolean isStatic()
Returns the status of the planner.- Returns:
- true
-
normalize
public LinkSpecification normalize(LinkSpecification spec)
Normalization of input link specification. In case of XOR operator, the output specification uses the extended form of XOR (i.e. XOR(cosine(x.name,y.name)|0.5, overlap(x.label,y.label)|0.6)> =0.8 will transformed into MINUS(OR(cosine(x.name,y.name)|0.5, overlap(x.label,y.label)|0.6)|0.8, AND(cosine(x.name,y.name)|0.5, overlap(x.label,y.label)|0.6)|0.8) )>=0.8- Parameters:
spec- The normalized link specification- Returns:
- the normalized link specification
-
-