Class TopXFilter
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.filter.TopXFilter
- 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
This filter keeps only the top X correspondences according to confidence.
The filter can be configured to be source-based (keep only the top X correspondences for each source node).
The filter can be configured to be target-based (keep only the top X correspondences for each target node).
The filter can be configured to be size-based (based on the smaller or larger side of the alignment).
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic TopXFilter.TopFilterMode
static final double
static final int
private TopXFilter.TopFilterMode
private static final org.slf4j.Logger
private double
private int
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
ConstructorDescriptionTopXFilter
(int x) TopXFilter
(int x, double threshold) TopXFilter
(int x, TopXFilter.TopFilterMode mode) TopXFilter
(int x, TopXFilter.TopFilterMode filterMode, double threshold) Default Constructor -
Method Summary
Modifier and TypeMethodDescriptionFilters the given alignment such that there are only the top X correspondences (according to confidence) for every source node.private Alignment
filterTopX
(Iterator<Correspondence> iterator) private <T> int
getIteratorSize
(Iterator<T> iterator) double
int
getX()
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.void
setFilterMode
(TopXFilter.TopFilterMode filterMode) void
setThreshold
(double threshold) void
setX
(int x) 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 -
threshold
private double threshold -
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLD- See Also:
-
x
private int x -
DEFAULT_X
public static final int DEFAULT_X- See Also:
-
filterMode
-
DEFAULT_FILTER_MODE
-
-
Constructor Details
-
TopXFilter
Default Constructor- Parameters:
x
- XfilterMode
- The filter mode.threshold
- The desired threshold. Use 0.0d if you do not want to use threshold filtering.
-
TopXFilter
public TopXFilter(int x) -
TopXFilter
public TopXFilter(int x, double threshold) -
TopXFilter
-
-
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.
-
filter
Filters the given alignment such that there are only the top X correspondences (according to confidence) for every source node.- Parameters:
alignment
- The initial alignment.- Returns:
- The filtered alignment.
-
getIteratorSize
-
filterTopX
-
getThreshold
public double getThreshold() -
setThreshold
public void setThreshold(double threshold) -
getX
public int getX() -
setX
public void setX(int x) -
getFilterMode
-
setFilterMode
-