it.unitn.disi.smatch
Class MatchManager

java.lang.Object
  extended by it.unitn.disi.smatch.components.Configurable
      extended by it.unitn.disi.smatch.MatchManager
All Implemented Interfaces:
IConfigurable, IMatchManager

public class MatchManager
extends Configurable
implements IMatchManager

MatchManager controls the process of matching, loads contexts and performs other auxiliary work.

Author:
Mikalai Yatskevich mikalai.yatskevich@comlab.ox.ac.uk,

Field Summary
static java.lang.String configFileCmdLineKey
           
static java.lang.String DEFAULT_CONFIG_FILE_NAME
          Default configuration file name.
static java.lang.String propCmdLineKey
           
 
Fields inherited from class it.unitn.disi.smatch.components.Configurable
GLOBAL_PREFIX, globalComponents, properties
 
Constructor Summary
MatchManager()
           
MatchManager(java.util.Properties properties)
          Constructor class with initialization.
MatchManager(java.lang.String propFileName)
          Constructor class with initialization.
 
Method Summary
 void classify(IContext context)
          Performs the second step of the semantic matching algorithm.
 IContext createContext()
          Creates a context instance.
 IContextMapping<IAtomicConceptOfLabel> elementLevelMatching(IContext sourceContext, IContext targetContext)
          Performs the third step of semantic matching algorithm.
 IContextMapping<INode> filterMapping(IContextMapping<INode> mapping)
          Filters a mapping.
 IContextLoader getContextLoader()
          Returns currently configured context loader.
 IContextPreprocessor getContextPreprocessor()
          Returns currently configured context preprocessor.
 IContextRenderer getContextRenderer()
          Returns currently configured context renderer.
static IMatchManager getInstance()
           
 IMappingFactory getMappingFactory()
          Returns mapping factory.
 IMappingLoader getMappingLoader()
          Returns currently configured mapping loader.
 IMappingRenderer getMappingRenderer()
          Returns currently configured mapping renderer.
 java.util.Properties getProperties()
           
 IContext loadContext(java.lang.String fileName)
          Uses current loader to load the context from external source into internal data structure.
 IContextMapping<INode> loadMapping(IContext ctxSource, IContext ctxTarget, java.lang.String inputFile)
          Loads the mapping between source and target contexts using the current mapping loader.
static void main(java.lang.String[] args)
          Provides a command line interface to the match manager.
 IContextMapping<INode> match(IContext sourceContext, IContext targetContext)
          Performs the whole matching process.
 void offline(IContext context)
          Performs the first two steps of the semantic matching algorithm.
 IContextMapping<INode> online(IContext sourceContext, IContext targetContext)
          Performs the last two steps of the semantic matching algorithm.
 void preprocess(IContext context)
          Performs the first step of the semantic matching algorithm.
 void renderContext(IContext ctxSource, java.lang.String fileName)
          Renders the context using a current renderer.
 void renderMapping(IContextMapping<INode> mapping, java.lang.String outputFile)
          Renders the mapping using a current mapping renderer.
 boolean setProperties(java.util.Properties newProperties)
          Sets component configuration properties.
 IContextMapping<INode> structureLevelMatching(IContext sourceContext, IContext targetContext, IContextMapping<IAtomicConceptOfLabel> acolMapping)
          Performs the fourth step of semantic matching algorithm.
 
Methods inherited from class it.unitn.disi.smatch.components.Configurable
configureComponent, getComponentProperties, loadProperties, makeComponentPrefix, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unitn.disi.smatch.components.IConfigurable
setProperties
 

Field Detail

DEFAULT_CONFIG_FILE_NAME

public static final java.lang.String DEFAULT_CONFIG_FILE_NAME
Default configuration file name.


configFileCmdLineKey

public static final java.lang.String configFileCmdLineKey
See Also:
Constant Field Values

propCmdLineKey

public static final java.lang.String propCmdLineKey
See Also:
Constant Field Values
Constructor Detail

MatchManager

public MatchManager()
             throws SMatchException
Throws:
SMatchException

MatchManager

public MatchManager(java.lang.String propFileName)
             throws SMatchException
Constructor class with initialization.

Parameters:
propFileName - the name of the properties file
Throws:
SMatchException - SMatchException

MatchManager

public MatchManager(java.util.Properties properties)
             throws SMatchException
Constructor class with initialization.

Parameters:
properties - the properties
Throws:
SMatchException - SMatchException
Method Detail

getInstance

public static IMatchManager getInstance()
                                 throws SMatchException
Throws:
SMatchException

createContext

public IContext createContext()
Description copied from interface: IMatchManager
Creates a context instance.

Specified by:
createContext in interface IMatchManager
Returns:
a context instance

getMappingFactory

public IMappingFactory getMappingFactory()
Description copied from interface: IMatchManager
Returns mapping factory.

Specified by:
getMappingFactory in interface IMatchManager
Returns:
mapping factory

loadContext

public IContext loadContext(java.lang.String fileName)
                     throws SMatchException
Description copied from interface: IMatchManager
Uses current loader to load the context from external source into internal data structure.

Specified by:
loadContext in interface IMatchManager
Parameters:
fileName - a string passed to the current loader
Returns:
interface to internal context representation
Throws:
SMatchException - SMatchException

getContextLoader

public IContextLoader getContextLoader()
Description copied from interface: IMatchManager
Returns currently configured context loader.

Specified by:
getContextLoader in interface IMatchManager
Returns:
currently configured context loader

renderContext

public void renderContext(IContext ctxSource,
                          java.lang.String fileName)
                   throws SMatchException
Description copied from interface: IMatchManager
Renders the context using a current renderer.

Specified by:
renderContext in interface IMatchManager
Parameters:
ctxSource - context to be rendered
fileName - a render destination passed to the context renderer
Throws:
SMatchException - SMatchException

getContextRenderer

public IContextRenderer getContextRenderer()
Description copied from interface: IMatchManager
Returns currently configured context renderer.

Specified by:
getContextRenderer in interface IMatchManager
Returns:
currently configured context renderer

loadMapping

public IContextMapping<INode> loadMapping(IContext ctxSource,
                                          IContext ctxTarget,
                                          java.lang.String inputFile)
                                   throws SMatchException
Description copied from interface: IMatchManager
Loads the mapping between source and target contexts using the current mapping loader.

Specified by:
loadMapping in interface IMatchManager
Parameters:
ctxSource - source context
ctxTarget - target context
inputFile - a mapping location passed to the mapping loader
Returns:
a mapping
Throws:
SMatchException - SMatchException

getMappingLoader

public IMappingLoader getMappingLoader()
Description copied from interface: IMatchManager
Returns currently configured mapping loader.

Specified by:
getMappingLoader in interface IMatchManager
Returns:
currently configured mapping loader

renderMapping

public void renderMapping(IContextMapping<INode> mapping,
                          java.lang.String outputFile)
                   throws SMatchException
Description copied from interface: IMatchManager
Renders the mapping using a current mapping renderer.

Specified by:
renderMapping in interface IMatchManager
Parameters:
mapping - a mapping
outputFile - a render destination passed to the mapping renderer
Throws:
SMatchException - SMatchException

getMappingRenderer

public IMappingRenderer getMappingRenderer()
Description copied from interface: IMatchManager
Returns currently configured mapping renderer.

Specified by:
getMappingRenderer in interface IMatchManager
Returns:
currently configured mapping renderer

filterMapping

public IContextMapping<INode> filterMapping(IContextMapping<INode> mapping)
                                     throws SMatchException
Description copied from interface: IMatchManager
Filters a mapping. For example, filtering could be a minimization.

Specified by:
filterMapping in interface IMatchManager
Parameters:
mapping - a mapping to filter
Returns:
a filtered mapping
Throws:
SMatchException - SMatchException

elementLevelMatching

public IContextMapping<IAtomicConceptOfLabel> elementLevelMatching(IContext sourceContext,
                                                                   IContext targetContext)
                                                            throws SMatchException
Description copied from interface: IMatchManager
Performs the third step of semantic matching algorithm.

Specified by:
elementLevelMatching in interface IMatchManager
Parameters:
sourceContext - interface of source context with concept at node formula
targetContext - interface of target context with concept at node formula
Returns:
interface to a matrix of semantic relations between atomic concepts of labels in the contexts
Throws:
SMatchException - SMatchException

structureLevelMatching

public IContextMapping<INode> structureLevelMatching(IContext sourceContext,
                                                     IContext targetContext,
                                                     IContextMapping<IAtomicConceptOfLabel> acolMapping)
                                              throws SMatchException
Description copied from interface: IMatchManager
Performs the fourth step of semantic matching algorithm.

Specified by:
structureLevelMatching in interface IMatchManager
Parameters:
sourceContext - interface of source context with concept at node formula
targetContext - interface of target context with concept at node formula
acolMapping - mapping between atomic concepts of labels in the contexts
Returns:
mapping between the concepts at nodes in the contexts
Throws:
SMatchException - SMatchException

offline

public void offline(IContext context)
             throws SMatchException
Description copied from interface: IMatchManager
Performs the first two steps of the semantic matching algorithm.

Specified by:
offline in interface IMatchManager
Parameters:
context - interface to context to be preprocessed
Throws:
SMatchException - SMatchException

online

public IContextMapping<INode> online(IContext sourceContext,
                                     IContext targetContext)
                              throws SMatchException
Description copied from interface: IMatchManager
Performs the last two steps of the semantic matching algorithm.

Specified by:
online in interface IMatchManager
Parameters:
sourceContext - interface to preprocessed source context to be matched
targetContext - interface to preprocessed target context to be matched
Returns:
interface to resulting mapping
Throws:
SMatchException - SMatchException

match

public IContextMapping<INode> match(IContext sourceContext,
                                    IContext targetContext)
                             throws SMatchException
Description copied from interface: IMatchManager
Performs the whole matching process.

Specified by:
match in interface IMatchManager
Parameters:
sourceContext - interface to source context to be matched
targetContext - interface to target context to be matched
Returns:
interface to resulting mapping
Throws:
SMatchException - SMatchException

setProperties

public boolean setProperties(java.util.Properties newProperties)
                      throws ConfigurableException
Description copied from interface: IConfigurable
Sets component configuration properties. The component might check for properties change and reconfigure or reload subcomponents.

Specified by:
setProperties in interface IConfigurable
Overrides:
setProperties in class Configurable
Parameters:
newProperties - a new configuration
Returns:
true if properties have been changed
Throws:
ConfigurableException - ConfigurableException

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface IConfigurable
Overrides:
getProperties in class Configurable

preprocess

public void preprocess(IContext context)
                throws SMatchException
Description copied from interface: IMatchManager
Performs the first step of the semantic matching algorithm.

Specified by:
preprocess in interface IMatchManager
Parameters:
context - interface to a context to be preprocessed
Throws:
SMatchException - SMatchException

getContextPreprocessor

public IContextPreprocessor getContextPreprocessor()
Description copied from interface: IMatchManager
Returns currently configured context preprocessor.

Specified by:
getContextPreprocessor in interface IMatchManager
Returns:
currently configured context preprocessor

classify

public void classify(IContext context)
              throws SMatchException
Description copied from interface: IMatchManager
Performs the second step of the semantic matching algorithm.

Specified by:
classify in interface IMatchManager
Parameters:
context - interface to the preprocessed context
Throws:
SMatchException - SMatchException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        ConfigurableException
Provides a command line interface to the match manager.

Parameters:
args - command line arguments
Throws:
java.io.IOException - IOException
ConfigurableException - ConfigurableException


© 2010-2011 Knowdive @ DISI