it.uniroma2.art.coda.core
Class CODACore

java.lang.Object
  extended by it.uniroma2.art.coda.core.CODACore

public class CODACore
extends java.lang.Object

Author:
Andrea Turbati

Constructor Summary
CODACore()
          Constructor of this class
 
Method Summary
 void closeRDFModel()
          Close the RDFModel
 java.util.HashMap<java.lang.String,IdentityResolverInterface> getIdentityResolverMap()
          This method get the Identity Resolution Annotation Map
 java.util.HashMap<java.lang.String,ProjectionRulesDeciderInterface> getProjectionRulesDeciderMap()
          This method get the Projection Rule Decider Annotation Map
 ProjectionRulesModel getProjRuleModel()
          Get the Projection Rule Model
 java.util.HashMap<java.lang.String,ResourcesSmartSuggesterInterface> getResourcesSmartSuggesterMap()
          This method get the Smart Suggestion Resources Map
 java.util.HashMap<java.lang.String,TriplesSmartSuggesterInterface> getTriplesSmartSuggesterMap()
          This method get the Smart Suggestion Triple Map
 void initialize(org.apache.uima.jcas.JCas jcas, java.io.File oSGiDir, java.lang.String rootDir, boolean subDirPresent, java.lang.String projRulePath, it.uniroma2.art.owlart.models.RDFModel rdfModel, PreviousDecisions prevDecision)
          Initialize the framework and should be called just after the constructor, before all other methods
 boolean isAnotherAnnotationPrsent()
          This method return true if there is another UIMA annotation in the cas, false otherwise
 SuggOntologyCoda processNextAnnotation()
          This method process the next UIMA annotation and return the hints from the five modules
 void setIdentityResolver(IdentityResolverInterface identityResolution)
          This method set the Identity Resolution Annotation
 void setJCas(org.apache.uima.jcas.JCas jcas)
          Set the UIMA CAS containing all the UIMA annotation
 void setMaxNumAnswerIR(int maxNumAnswerIR)
          This method set the maximum number of hint that the Identity Resolution can return
 void setMaxNumAnswerPD(int maxNumAnswerPD)
          This method set the maximum number of hint that the Projection Disambiguation can return
 void setMaxNumAnswerRSS(int maxNumAnswerRSS)
          This method set the maximum number of hint that the Resources Smart Suggestion can return
 void setMaxNumAnswerTSS(int maxNumAnswerTSS)
          This method set the maximum number of hint that the Triples Smart Suggestion can return
 void setProjectionRulesDecider(ProjectionRulesDeciderInterface projectionDisambiguation)
          This method set the Projection Rules Decider
 void setRDFModel(it.uniroma2.art.owlart.models.RDFModel rdfModel)
          Set the ontology model (RDFModel)
 void setResourcesSmartSuggester(ResourcesSmartSuggesterInterface resourcesSmartSuggester)
          This method set the Smart Suggestion Resources
 void setTriplesSmartSuggester(TriplesSmartSuggesterInterface triplesSmartSuggester)
          This method set the Smart Suggestion Triples
 void stopAndClose()
          Close the rdfModel and stop Felix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CODACore

public CODACore()
Constructor of this class

Method Detail

initialize

public void initialize(org.apache.uima.jcas.JCas jcas,
                       java.io.File oSGiDir,
                       java.lang.String rootDir,
                       boolean subDirPresent,
                       java.lang.String projRulePath,
                       it.uniroma2.art.owlart.models.RDFModel rdfModel,
                       PreviousDecisions prevDecision)
                throws FelixInitializationException,
                       PRParserException
Initialize the framework and should be called just after the constructor, before all other methods

Parameters:
jcas - the CAS received form the UIMA AE or AAE
oSGiDir - the directory in which felix will store the cache for its bundles
rootDir - the directory in which felix will search for the bundle using a particular search strategy
subDirPresent - true if in the rootDir there are the subdirectories in which to look for directory containing bundles, false otherwise
projRulePath - the path of the Projection Rule file
rdfModel - the ontology model created with a particular repository manager
prevDecision - is the structure containing the previous decision taken by the tool using the suggestions provided by CODA
Throws:
FelixInitializationException
PRParserException

stopAndClose

public void stopAndClose()
                  throws it.uniroma2.art.owlart.exceptions.ModelUpdateException
Close the rdfModel and stop Felix

Throws:
it.uniroma2.art.owlart.exceptions.ModelUpdateException

setJCas

public void setJCas(org.apache.uima.jcas.JCas jcas)
Set the UIMA CAS containing all the UIMA annotation

Parameters:
jcas - the jcas that will be set

setRDFModel

public void setRDFModel(it.uniroma2.art.owlart.models.RDFModel rdfModel)
Set the ontology model (RDFModel)

Parameters:
rdfModel - the ontology model

closeRDFModel

public void closeRDFModel()
                   throws it.uniroma2.art.owlart.exceptions.ModelUpdateException
Close the RDFModel

Throws:
it.uniroma2.art.owlart.exceptions.ModelUpdateException

getProjRuleModel

public ProjectionRulesModel getProjRuleModel()
Get the Projection Rule Model

Returns:
the projection rule model

getProjectionRulesDeciderMap

public java.util.HashMap<java.lang.String,ProjectionRulesDeciderInterface> getProjectionRulesDeciderMap()
This method get the Projection Rule Decider Annotation Map

Returns:
the Projection Disambiguation Map

getIdentityResolverMap

public java.util.HashMap<java.lang.String,IdentityResolverInterface> getIdentityResolverMap()
This method get the Identity Resolution Annotation Map

Returns:
the Identity Resolution Annotation Map

getResourcesSmartSuggesterMap

public java.util.HashMap<java.lang.String,ResourcesSmartSuggesterInterface> getResourcesSmartSuggesterMap()
This method get the Smart Suggestion Resources Map

Returns:
the Smart Suggestion Map

getTriplesSmartSuggesterMap

public java.util.HashMap<java.lang.String,TriplesSmartSuggesterInterface> getTriplesSmartSuggesterMap()
This method get the Smart Suggestion Triple Map

Returns:
the Smart Suggestion Triple Map

setProjectionRulesDecider

public void setProjectionRulesDecider(ProjectionRulesDeciderInterface projectionDisambiguation)
This method set the Projection Rules Decider

Parameters:
projectionDisambiguation - the Projection Disambiguation Annotation

setIdentityResolver

public void setIdentityResolver(IdentityResolverInterface identityResolution)
This method set the Identity Resolution Annotation

Parameters:
identityResolution - the Identity Resolution Annotation

setResourcesSmartSuggester

public void setResourcesSmartSuggester(ResourcesSmartSuggesterInterface resourcesSmartSuggester)
This method set the Smart Suggestion Resources

Parameters:
resourcesSmartSuggester - the Smart Suggestion Resources

setTriplesSmartSuggester

public void setTriplesSmartSuggester(TriplesSmartSuggesterInterface triplesSmartSuggester)
This method set the Smart Suggestion Triples

Parameters:
triplesSmartSuggester - the Smart Suggestion Resources

isAnotherAnnotationPrsent

public boolean isAnotherAnnotationPrsent()
This method return true if there is another UIMA annotation in the cas, false otherwise

Returns:
true if there is another UIMA annotation in the cas, false otherwise

setMaxNumAnswerPD

public void setMaxNumAnswerPD(int maxNumAnswerPD)
This method set the maximum number of hint that the Projection Disambiguation can return

Parameters:
maxNumAnswerPD - the maximum number of hint that the Projection Disambiguation can return

setMaxNumAnswerIR

public void setMaxNumAnswerIR(int maxNumAnswerIR)
This method set the maximum number of hint that the Identity Resolution can return

Parameters:
maxNumAnswerIR - the maximum number of hint that the Identity Resolution can return

setMaxNumAnswerRSS

public void setMaxNumAnswerRSS(int maxNumAnswerRSS)
This method set the maximum number of hint that the Resources Smart Suggestion can return

Parameters:
maxNumAnswerRSS - the maximum number of hint that the Resources Smart Suggestion can return

setMaxNumAnswerTSS

public void setMaxNumAnswerTSS(int maxNumAnswerTSS)
This method set the maximum number of hint that the Triples Smart Suggestion can return

Parameters:
maxNumAnswerTSS - the maximum number of hint that the Triples Smart Suggestion can return

processNextAnnotation

public SuggOntologyCoda processNextAnnotation()
                                       throws it.uniroma2.art.owlart.exceptions.UnsupportedQueryLanguageException,
                                              it.uniroma2.art.owlart.exceptions.ModelAccessException,
                                              it.uniroma2.art.owlart.query.MalformedQueryException,
                                              it.uniroma2.art.owlart.exceptions.QueryEvaluationException,
                                              CODAComponentNotSetException
This method process the next UIMA annotation and return the hints from the five modules

Returns:
the hints from the five module or null if there are no further UIMA annotation
Throws:
it.uniroma2.art.owlart.exceptions.QueryEvaluationException
it.uniroma2.art.owlart.query.MalformedQueryException
it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.exceptions.UnsupportedQueryLanguageException
CODAComponentNotSetException