java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.multisource.clustering.FilterByErrorDegree
All Implemented Interfaces:
Filter, IMatcherMultiSource<Object,Alignment,Object>

public class FilterByErrorDegree extends Object implements IMatcherMultiSource<Object,Alignment,Object>, Filter
This filter of correspondences is based on the community structure of the correspondences. E.g. if many entities are fully connected, then this indicates that all of those correspondences are correct. But if tehre are some weakly connected entites, then this might indicate wrong correspondences.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • threshold

      private double threshold
    • algorithm

      private ModularityAlgorithm algorithm
    • modularityFunction

      private int modularityFunction
    • resolution

      private double resolution
    • randomSeed

      private long randomSeed
    • nRandomStarts

      private int nRandomStarts
    • nIterations

      private int nIterations
  • Constructor Details

    • FilterByErrorDegree

      public FilterByErrorDegree()
      Does not filter but just add the confidence with the standard algorithm.
    • FilterByErrorDegree

      public FilterByErrorDegree(double threshold)
    • FilterByErrorDegree

      public FilterByErrorDegree(ModularityAlgorithm algorithm)
      Does not filter but just add the confidence.
      Parameters:
      algorithm - the algorithm to use.
    • FilterByErrorDegree

      public FilterByErrorDegree(double threshold, ModularityAlgorithm algorithm)
      Constructor with threshold and algorithm.
      Parameters:
      threshold - set the threshold below 0 to not filter.
      algorithm - the algorithm to use
    • FilterByErrorDegree

      public FilterByErrorDegree(double threshold, ModularityAlgorithm algorithm, int modularityFunction, double resolution, long randomSeed, int nRandomStarts, int nIterations)
      Constructor with all parameters. Set threshold smaller zero to not filter.
      Parameters:
      threshold - the threshold
      algorithm - algorithm
      modularityFunction - modularityFunction
      resolution - resolution
      randomSeed - randomSeed
      nRandomStarts - nRandomStarts
      nIterations - nIterations
  • Method Details

    • match

      public Alignment match(List<Object> models, Alignment inputAlignment, Object parameters) throws Exception
      Description copied from interface: IMatcherMultiSource
      Matches multiple ontologies / knowledge graphs together.
      Specified by:
      match in interface IMatcherMultiSource<Object,Alignment,Object>
      Parameters:
      models - a list of ontologies / knowledge graphs in the desired format.
      inputAlignment - this object represents the input alignment.
      parameters - object representing additional parameters. Only add to this object and do not create a new Object like parameters= new ...() because otherwise the parameters are lost (java ist call by value). Sensible classes are Properties, Map<String, Object> or any similar data structure. Some already specified keys (strings) can be found at ParameterConfigKeys.
      Returns:
      the resulting alignment of the matching process.
      Throws:
      Exception - in case of any errors
    • filter

      public Alignment filter(Alignment alignment)
    • addConfidence

      public Alignment addConfidence(Alignment alignment)
    • getErrorValue

      private static Double getErrorValue(Map<Map.Entry<String,String>,Double> map, Correspondence correspondence)
    • analyzeErrDistribution

      public void analyzeErrDistribution(Alignment alignment, File file)
      Write a tsv file which contains the err value in the first column and the number of correspondences with this value as a second column. This helps to find out the right threshold.
      Parameters:
      alignment - the alignemnt to analyze
      file - the file to write to.