Class ScalableStringProcessingMatcher
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.elementlevel.scale.ScalableStringProcessingMatcher
- 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
Matcher which uses different String Matching approaches (stored in PropertySpecificStringProcessing) with a specific confidence.
Multiple normalization are possible as shown below.
The highest confidence is taken at the end.
Function<String, Object> equality = (text) -> text;
Function<String, Object> lowercase = (text) -> text.toLowerCase();
ScalableStringProcessingMatcher matcherOne = new ScalableStringProcessingMatcher(Arrays.asList(
new PropertySpecificStringProcessing(equality, 1.0, RDFS.label),
new PropertySpecificStringProcessing(lowercase, 0.9, RDFS.label)
new PropertySpecificStringProcessing(equality, 0.7, SKOS.altLabel),
new PropertySpecificStringProcessing(lowercase, 0.6, SKOS.altLabel)
));
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
private static final org.slf4j.Logger
protected List<Function<org.apache.jena.ontology.OntModel,
Iterator<? extends org.apache.jena.rdf.model.Resource>>> A list of fucntions which gets an ontModel and returns an iterator over elements which should be matched like classes, instances, proeprties etc.protected boolean
protected boolean
protected boolean
protected Set<TextExtractor>
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
ConstructorDescriptionScalableStringProcessingMatcher
(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements) ScalableStringProcessingMatcher
(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements, boolean earlyStopping) ScalableStringProcessingMatcher
(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements, boolean earlyStopping, boolean crossIndexMatch) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMatchType
(Function<org.apache.jena.ontology.OntModel, Iterator<? extends org.apache.jena.rdf.model.Resource>> f) Adds a function which gets an ontModel and returns an iterator over elements which should be matched like classes, instances, properties etc.private Map<PropertySpecificStringProcessingMultipleReturn,
com.github.liblevenshtein.transducer.ITransducer> buildLevenshteinIndex
(Map<PropertySpecificStringProcessingMultipleReturn, Map<Object, Set<String>>> index) protected Map<TextExtractor,
Set<String>> extractAllValues
(org.apache.jena.rdf.model.Resource r) getLiterals
(PropertySpecificStringProcessingMultipleReturn processing, Map<TextExtractor, Set<String>> valueMap) boolean
boolean
boolean
boolean
boolean
protected boolean
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
matchResources
(Iterator<? extends org.apache.jena.rdf.model.Resource> sourceResources, Iterator<? extends org.apache.jena.rdf.model.Resource> targetResources, Alignment alignment) void
setCrossIndexMatch
(boolean crossIndexMatch) void
setEarlyStopping
(boolean earlyStopping) void
setMatchClasses
(boolean matchClasses) void
setMatchInstances
(boolean matchInstances) void
setMatchProperties
(boolean matchProperties) 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 -
processingElements
-
usedValueExtractors
-
matchClasses
protected boolean matchClasses -
matchProperties
protected boolean matchProperties -
matchInstances
protected boolean matchInstances -
earlyStopping
protected boolean earlyStopping -
crossIndexMatch
protected boolean crossIndexMatch -
matchableResourceIterators
protected List<Function<org.apache.jena.ontology.OntModel,Iterator<? extends org.apache.jena.rdf.model.Resource>>> matchableResourceIteratorsA list of fucntions which gets an ontModel and returns an iterator over elements which should be matched like classes, instances, proeprties etc.
-
-
Constructor Details
-
ScalableStringProcessingMatcher
public ScalableStringProcessingMatcher(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements, boolean earlyStopping, boolean crossIndexMatch) -
ScalableStringProcessingMatcher
public ScalableStringProcessingMatcher(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements, boolean earlyStopping) -
ScalableStringProcessingMatcher
public ScalableStringProcessingMatcher(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements)
-
-
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.
-
matchResources
-
buildLevenshteinIndex
private Map<PropertySpecificStringProcessingMultipleReturn,com.github.liblevenshtein.transducer.ITransducer> buildLevenshteinIndex(Map<PropertySpecificStringProcessingMultipleReturn, Map<Object, Set<String>>> index) -
getLiterals
protected Set<String> getLiterals(PropertySpecificStringProcessingMultipleReturn processing, Map<TextExtractor, Set<String>> valueMap) -
extractAllValues
-
isObjectEmpty
-
isMatchClasses
public boolean isMatchClasses() -
setMatchClasses
public void setMatchClasses(boolean matchClasses) -
isMatchProperties
public boolean isMatchProperties() -
setMatchProperties
public void setMatchProperties(boolean matchProperties) -
isMatchInstances
public boolean isMatchInstances() -
setMatchInstances
public void setMatchInstances(boolean matchInstances) -
isEarlyStopping
public boolean isEarlyStopping() -
setEarlyStopping
public void setEarlyStopping(boolean earlyStopping) -
isCrossIndexMatch
public boolean isCrossIndexMatch() -
setCrossIndexMatch
public void setCrossIndexMatch(boolean crossIndexMatch) -
addMatchType
public void addMatchType(Function<org.apache.jena.ontology.OntModel, Iterator<? extends org.apache.jena.rdf.model.Resource>> f) Adds a function which gets an ontModel and returns an iterator over elements which should be matched like classes, instances, properties etc.- Parameters:
f
- a function which gets an ontModel and returns an iterator over elements which should be matched
-