public class KBmanager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CONFIG_FILE |
boolean |
initializing |
protected HashMap<String,KB> |
kbs |
static int |
USE_CACHE
A numeric (bitwise) constant used to signal whether the closure
of instance and subclass relastions should be "cached out" for
use by the inference engine.
|
static int |
USE_HOLDS_PREFIX
A numeric (bitwise) constant used to signal whether holds
prefixes should be added during formula preprocessing.
|
static int |
USE_TPTP
A numeric (bitwise) constant used to signal whether formulas
should be translated to TPTP format during the processing of KB
constituent files.
|
static int |
USE_TYPE_PREFIX
A numeric (bitwise) constant used to signal whether type
prefixes (sortals) should be added during formula
preprocessing.
|
| Constructor and Description |
|---|
KBmanager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addKB(String name)
Create a new empty KB with a name.
|
void |
addKB(String name,
boolean isVisible) |
ArrayList<String> |
allAvailableLanguages()
Get the the complete list of languages available in all KBs
|
static String |
ccheckResults(String kbName) |
static CCheckManager.CCheckStatus |
ccheckStatus(String kbName) |
static void |
copyFile(File in,
File out)
Read an XML-formatted configuration file.
|
static String |
escapeFilename(String fname)
Double the backslash in a filename so that it can be saved to a text
file and read back properly.
|
boolean |
existsKB(String name)
Returns true if a KB with the given name exists.
|
String |
getError()
Get the error string for file loading.
|
int |
getInferenceBitValue()
Returns an int value, the bitwise interpretation of which
indicates the current configuration of inference parameter
(preference) settings.
|
KB |
getKB(String name)
Get the KB that has the given name.
|
HashSet<String> |
getKBnames()
Get the Set of KB names in this manager.
|
static KBmanager |
getMgr()
Get the one instance of KBmanager from its class variable.
|
int |
getOldInferenceBitValue()
Returns the last cached inference bit value setting.
|
String |
getPref(String key)
Get the preference corresponding to the given kef.
|
boolean |
initializeOnce()
Reads in the KBs and other parameters defined in the XML
configuration file, or uses the default parameters.
|
boolean |
initializeOnce(String configFileDir)
Reads in the KBs and other parameters defined in the XML
configuration file, or uses the default parameters.
|
static CCheckManager.CCheckStatus |
initiateCCheck(KB kb,
String chosenEngine,
String systemChosen,
String location,
String language,
int timeout) |
boolean |
loadKB(String kbName,
List<String> constituents) |
static void |
main(String[] args)
A test method.
|
static KBmanager |
newMgr(String username)
Reset the one instance of KBmanager from its class variable.
|
protected SimpleElement |
readConfiguration(String configDirPath)
Reads an XML configuration file from the directory
configDirPath, and tries to find a configuration file elsewhere
if configDirPath is null.
|
void |
remove(String name)
Remove the KB that has the given name.
|
String |
removeKB(String name)
Remove a knowledge base.
|
void |
setError(String er)
Set an error string for file loading.
|
void |
setOldInferenceBitValue(int bv)
Sets the value of the private variable oldInferenceBitValue.
|
void |
setPref(String key,
String value)
Set the preference to the given value.
|
void |
writeConfiguration()
Write the current configuration of the system.
|
public static final int USE_TYPE_PREFIX
public static final int USE_HOLDS_PREFIX
public static final int USE_CACHE
public static final int USE_TPTP
protected static final String CONFIG_FILE
public boolean initializing
public void setError(String er)
public String getError()
public static CCheckManager.CCheckStatus initiateCCheck(KB kb, String chosenEngine, String systemChosen, String location, String language, int timeout)
public static CCheckManager.CCheckStatus ccheckStatus(String kbName)
public static void copyFile(File in, File out)
protected SimpleElement readConfiguration(String configDirPath)
public boolean initializeOnce()
public boolean initializeOnce(String configFileDir)
public static String escapeFilename(String fname)
public void addKB(String name)
name - - the name of the KBpublic void addKB(String name, boolean isVisible)
public String removeKB(String name)
name - - the name of the KBpublic void writeConfiguration()
throws IOException
IOExceptionpublic boolean existsKB(String name)
public void remove(String name)
public static KBmanager getMgr()
public static KBmanager newMgr(String username)
public ArrayList<String> allAvailableLanguages()
public int getInferenceBitValue()
public int getOldInferenceBitValue()
public void setOldInferenceBitValue(int bv)
public static void main(String[] args)
Copyright © 2015. All rights reserved.