All Implemented Interfaces:
AddNegatives, 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 AddNegativesViaAlignment extends MatcherYAAAJena implements AddNegatives
This component adds negative correspondences to the input alignment via an alignment (generated by a recall optimized matcher). This matcher is only suitable if the whole matching system is executed only for one test case. Why? Because the alignment (which is test case specific) need to be passed in the constructor. Thus it will only give useful results if only used for the correct test case. The input alignment should contain positive correspondences. The negatives are generated by looking at the provided alignment in the constructor. All correspondences which are contained in the input alignment (ground truth) and in the given alignment (which has a high recall - meaning many correspondences) are assumned to be positives and all others correspondences which maps a concept of the positive correspondence to another concept are assumed to be negatives. The returned alignment consists of positives (= relation) and negatives (% incompat relation) which can be used to train supervised matchers.
  • Field Details

    • recallAlignment

      private Alignment recallAlignment
  • Constructor Details

    • AddNegativesViaAlignment

      public AddNegativesViaAlignment(Alignment recallAlignment)
      Constructor with requires the recall alignment.
      Parameters:
      recallAlignment - the recall alignment should contain many correpondences (high recall).
  • Method Details

    • match

      public Alignment match(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment, Properties parameters) 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
      Parameters:
      source - This OntModel represents the source ontology.
      target - This OntModel represents the target ontology.
      inputAlignment - This mapping represents the input alignment.
      parameters - Additional properties.
      Returns:
      The resulting alignment of the matching process.
      Throws:
      Exception - Any exception which occurs during matching.
    • getRecallAlignment

      public Alignment getRecallAlignment()
    • setRecallAlignment

      public void setRecallAlignment(Alignment recallAlignment)
    • addNegatives

      public static Alignment addNegatives(Alignment recallAlignment, Alignment referenceAlignment)
      This method returns a training alignment based on a recall alignment and a reference alignment. The training alignment is generated by getting all correspondences in the recall alignment where at least one part is also contained in the reference alignment. If the correspondence is directly in the reference alignment, then it is assumed to be a positive example. If only one part of the correspondence is in the reference alignment, then is is assumed to be a negative correspondence. The result contains the correspondences from the recall alignment, where positive examples have the equivalence relation and negative examples have INCOMPAT relation.
      Parameters:
      recallAlignment - recall alignment
      referenceAlignment - reference alignment which does not need to really be the reference alignment of a track.
      Returns:
      the correspondences from the recall alignment, where positive examples have the equivalence relation and negative examples have INCOMPAT relation