All Implemented Interfaces:
Filter, IMatcher<org.apache.jena.ontology.OntModel,Alignment,Properties>, eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge, eu.sealsproject.platform.res.tool.api.IPlugin, eu.sealsproject.platform.res.tool.api.IToolBridge

public class TopXFilter extends MatcherYAAAJena implements Filter
This filter keeps only the top X correspondences according to confidence. The filter can be configured to be source-based (keep only the top X correspondences for each source node). The filter can be configured to be target-based (keep only the top X correspondences for each target node). The filter can be configured to be size-based (based on the smaller or larger side of the alignment).
  • Field Details

  • Constructor Details

    • TopXFilter

      public TopXFilter(int x, TopXFilter.TopFilterMode filterMode, double threshold)
      Default Constructor
      x - X
      filterMode - The filter mode.
      threshold - The desired threshold. Use 0.0d if you do not want to use threshold filtering.
    • TopXFilter

      public TopXFilter(int x)
    • TopXFilter

      public TopXFilter(int x, double threshold)
    • TopXFilter

      public TopXFilter(int x, TopXFilter.TopFilterMode mode)
  • Method Details

    • match

      public Alignment match(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment, Properties properties) throws Exception
      Description copied from class: MatcherYAAAJena
      Aligns two ontologies specified via a Jena OntModel, with an input alignment as Alignment object, and returns the mapping of the resulting alignment. Note: This method might be called multiple times in a row when using the evaluation framework. Make sure to return a mapping which is specific to the given inputs.
      Specified by:
      match in interface IMatcher<org.apache.jena.ontology.OntModel,Alignment,Properties>
      Specified by:
      match in class MatcherYAAAJena
      source - This OntModel represents the source ontology.
      target - This OntModel represents the target ontology.
      inputAlignment - This mapping represents the input alignment.
      properties - Additional properties.
      The resulting alignment of the matching process.
      Exception - Any exception which occurs during matching.
    • filter

      public Alignment filter(Alignment alignment)
      Filters the given alignment such that there are only the top X correspondences (according to confidence) for every source node.
      alignment - The initial alignment.
      The filtered alignment.
    • getIteratorSize

      private <T> int getIteratorSize(Iterator<T> iterator)
    • filterTopX

      private Alignment filterTopX(Iterator<Correspondence> iterator)
    • getThreshold

      public double getThreshold()
    • setThreshold

      public void setThreshold(double threshold)
    • getX

      public int getX()
    • setX

      public void setX(int x)
    • getFilterMode

      public TopXFilter.TopFilterMode getFilterMode()
    • setFilterMode

      public void setFilterMode(TopXFilter.TopFilterMode filterMode)