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
Direct Known Subclasses:
AddNegativesRandomlyAbsolute, AddNegativesRandomlyOneOneAssumption, AddNegativesRandomlyShare

public abstract class AddNegativesRandomly
extends MatcherYAAAJena
implements AddNegatives
Abstract class which is the base class for all AddNegatives which are based on random sampling.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected boolean homogenousDraw
    If true, then all negatives are of the same type e.g.
    protected boolean withRepetitions
    If true, then it will samples random elements which can also appear multiple times in different correspondences.

    Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile

    FILE_PREFIX, FILE_SUFFIX
  • Constructor Summary

    Constructors
    Constructor Description
    AddNegativesRandomly​(boolean homogenousDraw, boolean withRepetitions)  
  • Method Summary

    Modifier and Type Method Description
    protected RandomSampleSet<String> getSampler​(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel)
    Returns the correct sampler for the given resource contained in given model.
    boolean isHomogenousDraw()
    If homogenousDraw is true, then all negatives are of the same type e.g.
    boolean isWithRepetitions()
    If true, then it will samples random elements which can also appear multiple times in different correspondences.
    protected String sampleResource​(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel)
    Sample a resource from sampleModel given the resource in model m.
    protected String sampleResource​(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel, Set<String> excludes)
    Sample a resource from sampleModel given the resource in model m.
    void setHomogenousDraw​(boolean homogenousDraw)
    Sets the homogenousDraw value.
    void setWithRepetitions​(boolean withRepetitions)
    If set to true, then it will samples random elements which can also appear multiple times in different correspondences.

    Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena

    getModelSpec, match, match, readOntology

    Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAA

    match

    Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile

    match

    Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL

    align, align, canExecute, getType

    Methods inherited from class eu.sealsproject.platform.res.tool.impl.AbstractPlugin

    getId, getVersion, setId, setVersion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface eu.sealsproject.platform.res.tool.api.IPlugin

    getId, getVersion
  • Field Details

    • homogenousDraw

      protected boolean homogenousDraw
      If true, then all negatives are of the same type e.g. class, property, instance.
    • withRepetitions

      protected boolean withRepetitions
      If true, then it will samples random elements which can also appear multiple times in different correspondences. If false, then all sampled entities for e.g. the target ontology will not contain any entities which are already used in the alignment or are randomly sampled before.
  • Constructor Details

    • AddNegativesRandomly

      public AddNegativesRandomly​(boolean homogenousDraw, boolean withRepetitions)
  • Method Details

    • getSampler

      protected RandomSampleSet<String> getSampler​(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel)
      Returns the correct sampler for the given resource contained in given model. In case homogenousDraw is set to true, it will sample from same same entity e.g. sample a class for a class.
      Parameters:
      resource - the resource to check which concept type should be sampled
      m - the model corresponding to resource
      sampleModel - the RandomSampleOntModel.
      Returns:
      the random sampler.
    • sampleResource

      protected String sampleResource​(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel)
      Sample a resource from sampleModel given the resource in model m. In case homogenousDraw is set to true, it will sample from same same entity e.g. sample a class for a class.
      Parameters:
      resource - the resource to check which concept type should be sampled
      m - the model corresponding to resource
      sampleModel - the model to sample from.
      Returns:
      the random element.
    • sampleResource

      protected String sampleResource​(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel, Set<String> excludes)
      Sample a resource from sampleModel given the resource in model m. In case homogenousDraw is set to true, it will sample from same same entity e.g. sample a class for a class. It will exclude
      Parameters:
      resource - the resource to check which concept type should be sampled
      m - the model corresponding to resource
      sampleModel - the model to sample from.
      excludes - the set contains elements which should not be chosen as a random sample.
      Returns:
      the random element.
    • isHomogenousDraw

      public boolean isHomogenousDraw()
      If homogenousDraw is true, then all negatives are of the same type e.g. class, property, instance.
      Returns:
      true, if all negatives are of the same type e.g. class, property, instance.
    • setHomogenousDraw

      public void setHomogenousDraw​(boolean homogenousDraw)
      Sets the homogenousDraw value. If true, all negatives are of the same type e.g. class, property, instance.
      Parameters:
      homogenousDraw - true, if all negatives are of the same type e.g. class, property, instance.
    • isWithRepetitions

      public boolean isWithRepetitions()
      If true, then it will samples random elements which can also appear multiple times in different correspondences. If false, then all sampled entities for e.g. the target ontology will not contain any entities which are already used in the alignment or are randomly sampled before.
      Returns:
      true, if with repetitions
    • setWithRepetitions

      public void setWithRepetitions​(boolean withRepetitions)
      If set to true, then it will samples random elements which can also appear multiple times in different correspondences. If false, then all sampled entities for e.g. the target ontology will not contain any entities which are already used in the alignment or are randomly sampled before.
      Parameters:
      withRepetitions - true, if with repetitions