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 MatchClassBasedOnInstances extends MatcherYAAAJena
A matcher which matches classes based on already instance matches.
See Also:
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • instanceToHierarchyProperty

      protected org.apache.jena.rdf.model.Property instanceToHierarchyProperty
      Property connecting the instance to the hierarhcy (usually rdf:type).
    • threshold

      private double threshold
      Threshold for metric. Values by metric larger than the threshold will be a match.
    • metric

      private SimInstanceMetric metric
      Metric to be used.
    • instanceMinConfidence

      private double instanceMinConfidence
      What is an instance match? -> Minimal confidence for instance matches.
    • debugFile

      private File debugFile
      If set, all metrics will be logged.
  • Constructor Details

    • MatchClassBasedOnInstances

      public MatchClassBasedOnInstances(org.apache.jena.rdf.model.Property instanceToHierarchyProperty, File debugFile)
      Constructor for matching and writing a debug file.
      Parameters:
      instanceToHierarchyProperty - Property connecting the instance to the hierarhcy like rdf:type
      debugFile - debug file
    • MatchClassBasedOnInstances

      public MatchClassBasedOnInstances(org.apache.jena.rdf.model.Property instanceToHierarchyProperty, double threshold, SimInstanceMetric metric, double instanceMinConfidence)
      Constructor.
      Parameters:
      instanceToHierarchyProperty - Property connecting the instance to the hierarhcy like rdf:type
      threshold - the threshold for metric. Values by metric larger than the threshold will be a match.
      metric - the metric for class comparison
      instanceMinConfidence - minimal confidence for instance matches
    • MatchClassBasedOnInstances

      public MatchClassBasedOnInstances(double threshold, SimInstanceMetric metric, double instanceMinConfidence)
      Constructor.
      Parameters:
      threshold - the threshold for metric. Values by metric larger than the threshold will be a match.
      metric - the metric for class comparison
      instanceMinConfidence - minimal confidence for instance matches
    • MatchClassBasedOnInstances

      public MatchClassBasedOnInstances(double threshold, SimInstanceMetric metric)
      Constructor.
      Parameters:
      threshold - the threshold for metric. Values by metric larger than the threshold will be a match.
      metric - the metric for class comparison
  • 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
      Parameters:
      source - This OntModel represents the source ontology.
      target - This OntModel represents the target ontology.
      inputAlignment - This mapping represents the input alignment.
      properties - Additional properties.
      Returns:
      The resulting alignment of the matching process.
      Throws:
      Exception - Any exception which occurs during matching.
    • getClassMatches

      public Alignment getClassMatches(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment) throws IOException
      Throws:
      IOException
    • getSimValueBase

      private double getSimValueBase(int instancesOverlap, int instancesOne, int instancesTwo)
    • getSimValueMin

      private double getSimValueMin(int instancesOverlap, int instancesOne, int instancesTwo)
    • getSimValueDice

      private double getSimValueDice(int instancesOverlap, int instancesOne, int instancesTwo)
    • getSimValueMatchBased

      private double getSimValueMatchBased(int instancesOverlap, int allMatchedInstances)
    • saveValuesToFile

      private void saveValuesToFile(Map<Correspondence,MatchClassBasedOnInstances.ClassMatchInfo> classAlignment, Map<String,Integer> instanceCounts, int instanceMappings) throws IOException
      Throws:
      IOException
    • getInstancesOfClass

      private Set<org.apache.jena.rdf.model.Resource> getInstancesOfClass(org.apache.jena.rdf.model.Resource clazz)
    • getClassesOfInstance

      private Set<String> getClassesOfInstance(org.apache.jena.rdf.model.Resource resource)
    • getThreshold

      public double getThreshold()
    • setThreshold

      public void setThreshold(double threshold)
    • getMetric

      public SimInstanceMetric getMetric()
    • setMetric

      public void setMetric(SimInstanceMetric metric)
    • getInstanceMinConfidence

      public double getInstanceMinConfidence()
    • setInstanceMinConfidence

      public void setInstanceMinConfidence(double instanceMinConfidence)
    • getDebugFile

      public File getDebugFile()
    • setDebugFile

      public void setDebugFile(File debugFile)