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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprivate static final org.slf4j.Loggerprotected 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 booleanprotected booleanprotected booleanprotected Set<TextExtractor>Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionScalableStringProcessingMatcher(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements) ScalableStringProcessingMatcher(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements, boolean earlyStopping) ScalableStringProcessingMatcher(Iterable<PropertySpecificStringProcessingMultipleReturn> processingElements, boolean earlyStopping, boolean crossIndexMatch) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMatchType(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) booleanbooleanbooleanbooleanbooleanprotected booleanmatch(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.voidmatchResources(Iterator<? extends org.apache.jena.rdf.model.Resource> sourceResources, Iterator<? extends org.apache.jena.rdf.model.Resource> targetResources, Alignment alignment) voidsetCrossIndexMatch(boolean crossIndexMatch) voidsetEarlyStopping(boolean earlyStopping) voidsetMatchClasses(boolean matchClasses) voidsetMatchInstances(boolean matchInstances) voidsetMatchProperties(boolean matchProperties) Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena
getModelSpec, match, readOntologyMethods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAA
matchMethods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
matchMethods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
align, align, canExecute, getTypeMethods inherited from class eu.sealsproject.platform.res.tool.impl.AbstractPlugin
getId, getVersion, setId, setVersionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:MatcherYAAAJenaAligns 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:
matchin interfaceIMatcher<org.apache.jena.ontology.OntModel,Alignment, Properties> - Specified by:
matchin 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
-