|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnectec.semantic.web.knowledge.application.framework.common.Common
public abstract class Common
Abstract class for storing common variables and useful methods used in many places internally to perform desired function. It is also available for general public use.
Field Summary | |
---|---|
static String |
CLASS_ONT
In each mapping configuration file, this will be the 'key' name for storing the name of ontology class, which will be aligned to the database table. |
static String |
DISPLAY_PT
In each configuration file (except mapping), this will be the 'key' name for storing sequence of the names of ontology properties which are used (when information of an instance is requested) to deliver these information of that particular instance specified. |
static String |
ENCODING
Character encoding used for I/O tasks. |
static String |
INTERNAL_NAMESPACE
Namespace used for storing immediate RDF data produced by D2RQ module (Not for public use). |
static String |
ONTOLOGY_FILE
In each configuration file (mapping, searching, etc), this will be the 'key' name for storing the name of ontology file. |
static String |
PATHS
In each configuration file (except mapping), this will be the 'key' name for storing the sequences of class names of interest. |
static String |
PT_LABEL
In each mapping configuration file, this will be the 'key' name for storing the label (different from rdfs:label) for the respective ontology property. |
static boolean |
SHOW_INFO
Boolean flag to indicate whether the system will show the series of detailed information (SPARQL query string used, for example) as the processing goes so that user can trace how any particular function works, or not. |
static String |
TABLEDB
In each mapping configuration file, this will be the 'key' name for storing the name of database table, which will be aligned to the class of the ontology. |
static String |
TARGET_UNQ_PTY
In each configuration file (except mapping), this will be the 'key' name for storing the name of ontology property, which can be treated as a unique ID to identify its instance. |
static String |
UNIQUE_ID_ONT
In each mapping configuration file, this will be the 'key' name for storing the name of ontology property, which can be treated as a unique ID to identify its instance. |
Constructor Summary | |
---|---|
Common()
|
Method Summary | |
---|---|
static boolean |
containsElement(ArrayList<String> inputCollection,
String elementToTest)
Check whether the given collection contains certain element or not. |
static ArrayList<String> |
convertArrayToArrayList(String[] inputArray)
Transform from String Array data structure into String ArrayList. |
static ArrayList<String> |
customTokenize(String inputString,
String delimiter)
Extend the function of standard Java class 'Tokenizer' in the way that it returns the tokens in a collection. |
static void |
deleteDirectoryOrFile(File path)
Delete the directory of given path including the files inside the directory. |
static ArrayList<String> |
getAllHozoSpecificDatatypes(String NS)
Get the list of terminologies (resource names) that are specific to HOZO ontology editor. |
static boolean |
isDouble(String inputString)
Check whether the input String is datatype double or not. |
static boolean |
isInteger(String inputString)
Check whether the input String is datatype integer(int) or not. |
static boolean |
isNumberConvertibleString(String inputString)
Check whether the given string is possible to convert number format. |
static String |
printInfo(String inputString)
Print the input string if 'Common.SHOW_INFO' is true. |
static HashMap<String,String> |
readAllConfig(String app_dir,
String root)
Basically work in the same way as "readMaps()" function except that this aware the common configuration of the given application directory. |
static ArrayList<String> |
readLines(String fileName,
String filePath)
Read the lines from a given file and return them as a collection. |
static HashMap<String,String> |
readMaps(String fileName,
String filePath)
Read the given file in which each line represents key-value pairs separated by "|" character. |
static ArrayList<String> |
removeDuplicate(ArrayList<String> inputCollection)
Look for the duplicate elements in the given collection and remove them so that only unique elements are stored. |
static ArrayList<String> |
removeHozoProprietaryResources(ArrayList<String> inputCollection)
Remove all the proprietary (non-standard) resources provided by HOZO Ontology Editor. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean SHOW_INFO
public static final String CLASS_ONT
public static final String TABLEDB
public static final String PT_LABEL
public static final String INTERNAL_NAMESPACE
public static final String ONTOLOGY_FILE
public static final String PATHS
public static String ENCODING
public static final String UNIQUE_ID_ONT
public static final String TARGET_UNQ_PTY
public static final String DISPLAY_PT
Constructor Detail |
---|
public Common()
Method Detail |
---|
public static ArrayList<String> convertArrayToArrayList(String[] inputArray)
inputArray
- String Array to be converted.
public static boolean isDouble(String inputString)
inputString
- String to be checked.
public static boolean isInteger(String inputString)
inputString
- String to be checked.
public static ArrayList<String> readLines(String fileName, String filePath)
fileName
- Name of the file to be read.filePath
- Location of the file on system.
public static HashMap<String,String> readMaps(String fileName, String filePath)
fileName
- Name of the file to be read.filePath
- Location of the file on system.
public static HashMap<String,String> readAllConfig(String app_dir, String root)
app_dir
- Application directory name which represents a class name in ontology.root
- Path that 'common.cfg' is located.
public static boolean containsElement(ArrayList<String> inputCollection, String elementToTest)
inputCollection
- Collection from which function will find the element.elementToTest
- Element to be searched.
public static ArrayList<String> customTokenize(String inputString, String delimiter)
inputString
- String to be tokenized.delimiter
- Character(s) to be used as a separator.
public static ArrayList<String> removeDuplicate(ArrayList<String> inputCollection)
inputCollection
- Collection of elements, that may or may not contains duplicate elements.
public static ArrayList<String> removeHozoProprietaryResources(ArrayList<String> inputCollection)
inputCollection
- Collection of resources containing HOZO-generated resources.
public static void deleteDirectoryOrFile(File path)
path
- Directory path on the system.public static ArrayList<String> getAllHozoSpecificDatatypes(String NS)
NS
- Namespace for the ontology of interest.
public static boolean isNumberConvertibleString(String inputString)
inputString
- Input String.
public static String printInfo(String inputString)
inputString
- Input string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |