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 ScalableStringProcessingMatcher extends MatcherYAAAJena
Matcher which uses different String Matching approaches (stored in PropertySpecificStringProcessing) with a specific confidence. Multiple normalization are possible as shown below. The highest confidence is taken at the end.
Function<String, Object> equality = (text) -> text;
 Function<String, Object> lowercase = (text) -> text.toLowerCase();
 ScalableStringProcessingMatcher matcherOne = new ScalableStringProcessingMatcher(Arrays.asList(
              new PropertySpecificStringProcessing(equality, 1.0, RDFS.label),
              new PropertySpecificStringProcessing(lowercase, 0.9, RDFS.label)
              new PropertySpecificStringProcessing(equality, 0.7, SKOS.altLabel),
              new PropertySpecificStringProcessing(lowercase, 0.6, SKOS.altLabel)
 ));
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • processingElements

    • usedValueExtractors

      protected Set<TextExtractor> usedValueExtractors
    • matchClasses

      protected boolean matchClasses
    • matchProperties

      protected boolean matchProperties
    • matchInstances

      protected boolean matchInstances
    • earlyStopping

      protected boolean earlyStopping
    • crossIndexMatch

      protected boolean crossIndexMatch
    • matchableResourceIterators

      protected List<Function<org.apache.jena.ontology.OntModel,Iterator<? extends org.apache.jena.rdf.model.Resource>>> matchableResourceIterators
      A list of fucntions which gets an ontModel and returns an iterator over elements which should be matched like classes, instances, proeprties etc.
  • Constructor Details

  • 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.
    • matchResources

      public void matchResources(Iterator<? extends org.apache.jena.rdf.model.Resource> sourceResources, Iterator<? extends org.apache.jena.rdf.model.Resource> targetResources, Alignment alignment)
    • buildLevenshteinIndex

      private Map<PropertySpecificStringProcessingMultipleReturn,com.github.liblevenshtein.transducer.ITransducer> buildLevenshteinIndex(Map<PropertySpecificStringProcessingMultipleReturn,Map<Object,Set<String>>> index)
    • getLiterals

      protected Set<String> getLiterals(PropertySpecificStringProcessingMultipleReturn processing, Map<TextExtractor,Set<String>> valueMap)
    • extractAllValues

      protected Map<TextExtractor,Set<String>> extractAllValues(org.apache.jena.rdf.model.Resource r)
    • isObjectEmpty

      protected boolean isObjectEmpty(Object o)
    • isMatchClasses

      public boolean isMatchClasses()
    • setMatchClasses

      public void setMatchClasses(boolean matchClasses)
    • isMatchProperties

      public boolean isMatchProperties()
    • setMatchProperties

      public void setMatchProperties(boolean matchProperties)
    • isMatchInstances

      public boolean isMatchInstances()
    • setMatchInstances

      public void setMatchInstances(boolean matchInstances)
    • isEarlyStopping

      public boolean isEarlyStopping()
    • setEarlyStopping

      public void setEarlyStopping(boolean earlyStopping)
    • isCrossIndexMatch

      public boolean isCrossIndexMatch()
    • setCrossIndexMatch

      public void setCrossIndexMatch(boolean crossIndexMatch)
    • addMatchType

      public void addMatchType(Function<org.apache.jena.ontology.OntModel,Iterator<? extends org.apache.jena.rdf.model.Resource>> f)
      Adds a function which gets an ontModel and returns an iterator over elements which should be matched like classes, instances, properties etc.
      Parameters:
      f - a function which gets an ontModel and returns an iterator over elements which should be matched