nectec.semantic.web.knowledge.application.framework.recommender
Class RuleHandler

java.lang.Object
  extended by nectec.semantic.web.knowledge.application.framework.recommender.RuleHandler

public class RuleHandler
extends Object

Act as a rule handler for Recommender application and contain all the convenient methods of applying rules to data, adding data to the model by means of rules.


Constructor Summary
RuleHandler(String root)
          Constructor method and should not be called directly.
 
Method Summary
 void applyRuleAndAddNewKnowledge(boolean debug)
          Apply the rules and add new knowledge to the model as appropriate.
 HashMap<String,String> getRuleDependencies()
          Get the pairs of rule dependencies.
 String getRuleDependency(String ruleName)
          Get Dependency about given rule.
 String getRuleInformation(String ruleName)
          Get Information about given rule.
 HashMap<String,String> getRuleInfos()
          Get the pairs of rule information.
 void printListOfMalformedLineInRules()
           
 void setCurrentApplicationPath(String newAppPath)
          Set the current application path (domain) to another.
 void setModels(com.hp.hpl.jena.ontology.OntModel model)
          Set the main model for knowledge base.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleHandler

public RuleHandler(String root)
Constructor method and should not be called directly. (Instead one should get this object from class 'ServiceRepresentative')

Parameters:
root - - Root path of the Recommender application.
Method Detail

applyRuleAndAddNewKnowledge

public void applyRuleAndAddNewKnowledge(boolean debug)
                                 throws Exception
Apply the rules and add new knowledge to the model as appropriate.

Throws:
Exception

printListOfMalformedLineInRules

public void printListOfMalformedLineInRules()

getRuleDependencies

public HashMap<String,String> getRuleDependencies()
Get the pairs of rule dependencies.

Returns:
Key Value pairs of rule dependencies.

getRuleInfos

public HashMap<String,String> getRuleInfos()
Get the pairs of rule information.

Returns:
Key Value pairs of rule information.

getRuleInformation

public String getRuleInformation(String ruleName)
Get Information about given rule.

Parameters:
ruleName - Rule name.
Returns:
Information of the given rule.

getRuleDependency

public String getRuleDependency(String ruleName)
Get Dependency about given rule.

Parameters:
ruleName - Rule name.
Returns:
Dependency information of the given rule.

setCurrentApplicationPath

public void setCurrentApplicationPath(String newAppPath)
Set the current application path (domain) to another.

Parameters:
newAppPath - New application path.

setModels

public void setModels(com.hp.hpl.jena.ontology.OntModel model)
Set the main model for knowledge base.

Parameters:
model - Model to be set.