Class MatchClassBasedOnInstances
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.instancelevel.MatchClassBasedOnInstances
- 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
A matcher which matches classes based on already instance matches.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate File
If set, all metrics will be logged.private double
What is an instance match? -> Minimal confidence for instance matches.protected org.apache.jena.rdf.model.Property
Property connecting the instance to the hierarhcy (usually rdf:type).private static final org.slf4j.Logger
private SimInstanceMetric
Metric to be used.private double
Threshold for metric.Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
ConstructorDescriptionMatchClassBasedOnInstances
(double threshold, SimInstanceMetric metric) Constructor.MatchClassBasedOnInstances
(double threshold, SimInstanceMetric metric, double instanceMinConfidence) Constructor.MatchClassBasedOnInstances
(org.apache.jena.rdf.model.Property instanceToHierarchyProperty, double threshold, SimInstanceMetric metric, double instanceMinConfidence) Constructor.MatchClassBasedOnInstances
(org.apache.jena.rdf.model.Property instanceToHierarchyProperty, File debugFile) Constructor for matching and writing a debug file. -
Method Summary
Modifier and TypeMethodDescriptiongetClassesOfInstance
(org.apache.jena.rdf.model.Resource resource) getClassMatches
(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment) double
private Set<org.apache.jena.rdf.model.Resource>
getInstancesOfClass
(org.apache.jena.rdf.model.Resource clazz) private double
getSimValueBase
(int instancesOverlap, int instancesOne, int instancesTwo) private double
getSimValueDice
(int instancesOverlap, int instancesOne, int instancesTwo) private double
getSimValueMatchBased
(int instancesOverlap, int allMatchedInstances) private double
getSimValueMin
(int instancesOverlap, int instancesOne, int instancesTwo) double
match
(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment, Properties properties) Aligns two ontologies specified via a Jena OntModel, with an input alignment as Alignment object, and returns the mapping of the resulting alignment.private void
saveValuesToFile
(Map<Correspondence, MatchClassBasedOnInstances.ClassMatchInfo> classAlignment, Map<String, Integer> instanceCounts, int instanceMappings) void
setDebugFile
(File debugFile) void
setInstanceMinConfidence
(double instanceMinConfidence) void
setMetric
(SimInstanceMetric metric) void
setThreshold
(double threshold) Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena
getModelSpec, 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
-
LOGGER
private static final org.slf4j.Logger LOGGER -
instanceToHierarchyProperty
protected org.apache.jena.rdf.model.Property instanceToHierarchyPropertyProperty connecting the instance to the hierarhcy (usually rdf:type). -
threshold
private double thresholdThreshold for metric. Values by metric larger than the threshold will be a match. -
metric
Metric to be used. -
instanceMinConfidence
private double instanceMinConfidenceWhat is an instance match? -> Minimal confidence for instance matches. -
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:typedebugFile
- 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:typethreshold
- the threshold for metric. Values by metric larger than the threshold will be a match.metric
- the metric for class comparisoninstanceMinConfidence
- 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 comparisoninstanceMinConfidence
- minimal confidence for instance matches
-
MatchClassBasedOnInstances
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 interfaceIMatcher<org.apache.jena.ontology.OntModel,
Alignment, Properties> - Specified by:
match
in classMatcherYAAAJena
- 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, throws IOExceptionInteger> instanceCounts, int instanceMappings) - Throws:
IOException
-
getInstancesOfClass
private Set<org.apache.jena.rdf.model.Resource> getInstancesOfClass(org.apache.jena.rdf.model.Resource clazz) -
getClassesOfInstance
-
getThreshold
public double getThreshold() -
setThreshold
public void setThreshold(double threshold) -
getMetric
-
setMetric
-
getInstanceMinConfidence
public double getInstanceMinConfidence() -
setInstanceMinConfidence
public void setInstanceMinConfidence(double instanceMinConfidence) -
getDebugFile
-
setDebugFile
-