edu.udo.cs.miningmart.schemamatching
Class MmSchemaMatcher

java.lang.Object
  extended by edu.udo.cs.miningmart.schemamatching.MmSchemaMatcher
Direct Known Subclasses:
NameAndTypeBasedSchemaMatcher

public abstract class MmSchemaMatcher
extends java.lang.Object

Abstract superclass of schema matching methods in the MiningMart environment. Whenever a concrete subclass of this subclass is implemented, you can add a name representing its matcher to the String array edu.udo.cs.miningmart.m4.M4Interface.AVAILABLE_MATCHERS, and add a call to an instantiation of that class to the method edu.udo.cs.miningmart.m4.core.M4InterfaceImpl.findConnection(...) at the place indicated there. Then the matcher implemented by your subclass is automatically available in the GUI.

Version:
$Id: MmSchemaMatcher.java,v 1.10 2006/09/27 15:00:03 euler Exp $
Author:
Timm Euler

Field Summary
protected static double THRESHOLD
           
 
Constructor Summary
MmSchemaMatcher()
           
 
Method Summary
 double getDatatypeSimilarity(BaseAttribute ba1, BaseAttribute ba2)
          Returns the similarity based on the conceptual data types of the given BaseAttributes
abstract  double getDirectSimilarity(BaseAttribute ba1, BaseAttribute ba2)
          Returns the double value that this matcher considers as the similarity between ba1 and ba2, based only on information related to these BaseAttributes.
abstract  double getDirectSimilarity(Concept con1, Concept con2)
          Returns the double value that this matcher considers as the similarity between con1 and con2, based only on the information in these concepts but not on dependent attributes (like BaseAttributes).
<U extends ParameterObject>
double
getGlobalSimilarity(java.util.Collection<U> singleObjects1, java.util.Collection<U> singleObjects2, java.util.Collection<MatchingResult<U>> singleMappings)
          Computes a global similarity from a matrix of local similarities.
abstract  double getNameSimilarity(java.lang.String str1, java.lang.String str2)
          Returns the double value that this matcher considers as the similarity between the two given Strings.
 double getSimilarity(Concept con1, Concept con2)
          Returns the global (overall) similarity of the two Concepts, considering any indirect or direct attributes, for example their Features.
 double getSimilarity(Relation rel1, Relation rel2)
          Returns the similarity between the given relationships, which is not computed based on their names but on the similarity of the concepts they link.
abstract  double getSimilarityInvolvingConcepts(BaseAttribute ba1, BaseAttribute ba2)
          Returns the double value that this matcher considers as the similarity between ba1 and ba2, taking the similarity of their respective concepts into accounts as well.
<U extends ParameterObject>
MatchingResult<U>[][]
getSimilarityMatrix(java.util.Collection<U> oneDimension, java.util.Collection<U> secondDimension)
          Returns a similarity matrix between the objects of the given collection.
 MatchingResult<BaseAttribute>[][] getSimilarityMatrix(Concept con1, Concept con2)
          Returns a matrix (instance of class edu.udo.miningmart.schemamatching.MatchingResult) of n x m Dimension, where n and m are the number of features of each of the given concepts.
<U extends ParameterObject>
java.util.Collection<MatchingResult<U>>
getSimilarMatchingsGreedy(MatchingResult<U>[][] similarityMatrix, boolean useThreshold)
          Returns all matchings from the given matrix (that exceed the threshold similarity, if that parameter is TRUE).
abstract  double getStringSimilarity(java.lang.String str1, java.lang.String str2)
          Returns the double value that this matcher considers as the similarity between the two given Strings.
 boolean objectsAreSimilar(ParameterObject obj1, ParameterObject obj2)
          Returns TRUE if this matcher thinks the two given objects are similar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THRESHOLD

protected static final double THRESHOLD
See Also:
Constant Field Values
Constructor Detail

MmSchemaMatcher

public MmSchemaMatcher()
Method Detail

getDirectSimilarity

public abstract double getDirectSimilarity(BaseAttribute ba1,
                                           BaseAttribute ba2)
                                    throws SchemaMatchException
Returns the double value that this matcher considers as the similarity between ba1 and ba2, based only on information related to these BaseAttributes.

Parameters:
ba1 - One BaseAttribute
ba2 - Another BaseAttribute
Returns:
a similarity value between 0 and 1
Throws:
SchemaMatchException

getDirectSimilarity

public abstract double getDirectSimilarity(Concept con1,
                                           Concept con2)
                                    throws SchemaMatchException
Returns the double value that this matcher considers as the similarity between con1 and con2, based only on the information in these concepts but not on dependent attributes (like BaseAttributes).

Parameters:
con1 - One Concept
con2 - Another Concept
Returns:
a similarity value between 0 and 1
Throws:
SchemaMatchException

getSimilarityInvolvingConcepts

public abstract double getSimilarityInvolvingConcepts(BaseAttribute ba1,
                                                      BaseAttribute ba2)
                                               throws SchemaMatchException
Returns the double value that this matcher considers as the similarity between ba1 and ba2, taking the similarity of their respective concepts into accounts as well.

Parameters:
ba1 - One BaseAttribute
ba2 - Another BaseAttribute
Returns:
a similarity value between 0 and 1
Throws:
SchemaMatchException

getDatatypeSimilarity

public double getDatatypeSimilarity(BaseAttribute ba1,
                                    BaseAttribute ba2)
                             throws SchemaMatchException
Returns the similarity based on the conceptual data types of the given BaseAttributes

Parameters:
ba1 - One BaseAttribute
ba2 - Another BaseAttribute
Returns:
a similarity value between 0 and 1
Throws:
SchemaMatchException

getNameSimilarity

public abstract double getNameSimilarity(java.lang.String str1,
                                         java.lang.String str2)
                                  throws SchemaMatchException
Returns the double value that this matcher considers as the similarity between the two given Strings.

Parameters:
str1 - One String
str2 - Another String
Returns:
a similarity value
Throws:
SchemaMatchException

getStringSimilarity

public abstract double getStringSimilarity(java.lang.String str1,
                                           java.lang.String str2)
                                    throws SchemaMatchException
Returns the double value that this matcher considers as the similarity between the two given Strings.

Parameters:
str1 - One String
str2 - Another String
Returns:
a similarity value
Throws:
SchemaMatchException

getSimilarity

public double getSimilarity(Relation rel1,
                            Relation rel2)
                     throws SchemaMatchException
Returns the similarity between the given relationships, which is not computed based on their names but on the similarity of the concepts they link.

Parameters:
rel1 - a relation
rel2 - another relation
Returns:
a similarity value between 0 and 1
Throws:
SchemaMatchException

getSimilarity

public double getSimilarity(Concept con1,
                            Concept con2)
                     throws SchemaMatchException
Returns the global (overall) similarity of the two Concepts, considering any indirect or direct attributes, for example their Features.

Parameters:
con1 - A concept
con2 - Another concept
Returns:
a similarity value
Throws:
SchemaMatchException

getGlobalSimilarity

public <U extends ParameterObject> double getGlobalSimilarity(java.util.Collection<U> singleObjects1,
                                                              java.util.Collection<U> singleObjects2,
                                                              java.util.Collection<MatchingResult<U>> singleMappings)
                           throws SchemaMatchException
Computes a global similarity from a matrix of local similarities. This is applicable for BaseAttributes (local) in Concepts (global), or for Concepts (local) in a data model (global).

Parameters:
singleObjects1 -
singleObjects2 -
singleMappings -
Returns:
a similarity value between 0 and 1
Throws:
SchemaMatchException

getSimilarityMatrix

public <U extends ParameterObject> MatchingResult<U>[][] getSimilarityMatrix(java.util.Collection<U> oneDimension,
                                                                             java.util.Collection<U> secondDimension)
                                                                  throws SchemaMatchException
Returns a similarity matrix between the objects of the given collection. The only object types allowed are BaseAttributes, Concepts and Relations.

Parameters:
oneDimension - one collection
secondDimension - second collection
theMatcherToUse - the matcher that computes the similarity between an object of the first and an object of the second collection
Returns:
a two-dimensional array of MatchingResult objects
Throws:
SchemaMatchException

getSimilarityMatrix

public MatchingResult<BaseAttribute>[][] getSimilarityMatrix(Concept con1,
                                                             Concept con2)
                                                      throws SchemaMatchException
Returns a matrix (instance of class edu.udo.miningmart.schemamatching.MatchingResult) of n x m Dimension, where n and m are the number of features of each of the given concepts. An entry of the matrix represents the direct similarity that this matcher gives comparing the first concept's feature to the second concept's feature.

Parameters:
con1 - A concept
con2 - Another concept
Returns:
An two-dimensional array of MatchingResults (direct similarity matrix)
Throws:
SchemaMatchException

objectsAreSimilar

public boolean objectsAreSimilar(ParameterObject obj1,
                                 ParameterObject obj2)
                          throws SchemaMatchException
Returns TRUE if this matcher thinks the two given objects are similar. They are never similar if they are not of the same type. The allowed types are BaseAttribute, Concept and Relation.

Parameters:
obj1 - one object
obj2 - another object
Returns:
true if the objects are similar, false otherwise
Throws:
SchemaMatchException

getSimilarMatchingsGreedy

public <U extends ParameterObject> java.util.Collection<MatchingResult<U>> getSimilarMatchingsGreedy(MatchingResult<U>[][] similarityMatrix,
                                                                                                     boolean useThreshold)
Returns all matchings from the given matrix (that exceed the threshold similarity, if that parameter is TRUE).

Parameters:
similarityMatrix - a similarity matrix
Returns:
a collection of MatchingResults
Throws:
SchemaMatchException


Copyright © 2001-2005