Class SimpleStringMatcher
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.external.matcher.SimpleStringMatcher
- 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 relatively simple matcher that can be used before running
BackgroundMatcher
to filter out simple matches.-
Field Summary
FieldsModifier and TypeFieldDescriptionTracks clashed labels.private boolean
Log every match.private static org.slf4j.Logger
private Alignment
Alignmentprivate org.apache.jena.ontology.OntModel
private org.apache.jena.ontology.OntModel
maps from URI -> set<label>maps from URI -> set<label>private TextExtractor
The value extractor used to obtain labels for resources.Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addClashedLabel
(String uri1, String uri2) Adds a clashed label to the corresponding map.private HashMap<BagOfWords,
String> convertToBOW2URI
(Map<String, Set<String>> uri2labels) Convert aHashMap<String, HashSet<String>>
to aHashMap<BagOfWords, String>
.private void
initializeMappingProcess
(Alignment inputAlignment) (Re-)initialize data structures.boolean
private void
If the applied comparison score cannot differentiate between multiple mapping options, add all.match
(org.apache.jena.ontology.OntModel sourceOntology, org.apache.jena.ontology.OntModel targetOntology, Alignment inputAlignment, Properties p) 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
match
(org.apache.jena.util.iterator.ExtendedIterator<? extends org.apache.jena.ontology.OntResource> sourceOntologyIterator_1, org.apache.jena.util.iterator.ExtendedIterator<? extends org.apache.jena.ontology.OntResource> targetOntologyIterator_2) Given two iterators, match the resources covered by them.(package private) static BagOfWords
Normalizes a string.private void
performSimpleMatching
(Map<String, Set<String>> uri2labelMap_1, Map<String, Set<String>> uri2labelMap_2) Filter out simple string matches utilizing an index strategy.void
setVerboseLoggingOutput
(boolean verboseLoggingOutput) 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 org.slf4j.Logger LOGGER -
ontology1
private org.apache.jena.ontology.OntModel ontology1 -
ontology2
private org.apache.jena.ontology.OntModel ontology2 -
valueExtractor
The value extractor used to obtain labels for resources. -
mapping
Alignment -
clashedLabels
Tracks clashed labels. -
uri2labelMap_1
maps from URI -> set<label> -
uri2labelMap_2
maps from URI -> set<label> -
isVerboseLoggingOutput
private boolean isVerboseLoggingOutputLog every match. Do not use in performance optimized settings.
-
-
Constructor Details
-
SimpleStringMatcher
public SimpleStringMatcher()
-
-
Method Details
-
match
public Alignment match(org.apache.jena.ontology.OntModel sourceOntology, org.apache.jena.ontology.OntModel targetOntology, Alignment inputAlignment, Properties p) 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:
sourceOntology
- This OntModel represents the source ontology.targetOntology
- This OntModel represents the target ontology.inputAlignment
- This mapping represents the input alignment.p
- Additional properties.- Returns:
- The resulting alignment of the matching process.
- Throws:
Exception
- Any exception which occurs during matching.
-
initializeMappingProcess
(Re-)initialize data structures.- Parameters:
inputAlignment
- Input alignment
-
match
private void match(org.apache.jena.util.iterator.ExtendedIterator<? extends org.apache.jena.ontology.OntResource> sourceOntologyIterator_1, org.apache.jena.util.iterator.ExtendedIterator<? extends org.apache.jena.ontology.OntResource> targetOntologyIterator_2) Given two iterators, match the resources covered by them.- Parameters:
sourceOntologyIterator_1
- iterator 1 must be that of the source ontologytargetOntologyIterator_2
- iterator 2 must be that of the target ontology
-
performSimpleMatching
private void performSimpleMatching(Map<String, Set<String>> uri2labelMap_1, Map<String, Set<String>> uri2labelMap_2) Filter out simple string matches utilizing an index strategy.- Parameters:
uri2labelMap_1
- URI 2 labels for the source ontology.uri2labelMap_2
- URI 2 labels for the target ontology.
-
addClashedLabel
Adds a clashed label to the corresponding map.- Parameters:
uri1
- URI part 1.uri2
- URI part 2.
-
mapToMany
If the applied comparison score cannot differentiate between multiple mapping options, add all.- Parameters:
sourceURI
- Source URItargetURI
- Target URI
-
convertToBOW2URI
Convert aHashMap<String, HashSet<String>>
to aHashMap<BagOfWords, String>
. This is required for very simple String matchers.- Parameters:
uri2labels
- Input HashMap.- Returns:
- Converted HashMap.
-
normalize
Normalizes a string. Recognizes camelCase.- Parameters:
stringToBeNormalized
- The String that shall be normalized.- Returns:
- Bag of Words
-
isVerboseLoggingOutput
public boolean isVerboseLoggingOutput() -
setVerboseLoggingOutput
public void setVerboseLoggingOutput(boolean verboseLoggingOutput)
-