Class LinearFilter
- java.lang.Object
-
- org.aksw.limes.core.execution.engine.filter.LinearFilter
-
-
Constructor Summary
Constructors Constructor Description LinearFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AMappingfilter(AMapping map, double threshold)Naive filter function for mapping using a threshold as filtering criterion.AMappingfilter(AMapping map, String condition, double threshold, double mainThreshold, ACache source, ACache target, String sourceVar, String targetVar)Filter function for mapping using a condition and two thresholds as filtering criterion.AMappingfilter(AMapping map, String condition, double threshold, ACache source, ACache target, String sourceVar, String targetVar)Filter function for mapping using a condition and a threshold as filtering criterion.AMappingfilter(AMapping map1, AMapping map2, double coef1, double coef2, double threshold, String operation)Filter for linear combinations when operation is set to "add", given the expression a*sim1 + b*sim2 >= t or multiplication given the expression (a*sim1)*(b*sim2) >= t, which is not likely to be used.AMappingreversefilter(AMapping map, String condition, double threshold, double mainThreshold, ACache source, ACache target, String sourceVar, String targetVar)Reverse filter function for mapping using a condition and two thresholds as filtering criterion.
-
-
-
Method Detail
-
filter
public AMapping filter(AMapping map, double threshold)
Naive filter function for mapping using a threshold as filtering criterion. The output mapping includes set of links from the initial mapping that have a similarity above the input threshold.
-
filter
public AMapping filter(AMapping map, String condition, double threshold, ACache source, ACache target, String sourceVar, String targetVar)
Filter function for mapping using a condition and a threshold as filtering criterion. The output mapping includes set of links from the initial mapping whose similarity based on the input condition is above the input threshold.- Specified by:
filterin interfaceIFilter- Parameters:
map- Map bearing the results of Link Specificationcondition- The condition for filteringthreshold- Value of thresholdsource- Source knowledge basetarget- Target knowledge basesourceVar- Source propertytargetVar- Target property- Returns:
- a filtered mapping that satisfies both the condition and the threshold
-
filter
public AMapping filter(AMapping map, String condition, double threshold, double mainThreshold, ACache source, ACache target, String sourceVar, String targetVar)
Filter function for mapping using a condition and two thresholds as filtering criterion. Used by HELIOS/DYNAMIC planner in case of an AND optimization strategy. The input mapping produced by executing one of the children specifications of a specification with an AND operator, will be filtered using the expression and the threshold of the other child. In order for a link to be included in the output mapping, it must also fulfill the input condition and have an initial similarity above the mainThreshold.- Specified by:
filterin interfaceIFilter- Parameters:
map- map bearing the results of Link Specificationcondition- The condition for filteringthreshold- Value of the first thresholdmainThreshold- Value of second thresholdsource- Source knowledge basetarget- Target knowledge basesourceVar- Source propertytargetVar- Target property- Returns:
- a filtered mapping that satisfies both the condition and the thresholds
-
reversefilter
public AMapping reversefilter(AMapping map, String condition, double threshold, double mainThreshold, ACache source, ACache target, String sourceVar, String targetVar)
Reverse filter function for mapping using a condition and two thresholds as filtering criterion. Used by DYNAMIC planner in case of an MINUS optimization strategy. The input mapping produced by executing the left child of a specification with a MINUS operator, will be filtered by the expression and the threshold of the right child. In order for a link to be included in the output mapping, it must not fulfill the input condition and its initial similarity must be above the mainThreshold.- Specified by:
reversefilterin interfaceIFilter- Parameters:
map- Map bearing the results of Link Specificationcondition- The condition for filteringthreshold- Value of the first thresholdmainThreshold- Value of second thresholdsource- Source knowledge basetarget- Target knowledge basesourceVar- Source propertytargetVar- Target property- Returns:
- a filtered mapping that satisfies both the condition and the thresholds
-
filter
public AMapping filter(AMapping map1, AMapping map2, double coef1, double coef2, double threshold, String operation)
Filter for linear combinations when operation is set to "add", given the expression a*sim1 + b*sim2 >= t or multiplication given the expression (a*sim1)*(b*sim2) >= t, which is not likely to be used. Implements a filter for the special case of linear combinations and multiplications. The straight forward way would be to compute filter(intersection(m1, m2), linear_combination_condition) leading to re-computations. This implementation avoid that by reusing the similarities that have already been computed.- Specified by:
filterin interfaceIFilter- Parameters:
map1- Map bearing the results of sim1 >= (t-b)/a for add, sim1 >= t/(a*b) for multmap2- Map bearing the results of sim2 >= (t-a)/b for add, sim2 >= t/(a*b) for multcoef1- Value of first coefficientcoef2- Value of second coefficientthreshold- Value of thresholdoperation- Mathematical operation- Returns:
- a filtered mapping that satisfies a*sim1 + b*sim2 >= t for add, (a*sim1)*(b*sim2) >= t for mult
-
-