Class OpenEAMatcher
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_ml.python.openea.OpenEAMatcher
- 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
This matching module uses the OpenEA library to match entities.
It uses all correspondences which are provided through either the constructor or match method(inputalignment)
with equivalence relation to train the approach. It only need positive correspondences and samples negative correspondences on its own.
If you apply your own configuration you can use the parameters from openEA and also the following additional parameters:
If you apply your own configuration you can use the parameters from openEA and also the following additional parameters:
- predict_top_k - the number of matching entities which should at least retrived for one single entity
- predict_min_sim_value - the similarity measure which should be applied for every correspondence. All sim values are greater than the given one (not equal or greater).
-
Field Summary
Modifier and TypeFieldDescriptionprivate File
The base directory where all files are written.private OpenEAConfiguration
private static Pattern
private double
The fraction how many correspondences belongt to train (rest to validation).static final String
Map of URIs (String) to double array.static final String
Map of URIs (String) to double array.private boolean
private static final org.slf4j.Logger
private long
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
ConstructorDescriptionMakes a 80/20 train validation split and uses the default configuration and base folder.OpenEAMatcher
(OpenEAConfiguration config, double fractionTrainCorrespondences, long randomSeed) Constructor with the config for training.OpenEAMatcher
(File baseDirectory, OpenEAConfiguration config, boolean loadEmbeddings, double fractionTrainCorrespondences, long randomSeed) Constructor which sets all variables. -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenEAConfiguration
match
(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment, Properties parameter) Aligns two ontologies specified via a Jena OntModel, with an input alignment as Alignment object, and returns the mapping of the resulting alignment.protected void
writeCorrespondences
(List<Correspondence> correspondences, File file) protected void
writeKnowledgeGraphToFile
(org.apache.jena.rdf.model.Model m, File relTriples, File attrTriples) protected void
writeTrainValAlignments
(Alignment a, File alignmentFolder) 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 -
KB1_ENTITY_EMBEDDING
Map of URIs (String) to double array. This represents the entities embeddings generated by openea for the left entities.- See Also:
-
KB2_ENTITY_EMBEDDING
Map of URIs (String) to double array. This represents the entities embeddings generated by openea for the right entities.- See Also:
-
baseDirectory
The base directory where all files are written. In this folder, another folder with a random number is created to allow parallel execution of this matcher. -
fractionTrainCorrespondences
private double fractionTrainCorrespondencesThe fraction how many correspondences belongt to train (rest to validation). -
randomSeed
private long randomSeed -
config
-
loadEmbeddings
private boolean loadEmbeddings -
CONTROL_CODE_PATTERN
-
-
Constructor Details
-
OpenEAMatcher
public OpenEAMatcher(File baseDirectory, OpenEAConfiguration config, boolean loadEmbeddings, double fractionTrainCorrespondences, long randomSeed) Constructor which sets all variables.- Parameters:
baseDirectory
- the base directory where all files are written. In this folder, another folder with a random number is created to allow parallel execution of this matcher.config
- the configuration for the modelloadEmbeddings
- true if also the embeddings should be loaded.fractionTrainCorrespondences
- the fraction of training correspondencesrandomSeed
- the random seed for splitting the alignment into train and validation alignment.
-
OpenEAMatcher
public OpenEAMatcher(OpenEAConfiguration config, double fractionTrainCorrespondences, long randomSeed) Constructor with the config for training.- Parameters:
config
- the configuration for the modelfractionTrainCorrespondences
- the fraction of training correspondencesrandomSeed
- the random seed for splitting the alignment into train and validation alignment.
-
OpenEAMatcher
public OpenEAMatcher()Makes a 80/20 train validation split and uses the default configuration and base folder.
-
-
Method Details
-
getDefaultConfig
-
match
public Alignment match(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment, Properties parameter) 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.parameter
- Additional properties.- Returns:
- The resulting alignment of the matching process.
- Throws:
Exception
- Any exception which occurs during matching.
-
writeTrainValAlignments
- Throws:
IOException
-
writeCorrespondences
protected void writeCorrespondences(List<Correspondence> correspondences, File file) throws IOException - Throws:
IOException
-
writeKnowledgeGraphToFile
protected void writeKnowledgeGraphToFile(org.apache.jena.rdf.model.Model m, File relTriples, File attrTriples) throws IOException - Throws:
IOException
-