All Implemented Interfaces:
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 OpenEAMatcher extends MatcherYAAAJena
This matching module uses the OpenEA library to match entities. It uses all correspondences which are provided through either the constructor or match method(inputalignment) with equivalence relation to train the approach. It only need positive correspondences and samples negative correspondences on its own.
If you apply your own configuration you can use the parameters from openEA and also the following additional parameters:
  • predict_top_k - the number of matching entities which should at least retrived for one single entity
  • predict_min_sim_value - the similarity measure which should be applied for every correspondence. All sim values are greater than the given one (not equal or greater).
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • KB1_ENTITY_EMBEDDING

      public static final String KB1_ENTITY_EMBEDDING
      Map of URIs (String) to double array. This represents the entities embeddings generated by openea for the left entities.
      See Also:
    • KB2_ENTITY_EMBEDDING

      public static final String KB2_ENTITY_EMBEDDING
      Map of URIs (String) to double array. This represents the entities embeddings generated by openea for the right entities.
      See Also:
    • baseDirectory

      private File baseDirectory
      The base directory where all files are written. In this folder, another folder with a random number is created to allow parallel execution of this matcher.
    • fractionTrainCorrespondences

      private double fractionTrainCorrespondences
      The fraction how many correspondences belongt to train (rest to validation).
    • randomSeed

      private long randomSeed
    • config

      private OpenEAConfiguration config
    • loadEmbeddings

      private boolean loadEmbeddings
    • CONTROL_CODE_PATTERN

      private static Pattern CONTROL_CODE_PATTERN
  • Constructor Details

    • OpenEAMatcher

      public OpenEAMatcher(File baseDirectory, OpenEAConfiguration config, boolean loadEmbeddings, double fractionTrainCorrespondences, long randomSeed)
      Constructor which sets all variables.
      Parameters:
      baseDirectory - the base directory where all files are written. In this folder, another folder with a random number is created to allow parallel execution of this matcher.
      config - the configuration for the model
      loadEmbeddings - true if also the embeddings should be loaded.
      fractionTrainCorrespondences - the fraction of training correspondences
      randomSeed - the random seed for splitting the alignment into train and validation alignment.
    • OpenEAMatcher

      public OpenEAMatcher(OpenEAConfiguration config, double fractionTrainCorrespondences, long randomSeed)
      Constructor with the config for training.
      Parameters:
      config - the configuration for the model
      fractionTrainCorrespondences - the fraction of training correspondences
      randomSeed - the random seed for splitting the alignment into train and validation alignment.
    • OpenEAMatcher

      public OpenEAMatcher()
      Makes a 80/20 train validation split and uses the default configuration and base folder.
  • Method Details

    • getDefaultConfig

      public static OpenEAConfiguration getDefaultConfig()
    • match

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

      protected void writeTrainValAlignments(Alignment a, File alignmentFolder) throws IOException
      Throws:
      IOException
    • writeCorrespondences

      protected void writeCorrespondences(List<Correspondence> correspondences, File file) throws IOException
      Throws:
      IOException
    • writeKnowledgeGraphToFile

      protected void writeKnowledgeGraphToFile(org.apache.jena.rdf.model.Model m, File relTriples, File attrTriples) throws IOException
      Throws:
      IOException