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 SimilarNeighboursFilter extends BaseFilterWithSetComparison
Checks for each instance mapping, how many already matched neighbours it has.
 Source_Subject ------Source_Property------Source_Object
      |                                         |
 subjectCorrespondence                     objectCorrespondence
      |                                         |
 Target_Subject ------Target_Property------Target_Object
 
  • Field Details

    • minResourceConfidence

      private double minResourceConfidence
      The minimum confidence for which a resource(neighbour) mapping is counted. Compared with greater or equal.
    • shouldPropertyBeCounted

      private Predicate<org.apache.jena.rdf.model.Property> shouldPropertyBeCounted
      Predicate to decide which properties should be counted.
    • literalProcessingFunction

      private Function<org.apache.jena.rdf.model.Literal,Object> literalProcessingFunction
      A function which processes a literal and returns some comparable (equals/hashCode) representation (usually a normalized text).
    • excludeNeighbours

      private Function<org.apache.jena.rdf.model.Resource,Set<Object>> excludeNeighbours
      A function which returns a set of elements (uri as string and/or text filtered with literalprocessing function) which should be ignored.
    • useIngoing

      private boolean useIngoing
    • useOutgoing

      private boolean useOutgoing
    • useResource

      private boolean useResource
    • useLiteral

      private boolean useLiteral
    • addNeighboursToCorrespondence

      private boolean addNeighboursToCorrespondence
  • Constructor Details

    • SimilarNeighboursFilter

      public SimilarNeighboursFilter(double minResourceConfidence, Predicate<org.apache.jena.rdf.model.Property> shouldPropertyBeCounted, Function<org.apache.jena.rdf.model.Literal,Object> literalProcessingFunction, Function<org.apache.jena.rdf.model.Resource,Set<Object>> excludeNeighbours, boolean useIngoing, boolean useOutgoing, boolean useResource, boolean useLiteral, double threshold, SetSimilarity setSimilarity)
      Constructor
      Parameters:
      minResourceConfidence - the confidence for which a neighbour is counted as a mapping (greater or equal).
      shouldPropertyBeCounted - Predicate to decide which properties should be counted.
      literalProcessingFunction - A function which processes a literal and returns some comparable (equals/hashCode) representation (usually a normalized text) .
      excludeNeighbours - A function which returns a set of elements (uri as string and/or text filtered with literalprocessing function) which should be ignored.
      useIngoing - use ingoing edges
      useOutgoing - use outgoing edges
      useResource - use resources
      useLiteral - use literals
      threshold - The filtering threshold which should be larger or equal to be a valid match. Computation is based on set similarity.
      setSimilarity - The set similarity to choose when computing similarity value between the two distinct property sets.
    • SimilarNeighboursFilter

      public SimilarNeighboursFilter(double minResourceConfidence, Predicate<org.apache.jena.rdf.model.Property> shouldPropertyBeCounted, Function<org.apache.jena.rdf.model.Literal,Object> literalProcessingFunction, Function<org.apache.jena.rdf.model.Resource,Set<Object>> excludeNeighbours, double threshold, SetSimilarity setSimilarity)
      Constructor which uses ingoing and outgoing edges as well as resources and literals.
      Parameters:
      minResourceConfidence - the confidence for which a neighour is counted as a mapping (greater or equal).
      shouldPropertyBeCounted - Predicate to decide which properties should be counted.
      literalProcessingFunction - A function which processes a literal and returns some comparable (equals/hashCode) representation (usually a normalized text) .
      excludeNeighbours - A function which returns a set of elements (uri and text) which should be ignored.
      threshold - The filtering threshold which should be larger or equal to be a valid match. Computation is based on set similarity.
      setSimilarity - The set similarity to choose when computing similarity value between the two distinct property sets.
    • SimilarNeighboursFilter

      public SimilarNeighboursFilter(double minResourceConfidence, Predicate<org.apache.jena.rdf.model.Property> shouldPropertyBeCounted, double threshold, SetSimilarity setSimilatity)
      Constructor
      Parameters:
      minResourceConfidence - the confidence for which a neighbour is counted as a mapping (greater or equal).
      shouldPropertyBeCounted - Predicate to decide which properties should be counted.
      threshold - The filtering threshold which should be larger or equal to be a valid match. Computation is based on set similarity.
      setSimilatity - The set similarity to choose when computing similarity value between the two distinct property sets.
    • SimilarNeighboursFilter

      public SimilarNeighboursFilter(Function<org.apache.jena.rdf.model.Literal,Object> literalProcessingFunction, double threshold, SetSimilarity setSimilatity)
    • SimilarNeighboursFilter

      public SimilarNeighboursFilter(double threshold, SetSimilarity setSimilarity)
    • SimilarNeighboursFilter

      public SimilarNeighboursFilter()
  • 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.
    • getNeighbours

      private Neighbours getNeighbours(org.apache.jena.ontology.OntModel model, org.apache.jena.ontology.Individual individual)
    • getMinResourceConfidence

      public double getMinResourceConfidence()
    • setMinResourceConfidence

      public void setMinResourceConfidence(double minResourceConfidence)
    • getShouldPropertyBeCounted

      public Predicate<org.apache.jena.rdf.model.Property> getShouldPropertyBeCounted()
    • setShouldPropertyBeCounted

      public void setShouldPropertyBeCounted(Predicate<org.apache.jena.rdf.model.Property> shouldPropertyBeCounted)
    • getLiteralProcessingFunction

      public Function<org.apache.jena.rdf.model.Literal,Object> getLiteralProcessingFunction()
    • setLiteralProcessingFunction

      public void setLiteralProcessingFunction(Function<org.apache.jena.rdf.model.Literal,Object> literalProcessingFunction)
    • isUseIngoing

      public boolean isUseIngoing()
    • setUseIngoing

      public void setUseIngoing(boolean useIngoing)
    • isUseOutgoing

      public boolean isUseOutgoing()
    • setUseOutgoing

      public void setUseOutgoing(boolean useOutgoing)
    • isUseResource

      public boolean isUseResource()
    • setUseResource

      public void setUseResource(boolean useResource)
    • isUseLiteral

      public boolean isUseLiteral()
    • setUseLiteral

      public void setUseLiteral(boolean useLiteral)
    • isAddNeighboursToCorrespondence

      public boolean isAddNeighboursToCorrespondence()
    • setAddNeighboursToCorrespondence

      public void setAddNeighboursToCorrespondence(boolean addNeighboursToCorrespondence)
    • createExcludeNeighboursFunction

      public static Function<org.apache.jena.rdf.model.Resource,Set<Object>> createExcludeNeighboursFunction(Set<org.apache.jena.rdf.model.Property> excludeLiteralProeprties, Function<org.apache.jena.rdf.model.Literal,Object> literalProcessingFunction)
    • toString

      public String toString()
      Overrides:
      toString in class Object