it.unitn.disi.smatch
Class MatchManager

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

public class MatchManager
extends java.lang.Object
implements IMatchManager

Class that control process of matching, load contexts and perform other auxilary work. Also it contain all the global variables and properties from the configuration file

Author:
Mikalai Yatskevich mikalai.yatskevich@comlab.ox.ac.uk, Aliaksandr Autayeu avtaev@gmail.com

Field Summary
static java.lang.String adjectiveAntonymFile
           
static java.lang.String adjectiveSynonymFile
           
static java.lang.String adverbsAntonymFile
           
static java.lang.String andWords
           
static int BUFFER_SIZE
           
static java.lang.String ctxsSourceFile
           
static java.lang.String ctxsTargetFile
           
static double ELSMthreshold
           
static char ENTAILED_LESS_GENERAL_THAN
           
static char ENTAILED_MORE_GENERAL_THAN
           
static char ENTAILED_OPPOSITE_MEANING
           
static char ERASED_LG
           
static char ERASED_MG
           
static char IDK_RELATION
           
static char LESS_GENERAL_THAN
           
static java.lang.String meaninglessWords
           
static char MORE_GENERAL_THAN
           
static java.lang.String multiwordsFileName
           
static java.lang.String nominalizationsFile
           
static java.lang.String notWords
           
static java.lang.String nounAntonymFile
           
static java.lang.String nounMGFile
           
static java.lang.String numberCharacters
           
static char OPPOSITE_MEANING
           
static java.lang.String orWords
           
static java.lang.String propFileName
           
static java.lang.String satSolverClass
           
static java.util.Vector senseGlossMatchers
           
static java.util.Vector stringMatchers
           
static char SYNOMYM
           
static java.lang.String UNKNOWN_MEANING
           
static boolean useConjunctiveLabelsOptimization
           
static boolean useOppositeAxiomsOptimization
           
static boolean useWeakSemanticsElementLevelMatchersLibrary
           
static java.lang.String verbMGFile
           
static char WEAK_EQUIVALENCE
           
 
Constructor Summary
MatchManager()
           
MatchManager(java.lang.String propFileName)
           
 
Method Summary
 IContext classify(IContext ctxSource)
          Performs the second step of the semantic matching algorithm
 IMatchMatrix elementLevelMatching(IContext sourceContext, IContext targetContext)
          Performs the third step of semantic matching algorithm
 IMatchMatrix filter(java.util.Vector args)
          Performs additional filtering step executed after 4th step of semantic matching algorithm
static java.lang.Object getClassForName(java.lang.String className)
           
static IContext getIContext()
           
static IMatchManager getInstance()
           
static IWordNetMatcher getIWNMatcher()
           
static ILinguisticOracle getLinguisticOracle()
           
 IMatcherLibrary getMatcherLibrary()
           
 IPreprocessor getPreprocessor()
           
static Dictionary getWordNetDictionary()
           
static void initJWNL()
          Performs JWNL and JWNL logger initialization routines.
 IContext loadContext(java.lang.String fileName)
          Loads context
static void main(java.lang.String[] args)
           
 IMapping match(IContext sourceContext, IContext targetContext)
          Performs the whole matching process
 IContext offline(IContext ctxSource, java.lang.String ctxsSourceFile)
          Performs linguistic preprocessing
 IMapping online(IContext sourceContext, IContext targetContext)
          Performs the last two steps of the semantic matching algorithm, filtering and render the results by current IMappingRender
 IContext preprocess(IContext ctxSource)
          Performs the first step of the semantic matching algorithm
static void printMemoryUsage()
           
 void renderContext(IContext ctxSource, java.lang.String fileName)
          Renders context to screen,file or database
 IMapping renderMapping(java.util.Vector args)
          Renders mappings into appropriate format
static void retainValue(java.util.Vector<java.lang.String> v, java.lang.String value)
          Retains value in vector
static void setClassifier(java.lang.String classifier)
           
static void setContextRenderer(java.lang.String contextRenderer)
           
static void setFilter(java.lang.String filter)
           
static void setLinguisticOracle(java.lang.String linguisticOracle)
           
static void setLoader(java.lang.String loader)
           
static void setMappingRenderer(java.lang.String mappingRenderer)
           
static void setMatcherLibrary(java.lang.String matcherLibrary)
           
static void setPreprocessor(java.lang.String preprocessor)
           
 void setProperties(java.util.Properties properites)
          Set up the matching properties A list of parameters which influence on the matching process workflow

name of the class which implements IWordNetMatcher interface
WNmatcher = it.unitn.disi.smatch.oracles.wordnet.InMemoryWordNet

name of the class which implements ILinguisticOracle interface
LinguisticOracle = it.unitn.disi.smatch.oracles.wordnet.WordNet

name of the class which implements IClassifier interface
Classifier = it.unitn.disi.smatch.classifiers.DefaultClassifier

name of the class which implements IPreprocessor interface
Preprocessor = it.unitn.disi.smatch.preprocessors.DefaultPreprocessor

name of the class which implements IMatcherLibrary interface
MatcherLibrary = it.unitn.disi.smatch.matchers.element.MatcherLibrary

name of the class which implements ILoader interface
Loader = it.unitn.disi.smatch.loaders.CTXMLLoader

name of the class which implements IMappingRenderer interface
MappingRenderer = it.unitn.disi.smatch.renderers.mapping.DefaultHTMLMappingRenderer

name of the class which implements IContextRenderer interface
ContextRenderer = it.unitn.disi.smatch.renderers.context.CTXMLContextRenderer

name of the class which implements IFilter interface
Filter = it.unitn.disi.smatch.filters.DefaultFilter

static void setSatSolver(java.lang.String satSolverClass)
           
static void setTreeMatcher(java.lang.String treeMatcher)
           
static void setWNMatcher(java.lang.String WNMatcher)
           
 IMatchMatrix structureLevelMatching(IContext sourceContext, IContext targetContext, IMatchMatrix ClabMatrix)
          Performs the fourth step of semantic matching algorithm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propFileName

public static java.lang.String propFileName

useWeakSemanticsElementLevelMatchersLibrary

public static boolean useWeakSemanticsElementLevelMatchersLibrary

satSolverClass

public static java.lang.String satSolverClass

stringMatchers

public static java.util.Vector stringMatchers

senseGlossMatchers

public static java.util.Vector senseGlossMatchers

useConjunctiveLabelsOptimization

public static boolean useConjunctiveLabelsOptimization

useOppositeAxiomsOptimization

public static boolean useOppositeAxiomsOptimization

andWords

public static java.lang.String andWords

orWords

public static java.lang.String orWords

notWords

public static java.lang.String notWords

meaninglessWords

public static java.lang.String meaninglessWords

multiwordsFileName

public static java.lang.String multiwordsFileName

ctxsSourceFile

public static java.lang.String ctxsSourceFile

ctxsTargetFile

public static java.lang.String ctxsTargetFile

SYNOMYM

public static final char SYNOMYM
See Also:
Constant Field Values

WEAK_EQUIVALENCE

public static final char WEAK_EQUIVALENCE
See Also:
Constant Field Values

LESS_GENERAL_THAN

public static final char LESS_GENERAL_THAN
See Also:
Constant Field Values

MORE_GENERAL_THAN

public static final char MORE_GENERAL_THAN
See Also:
Constant Field Values

OPPOSITE_MEANING

public static final char OPPOSITE_MEANING
See Also:
Constant Field Values

ENTAILED_LESS_GENERAL_THAN

public static final char ENTAILED_LESS_GENERAL_THAN
See Also:
Constant Field Values

ENTAILED_MORE_GENERAL_THAN

public static final char ENTAILED_MORE_GENERAL_THAN
See Also:
Constant Field Values

ENTAILED_OPPOSITE_MEANING

public static final char ENTAILED_OPPOSITE_MEANING
See Also:
Constant Field Values

IDK_RELATION

public static final char IDK_RELATION
See Also:
Constant Field Values

UNKNOWN_MEANING

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

ERASED_LG

public static final char ERASED_LG
See Also:
Constant Field Values

ERASED_MG

public static final char ERASED_MG
See Also:
Constant Field Values

adjectiveSynonymFile

public static java.lang.String adjectiveSynonymFile

adjectiveAntonymFile

public static java.lang.String adjectiveAntonymFile

nounMGFile

public static java.lang.String nounMGFile

nounAntonymFile

public static java.lang.String nounAntonymFile

verbMGFile

public static java.lang.String verbMGFile

nominalizationsFile

public static java.lang.String nominalizationsFile

adverbsAntonymFile

public static java.lang.String adverbsAntonymFile

BUFFER_SIZE

public static int BUFFER_SIZE

ELSMthreshold

public static double ELSMthreshold

numberCharacters

public static java.lang.String numberCharacters
Constructor Detail

MatchManager

public MatchManager()
             throws SMatchException
Throws:
SMatchException

MatchManager

public MatchManager(java.lang.String propFileName)
             throws SMatchException
Throws:
SMatchException
Method Detail

getInstance

public static IMatchManager getInstance()
                                 throws SMatchException
Throws:
SMatchException

setSatSolver

public static void setSatSolver(java.lang.String satSolverClass)

setWNMatcher

public static void setWNMatcher(java.lang.String WNMatcher)

setLinguisticOracle

public static void setLinguisticOracle(java.lang.String linguisticOracle)

setClassifier

public static void setClassifier(java.lang.String classifier)

setPreprocessor

public static void setPreprocessor(java.lang.String preprocessor)

setMatcherLibrary

public static void setMatcherLibrary(java.lang.String matcherLibrary)

setLoader

public static void setLoader(java.lang.String loader)

setMappingRenderer

public static void setMappingRenderer(java.lang.String mappingRenderer)

setContextRenderer

public static void setContextRenderer(java.lang.String contextRenderer)

setFilter

public static void setFilter(java.lang.String filter)

setTreeMatcher

public static void setTreeMatcher(java.lang.String treeMatcher)

getWordNetDictionary

public static Dictionary getWordNetDictionary()

getIWNMatcher

public static IWordNetMatcher getIWNMatcher()

getLinguisticOracle

public static ILinguisticOracle getLinguisticOracle()

getPreprocessor

public IPreprocessor getPreprocessor()

getMatcherLibrary

public IMatcherLibrary getMatcherLibrary()

getIContext

public static IContext getIContext()

setProperties

public void setProperties(java.util.Properties properites)
Description copied from interface: IMatchManager
Set up the matching properties A list of parameters which influence on the matching process workflow

name of the class which implements IWordNetMatcher interface
WNmatcher = it.unitn.disi.smatch.oracles.wordnet.InMemoryWordNet

name of the class which implements ILinguisticOracle interface
LinguisticOracle = it.unitn.disi.smatch.oracles.wordnet.WordNet

name of the class which implements IClassifier interface
Classifier = it.unitn.disi.smatch.classifiers.DefaultClassifier

name of the class which implements IPreprocessor interface
Preprocessor = it.unitn.disi.smatch.preprocessors.DefaultPreprocessor

name of the class which implements IMatcherLibrary interface
MatcherLibrary = it.unitn.disi.smatch.matchers.element.MatcherLibrary

name of the class which implements ILoader interface
Loader = it.unitn.disi.smatch.loaders.CTXMLLoader

name of the class which implements IMappingRenderer interface
MappingRenderer = it.unitn.disi.smatch.renderers.mapping.DefaultHTMLMappingRenderer

name of the class which implements IContextRenderer interface
ContextRenderer = it.unitn.disi.smatch.renderers.context.CTXMLContextRenderer

name of the class which implements IFilter interface
Filter = it.unitn.disi.smatch.filters.DefaultFilter

Specified by:
setProperties in interface IMatchManager

getClassForName

public static java.lang.Object getClassForName(java.lang.String className)

retainValue

public static void retainValue(java.util.Vector<java.lang.String> v,
                               java.lang.String value)
Retains value in vector

Parameters:
v - vector
value - value

initJWNL

public static void initJWNL()
                     throws SMatchException
Performs JWNL and JWNL logger initialization routines. Needs to be performed once before matching process.

Throws:
SMatchException - SMatchException

printMemoryUsage

public static void printMemoryUsage()

preprocess

public IContext preprocess(IContext ctxSource)
Description copied from interface: IMatchManager
Performs the first step of the semantic matching algorithm

Specified by:
preprocess in interface IMatchManager
Parameters:
ctxSource - interface to context to be preprocessed
Returns:
interface to preprocessed context

classify

public IContext classify(IContext ctxSource)
Description copied from interface: IMatchManager
Performs the second step of the semantic matching algorithm

Specified by:
classify in interface IMatchManager
Parameters:
ctxSource - interface to preprocessed context without concept at node formulas
Returns:
interface to preprocessed without concept at node formulas

renderContext

public void renderContext(IContext ctxSource,
                          java.lang.String fileName)
Description copied from interface: IMatchManager
Renders context to screen,file or database

Specified by:
renderContext in interface IMatchManager
Parameters:
ctxSource - context to be rendered
fileName - string which defines output device

elementLevelMatching

public IMatchMatrix 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
Returns:
interface to matrix of semantic relations between atomic concepts of labels in the contexts
Throws:
SMatchException

structureLevelMatching

public IMatchMatrix structureLevelMatching(IContext sourceContext,
                                           IContext targetContext,
                                           IMatchMatrix ClabMatrix)
                                    throws SMatchException
Description copied from interface: IMatchManager
Performs the fourth step of semantic matching algorithm

Specified by:
structureLevelMatching in interface IMatchManager
ClabMatrix - interface to matrix of semantic relations between atomic concepts of labels in the contexts
Returns:
interface to matrix of semantic relations between concepts at nodes in the contexts
Throws:
SMatchException

filter

public IMatchMatrix filter(java.util.Vector args)
Description copied from interface: IMatchManager
Performs additional filtering step executed after 4th step of semantic matching algorithm

Specified by:
filter in interface IMatchManager
Parameters:
args - parameters to the filtering process (as in DefaultFilter implementation)
0 element fileName name of file for intermediate filtering results
1 element IMatchMatrix CnodMatrix matrix of semantic relations between concepts at nodes
2 element IMatchMatrix ClabMatrix matrix of semantic relations between concepts of labels
3 element IContext sourceContext
4 element IContext targetContext
all the other elements are reserved for future use
Returns:
interface to filtered matrix of semantic relations between concepts at nodes (CnodMatrix)

renderMapping

public IMapping renderMapping(java.util.Vector args)
Description copied from interface: IMatchManager
Renders mappings into appropriate format

Specified by:
renderMapping in interface IMatchManager
Parameters:
args - parameters to the rendering process (as in DefaultHTMLMappingRenderer implementation)
0 element fileName name of file for intermediate filtering results
1 element IMatchMatrix CnodMatrix matrix of semantic relations between concepts at nodes
2 element IMatchMatrix ClabMatrix matrix of semantic relations between concepts of labels
3 element IContext sourceContext
4 element IContext targetContext

offline

public IContext offline(IContext ctxSource,
                        java.lang.String ctxsSourceFile)
Performs linguistic preprocessing

Specified by:
offline in interface IMatchManager
Parameters:
ctxSource - context to preprocessors
ctxsSourceFile - file to save preprocessed context
Returns:
interface to preprocessed context

online

public IMapping online(IContext sourceContext,
                       IContext targetContext)
                throws SMatchException
Description copied from interface: IMatchManager
Performs the last two steps of the semantic matching algorithm, filtering and render the results by current IMappingRender

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

match

public IMapping 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 context to be matched
targetContext - interface to context to be matched
Returns:
interface to resulting mapping
Throws:
SMatchException

loadContext

public IContext loadContext(java.lang.String fileName)
                     throws SMatchException
Loads context

Specified by:
loadContext in interface IMatchManager
Parameters:
fileName - file to load
Returns:
instance of context
Throws:
SMatchException

main

public static void main(java.lang.String[] args)
                 throws SMatchException
Throws:
SMatchException


© 2010 Knowdive @ DISI