Class LinearFilter

  • All Implemented Interfaces:
    IFilter

    public class LinearFilter
    extends Object
    implements IFilter
    Implements the linear filter class.
    Version:
    1.0
    Author:
    Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
    • Constructor Detail

      • LinearFilter

        public LinearFilter()
    • 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.
        Specified by:
        filter in interface IFilter
        Parameters:
        map - Map bearing the results of Link Specification
        threshold - Value of threshold
        Returns:
        a filtered mapping that satisfies sim >= 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:
        filter in interface IFilter
        Parameters:
        map - Map bearing the results of Link Specification
        condition - The condition for filtering
        threshold - Value of threshold
        source - Source knowledge base
        target - Target knowledge base
        sourceVar - Source property
        targetVar - 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:
        filter in interface IFilter
        Parameters:
        map - map bearing the results of Link Specification
        condition - The condition for filtering
        threshold - Value of the first threshold
        mainThreshold - Value of second threshold
        source - Source knowledge base
        target - Target knowledge base
        sourceVar - Source property
        targetVar - 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:
        reversefilter in interface IFilter
        Parameters:
        map - Map bearing the results of Link Specification
        condition - The condition for filtering
        threshold - Value of the first threshold
        mainThreshold - Value of second threshold
        source - Source knowledge base
        target - Target knowledge base
        sourceVar - Source property
        targetVar - 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:
        filter in interface IFilter
        Parameters:
        map1 - Map bearing the results of sim1 >= (t-b)/a for add, sim1 >= t/(a*b) for mult
        map2 - Map bearing the results of sim2 >= (t-a)/b for add, sim2 >= t/(a*b) for mult
        coef1 - Value of first coefficient
        coef2 - Value of second coefficient
        threshold - Value of threshold
        operation - Mathematical operation
        Returns:
        a filtered mapping that satisfies a*sim1 + b*sim2 >= t for add, (a*sim1)*(b*sim2) >= t for mult