Class FilterByErrorDegree
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.multisource.clustering.FilterByErrorDegree
- All Implemented Interfaces:
Filter
,IMatcherMultiSource<Object,
Alignment, Object>
public class FilterByErrorDegree
extends Object
implements IMatcherMultiSource<Object,Alignment,Object>, Filter
This filter of correspondences is based on the community structure of the correspondences.
E.g. if many entities are fully connected, then this indicates that all of those correspondences are correct.
But if tehre are some weakly connected entites, then this might indicate wrong correspondences.
-
Field Summary
Modifier and TypeFieldDescriptionprivate ModularityAlgorithm
private static final org.slf4j.Logger
private int
private int
private int
private long
private double
private double
-
Constructor Summary
ConstructorDescriptionDoes not filter but just add the confidence with the standard algorithm.FilterByErrorDegree
(double threshold) FilterByErrorDegree
(double threshold, ModularityAlgorithm algorithm) Constructor with threshold and algorithm.FilterByErrorDegree
(double threshold, ModularityAlgorithm algorithm, int modularityFunction, double resolution, long randomSeed, int nRandomStarts, int nIterations) Constructor with all parameters.FilterByErrorDegree
(ModularityAlgorithm algorithm) Does not filter but just add the confidence. -
Method Summary
Modifier and TypeMethodDescriptionaddConfidence
(Alignment alignment) void
analyzeErrDistribution
(Alignment alignment, File file) Write a tsv file which contains the err value in the first column and the number of correspondences with this value as a second column.private static Double
getErrorValue
(Map<Map.Entry<String, String>, Double> map, Correspondence correspondence) Matches multiple ontologies / knowledge graphs together.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.uni_mannheim.informatik.dws.melt.matching_base.multisource.IMatcherMultiSource
needsTransitiveClosureForEvaluation
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
threshold
private double threshold -
algorithm
-
modularityFunction
private int modularityFunction -
resolution
private double resolution -
randomSeed
private long randomSeed -
nRandomStarts
private int nRandomStarts -
nIterations
private int nIterations
-
-
Constructor Details
-
FilterByErrorDegree
public FilterByErrorDegree()Does not filter but just add the confidence with the standard algorithm. -
FilterByErrorDegree
public FilterByErrorDegree(double threshold) -
FilterByErrorDegree
Does not filter but just add the confidence.- Parameters:
algorithm
- the algorithm to use.
-
FilterByErrorDegree
Constructor with threshold and algorithm.- Parameters:
threshold
- set the threshold below 0 to not filter.algorithm
- the algorithm to use
-
FilterByErrorDegree
public FilterByErrorDegree(double threshold, ModularityAlgorithm algorithm, int modularityFunction, double resolution, long randomSeed, int nRandomStarts, int nIterations) Constructor with all parameters. Set threshold smaller zero to not filter.- Parameters:
threshold
- the thresholdalgorithm
- algorithmmodularityFunction
- modularityFunctionresolution
- resolutionrandomSeed
- randomSeednRandomStarts
- nRandomStartsnIterations
- nIterations
-
-
Method Details
-
match
public Alignment match(List<Object> models, Alignment inputAlignment, Object parameters) throws Exception Description copied from interface:IMatcherMultiSource
Matches multiple ontologies / knowledge graphs together.- Specified by:
match
in interfaceIMatcherMultiSource<Object,
Alignment, Object> - Parameters:
models
- a list of ontologies / knowledge graphs in the desired format.inputAlignment
- this object represents the input alignment.parameters
- object representing additional parameters. Only add to this object and do not create a new Object likeparameters= new ...()
because otherwise the parameters are lost (java ist call by value). Sensible classes areProperties
,Map<String, Object>
or any similar data structure. Some already specified keys (strings) can be found atParameterConfigKeys
.- Returns:
- the resulting alignment of the matching process.
- Throws:
Exception
- in case of any errors
-
filter
-
addConfidence
-
getErrorValue
-
analyzeErrDistribution
Write a tsv file which contains the err value in the first column and the number of correspondences with this value as a second column. This helps to find out the right threshold.- Parameters:
alignment
- the alignemnt to analyzefile
- the file to write to.
-