Class AddNegativesRandomly
java.lang.Object
eu.sealsproject.platform.res.tool.impl.AbstractPlugin
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAA
de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.addnegatives.AddNegativesRandomly
- 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
Abstract class which is the base class for all
AddNegatives
which are based on random sampling.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
If true, then all negatives are of the same type e.g.protected boolean
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
If homogenousDraw is true, then all negatives are of the same type e.g.boolean
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 fromsampleModel
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 fromsampleModel
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 homogenousDrawIf true, then all negatives are of the same type e.g. class, property, instance. -
withRepetitions
protected boolean withRepetitionsIf 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 sampledm
- the model corresponding to resourcesampleModel
- the RandomSampleOntModel.- Returns:
- the random sampler.
-
sampleResource
protected String sampleResource(String resource, org.apache.jena.ontology.OntModel m, RandomSampleOntModel sampleModel) Sample a resource fromsampleModel
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 sampledm
- the model corresponding to resourcesampleModel
- 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 fromsampleModel
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 sampledm
- the model corresponding to resourcesampleModel
- 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
-