nectec.semantic.web.knowledge.application.framework.representative
Class ServiceRepresentative

java.lang.Object
  extended by nectec.semantic.web.knowledge.application.framework.representative.ServiceRepresentative

public class ServiceRepresentative
extends Object

Main representative for the applications (Semantic Search, Recommender, etc). It can also act as a class factory.


Constructor Summary
ServiceRepresentative()
           
 
Method Summary
static boolean checkDataExistenceForRecommender(String root)
          Check whether all data is in place in order to get recommender properly running or not.
static boolean checkDataExistenceForSemanticSearch(String root)
          Check whether all data is in place in order to get Semantic Search properly running or not.
static Mapping createMappingInstance()
          Get the object of the Mapping class.
static Recommender createRecommenderInstance(String targetClass, String root, com.hp.hpl.jena.ontology.OntModel kbase)
          Get the object of the Recommender class which will handle all the querying task to the given model.
static RuleHandler createRuleHandler(String root, boolean combineData)
          Get the object of the RuleHandler class.
static SemanticSearch createSemanticSearchInstance(String targetClass, String root, com.hp.hpl.jena.ontology.OntModel kbase)
          Get the object of the SemanticSearch class which will handle all the querying task to the given model.
static String getAbsoloutePath(String alias)
          Get the absolute path of the given alias, on file system.
static String getAlias(String absPath)
          Get the alias of the given absolute path on file system.
static ArrayList<String> getAliasesForIncludedPaths()
          Get alias names for application domains that are set to be included.(in java property file).
static ArrayList<String> getAppPathOfGivenClass(String className)
          Get the application path (alias name) of given class (concept).
static ArrayList<String> getClassesInAllAppPaths()
          Get the class names in all included application paths.
static com.hp.hpl.jena.ontology.OntModel loadModelForRecommender(String root, boolean combineData)
          Load the model which contains instance data to be used in recommender queries.
static com.hp.hpl.jena.ontology.OntModel loadModelForRecommenderBeforeRule(String root, boolean combineData)
          Load the model which contains instance data to be used in recommender queries.
static com.hp.hpl.jena.ontology.OntModel loadModelForSemanticSearch(String root, boolean combineData)
          Load the model which contains instance data to be used in Semantic Search.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceRepresentative

public ServiceRepresentative()
Method Detail

loadModelForSemanticSearch

public static com.hp.hpl.jena.ontology.OntModel loadModelForSemanticSearch(String root,
                                                                           boolean combineData)
Load the model which contains instance data to be used in Semantic Search.

Parameters:
root - File location of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
combineData - If it is true, all the data from specified paths will be collected into the memory instead of getting only from specified root.
Returns:
- Ontology model for Semantic Search.

loadModelForRecommender

public static com.hp.hpl.jena.ontology.OntModel loadModelForRecommender(String root,
                                                                        boolean combineData)
Load the model which contains instance data to be used in recommender queries.

Parameters:
root - Root of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
combineData - If it is true, all the data from specified paths will be collected into the memory instead of getting only from specified root.
Returns:
Ontology model for recommender.

loadModelForRecommenderBeforeRule

public static com.hp.hpl.jena.ontology.OntModel loadModelForRecommenderBeforeRule(String root,
                                                                                  boolean combineData)
Load the model which contains instance data to be used in recommender queries. (Before Applying rules, essentially same as semantic search model)

Parameters:
root - Root of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
combineData - If it is true, all the data from specified paths will be collected into the memory instead of getting only from specified root.
Returns:
Ontology model for recommender.

checkDataExistenceForSemanticSearch

public static boolean checkDataExistenceForSemanticSearch(String root)
Check whether all data is in place in order to get Semantic Search properly running or not.

Parameters:
root - File location of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
Returns:
true (All files in place) or false (Some files missing).

checkDataExistenceForRecommender

public static boolean checkDataExistenceForRecommender(String root)
Check whether all data is in place in order to get recommender properly running or not.

Parameters:
root - File location of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
Returns:
true (All files are in place) or false (Some files are missing).

createSemanticSearchInstance

public static SemanticSearch createSemanticSearchInstance(String targetClass,
                                                          String root,
                                                          com.hp.hpl.jena.ontology.OntModel kbase)
Get the object of the SemanticSearch class which will handle all the querying task to the given model.

Parameters:
targetClass - Target class name to be searched (e.g. Person, Food, etc).
root - Root of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
kbase - Ontology model which contains instance data.
Returns:
Semantic Search object.

createRecommenderInstance

public static Recommender createRecommenderInstance(String targetClass,
                                                    String root,
                                                    com.hp.hpl.jena.ontology.OntModel kbase)
Get the object of the Recommender class which will handle all the querying task to the given model.

Parameters:
targetClass - Target class name to be recommended (e.g. Person, Food, etc).
root - Root of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
kbase - Ontology model to be used.
Returns:
Recommender object.

createMappingInstance

public static Mapping createMappingInstance()
Get the object of the Mapping class.

Returns:
Mapping object.

createRuleHandler

public static RuleHandler createRuleHandler(String root,
                                            boolean combineData)
Get the object of the RuleHandler class.

Parameters:
root - File location of the application data (e.g. "D:/NECTEC/SKAF_HOME/AppData/Employee").
Returns:
RuleHandler object.

getAliasesForIncludedPaths

public static ArrayList<String> getAliasesForIncludedPaths()
Get alias names for application domains that are set to be included.(in java property file).

Returns:
List of these aliases.

getAbsoloutePath

public static String getAbsoloutePath(String alias)
Get the absolute path of the given alias, on file system.

Parameters:
alias - Alias name.
Returns:
Absolute file path.

getAlias

public static String getAlias(String absPath)
Get the alias of the given absolute path on file system.

Parameters:
alias - Absolute path.
Returns:
Alias name.

getAppPathOfGivenClass

public static ArrayList<String> getAppPathOfGivenClass(String className)
Get the application path (alias name) of given class (concept).

Parameters:
className - Input class name.
Returns:
Collection of application path that contains given class.

getClassesInAllAppPaths

public static ArrayList<String> getClassesInAllAppPaths()
Get the class names in all included application paths.

Returns:
Collection of class names.