Package com.semedy.reasoner.api.core
Class Configuration
java.lang.Object
com.semedy.reasoner.api.core.Configuration
Provides configurations for the reasoning kernel
- Author:
- angele
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow are relations stored:
- in main memory only (RAM)
- persistent on disc (PERSISTENT)
- mixed on disc and in main memory (MIXED)
- at a given host -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()clone configurationreturns the directory for bakcupsreturns the cron schedule for backupsreturns the benchmark directoryGet the additional built-in properties.get the cluster idreturns the directory for the extensional databasereturns where extensional database (edb) is stored
in main memory, persistent on disc or mixedreturns the directory for importsString[]get the edb properties to be indexedreturns the json partitioning schemaintreturns the number of threads used for loading (max)local host namereturns the directory for logging informationintReturns the max prefix of a term which uniquely identifies the term.longRelations or sub relations with number of terms less
than result are loaded as main memory or mixed relationsreturns the tuple partitioning schemagetProxy()get cluster proxyreturns the directory for queriesintreturns the number of threads used for reasoning (max)String[]get all JSON properties which are represented as closed setsget the settings for geo indexingbooleanreturns whether symbol table is in main memoryintinto how many pieces is the symbol table splitget the settings for the text indexingreturns the directory for temporary filesreturns the directory for the unit testsbooleanreturns whether body ordering is onbooleanIs edb compressedbooleanis result deilvered by consumer producer patternbooleanreturns whether reasoner swaps intermediate resultsbooleanReturns the direct encoding flag.booleanreturns whether duplicates are eliminatedbooleanmeasure times during reasoning?booleanIs symbol table recreated during start upbooleanare facts retractable during stream reasoningbooleanist fast levenshtein on and lucene index offbooleanreturns whether answers are skippedbooleanIs stream reasoning enabled?booleanreturns whether reasoner swaps intermediate resultsbooleanbooleanreturns whether symbol table is located in main memorybooleanbooleanReturns whether top-down reasoning (backward chaining) in on,
i.e. whether supplementary magic sets transformation is applied to the rulesbooleanshould transactions be logged in transaction logvoidload()load the configuration from the standard pathvoidload(InputStream in) load the configuration from the given pathvoidload the configuration from the given pathvoidload(Properties properties) load the configuration from a given properties objectvoidload the properties for built-ins from given input streamvoidloadBuiltinProperties(String path) load the properties for built-ins from given pathvoidMerge the current configuration with the configuration c.voidseBackupDir(String dir) set the directory for backupsvoidsetBenchmarkDir(String benchmarkDir) sets the benchmark directoryvoidsetBodyOrdering(boolean bo) set body ordering on or offvoidsetCEPReasoning(boolean stream) set stream reasoningvoidsetCompressEDB(boolean b) Should edb be compressed?voidsetDebugging(boolean debug) set the debugging switchvoidsetDirectEncoding(boolean directEncoding) Sets the direct encoding flag.voidsets the directory for the extensional databasevoiddefines where the extensional database (edb) is storedvoidsetImportDir(String importDir) sets the directory for the importsvoidsetIndexedProperties(String[] properties) set the edb properties to be indexedvoidsets the json partitioning schemavoidsetLoadingThreads(int threads) returns the number of threads used for loading (max)voidsetLoggingDir(String dir) set the directory for logsvoidsetMaxTermLength(int maxTermLength) sets the max unique identifying prefix of a termvoidsets the tuple partitioning schemavoidsetQueryDir(String dir) set the directory for the queriesvoidsetRetracts(boolean b) set whether facts are retractable during stream reasoningvoidsetSetProperties(String[] props) set JSON properties which are represented as closed setsvoidsetShinglesIndex(boolean b) set fast Levenshtein index (switch lucene index off)booleansetSkipAnswers(boolean b) sets whether answers are skippedvoidsetSwapping(boolean swap) set swapping of intermediate reasoning resultsvoidsetSymbolTableGeoIndex(Boolean value) defines whether a geo index is createdvoidsetSymbolTableInMainMemory(boolean symbolTableInMainMemory) sets the location of symbol table (in main memory or persistent)voidsetSymbolTableParts(int parts) set into how many pieces the symbol table is splitvoidsetSymbolTableTextIndex(Boolean value) defines whether a text index is created.voidsetTempDir(String tempDir) sets the directory for temporary filesvoidsetThreads(int threads) sets the max number of threads for reasoningvoidsetTopDownReasoning(boolean topDownReasoning) sets the top-down reasoning flagvoidsetTransactionLog(boolean t) set the transaction log
-
Field Details
-
CONFIG_UNIT_TESTS_DIRECTORY
Option to overwrite default unit tests directory. -
_edbDir
extensional database settings -
_tempDir
-
_logDir
-
_backupDir
-
_importDir
-
_EDBStorageType
-
_transactionLog
-
MAXTERMSPERGIG
public int MAXTERMSPERGIG -
_backupSchedule
-
_compressEDB
-
_partitioning
-
_jsonPartitioning
-
_indexedProperties
-
_loadingThreads
-
_setProperties
-
_symbolTableInMainMemory
symbol table settings -
_directEncoding
-
_maxTermLength
-
_symbolTableTextIndex
-
_symbolTableTextIndexSettings
-
_symbolTableGeoIndex
-
_symbolTableGeoIndexSettings
-
_recreateSymbolTableSearchIndexesOnStartup
-
_isShingles
-
_symbolTableParts
-
_topDownReasoning
reasoning settings -
_bodyOrdering
-
_reasoningThreads
-
_retracts
-
_swapping
-
_debugging
-
_streamReasoning
-
_consumerProducer
-
_measureTimes
-
_skipAnswers
-
_unitTestsDir
directories -
_benchmarkDir
-
_queryDir
-
_eliminateDuplicates
others -
_path
-
_builtinProperties
-
_clusterId
cluster -
_proxy
-
-
Constructor Details
-
Configuration
public Configuration() -
Configuration
-
-
Method Details
-
merge
Merge the current configuration with the configuration c.
Current configuration has priority which means if a value
for a property is given in the current configuration it will be retained- Parameters:
c- , configuration to merge in
-
clone
clone configuration -
getClusterId
get the cluster id- Returns:
-
getIndexedProperties
get the edb properties to be indexed- Returns:
-
setIndexedProperties
set the edb properties to be indexed -
getBuiltinProperties
Get the additional built-in properties.
These are given to each built-in.
Example for such properties are
the smpt-server for the mail built-in
the login for a database access built-in- Returns:
-
getLocalHost
local host name- Returns:
- Throws:
UnknownHostException
-
load
load the configuration from the standard path- Throws:
IOException
-
loadBuiltinProperties
load the properties for built-ins from given path- Parameters:
path- , the path where the configuration is taken from- Throws:
IOException
-
loadBuiltinProperties
load the properties for built-ins from given input stream- Parameters:
in- , input stream- Throws:
IOException
-
load
load the configuration from the given path- Parameters:
path- , the path where the configuration is taken from- Throws:
IOException
-
load
load the configuration from the given path- Parameters:
in- , input stream- Throws:
IOException
-
load
load the configuration from a given properties object- Parameters:
properties- , given properties object- Throws:
IOException
-
getProxy
get cluster proxy- Returns:
-
isShinglesIndex
public boolean isShinglesIndex()ist fast levenshtein on and lucene index off- Returns:
-
setShinglesIndex
public void setShinglesIndex(boolean b) set fast Levenshtein index (switch lucene index off)- Parameters:
b-
-
isTransactionLog
public boolean isTransactionLog()should transactions be logged in transaction log- Returns:
- transaction logging activated
-
setTransactionLog
public void setTransactionLog(boolean t) set the transaction log- Parameters:
t- , set the transaction log
-
getSymbolTableTextIndexSettings
get the settings for the text indexing- Returns:
- settings for text indexing
-
getMaxTermsToLoad
public long getMaxTermsToLoad()Relations or sub relations with number of terms less
than result are loaded as main memory or mixed relations- Returns:
- max terms of relation to be loaded into main memory
-
getSymbolTableGeoIndexSettings
get the settings for geo indexing- Returns:
- settings for geo indexing
-
getReasoningThreads
public int getReasoningThreads()returns the number of threads used for reasoning (max)- Returns:
- number of threads used for reasoning
-
getLoadingThreads
public int getLoadingThreads()returns the number of threads used for loading (max)- Returns:
- number of threads used for loading
-
setLoadingThreads
public void setLoadingThreads(int threads) returns the number of threads used for loading (max) -
getBackupSchedule
returns the cron schedule for backups- Returns:
-
isRetracts
public boolean isRetracts()are facts retractable during stream reasoning- Returns:
- whether facts are retractable
-
setRetracts
public void setRetracts(boolean b) set whether facts are retractable during stream reasoning- Parameters:
b- , facts are retractable during stream processing or not
-
setCompressEDB
public void setCompressEDB(boolean b) Should edb be compressed?- Parameters:
b-
-
setThreads
public void setThreads(int threads) sets the max number of threads for reasoning- Parameters:
threads- , the number of threads used during reasoning
-
getEDBStorageType
returns where extensional database (edb) is stored
in main memory, persistent on disc or mixed- Returns:
- storage type
-
setEDBStorageType
defines where the extensional database (edb) is stored- Parameters:
type- , the storage type of the edb (ram, persistent, mixed)
-
isTopDownReasoning
public boolean isTopDownReasoning()Returns whether top-down reasoning (backward chaining) in on,
i.e. whether supplementary magic sets transformation is applied to the rules- Returns:
- whether top down reasoning is on
-
isMeasureTimes
public boolean isMeasureTimes()measure times during reasoning?- Returns:
-
setTopDownReasoning
public void setTopDownReasoning(boolean topDownReasoning) sets the top-down reasoning flag- Parameters:
topDownReasoning-
-
getEDBDir
returns the directory for the extensional database- Returns:
- the directory for the extensional database
-
getLoggingDir
returns the directory for logging information- Returns:
- the directory for the log directory
-
getBackupDir
returns the directory for bakcups- Returns:
- the directory for the backup directory
-
getPartitioning
returns the tuple partitioning schema- Returns:
- the partitioning schema
-
setPartitioning
sets the tuple partitioning schema -
getJSONPartitioning
returns the json partitioning schema- Returns:
- the partitioning schema
-
setJSONPartitioning
sets the json partitioning schema -
getImportDir
returns the directory for imports- Returns:
- the directory for the import
-
getQueryDir
returns the directory for queries- Returns:
- the directory for the queries
-
setLoggingDir
set the directory for logs -
seBackupDir
set the directory for backups -
setQueryDir
set the directory for the queries -
getUnitTestsDir
returns the directory for the unit tests- Returns:
- the unit tests directory
-
getBenchmarkDir
returns the benchmark directory- Returns:
- the path of the benchmark directory
-
setEDBDir
sets the directory for the extensional database- Parameters:
edbDir- the directory for the extensional database
-
setImportDir
sets the directory for the imports- Parameters:
importDir- the directory for the imports
-
setBenchmarkDir
sets the benchmark directory- Parameters:
benchmarkDir-
-
getTempDir
returns the directory for temporary files- Returns:
- the path of the temporary directory
-
setTempDir
sets the directory for temporary files- Parameters:
tempDir- , the path of the temporary directory
-
isBodyOrdering
public boolean isBodyOrdering()returns whether body ordering is on- Returns:
- is body ordering on?
-
isSkipAnswers
public boolean isSkipAnswers()returns whether answers are skipped- Returns:
- should answers be skipped
-
setSkipAnswers
public boolean setSkipAnswers(boolean b) sets whether answers are skipped- Returns:
- should answers be skipped
-
setBodyOrdering
public void setBodyOrdering(boolean bo) set body ordering on or off- Parameters:
bo- , body ordering is applied or not
-
isEliminateDuplicates
public boolean isEliminateDuplicates()returns whether duplicates are eliminated- Returns:
-
isSwapping
public boolean isSwapping()returns whether reasoner swaps intermediate results- Returns:
- true, if reasoner is allowed to swap out intermediate results
-
setSwapping
public void setSwapping(boolean swap) set swapping of intermediate reasoning results- Parameters:
swap-
-
isDebugging
public boolean isDebugging()returns whether reasoner swaps intermediate results- Returns:
- true, if reasoner is allowed to swap out intermediate results
-
setCEPReasoning
public void setCEPReasoning(boolean stream) set stream reasoning- Parameters:
stream-
-
isStreamReasoning
public boolean isStreamReasoning()Is stream reasoning enabled?- Returns:
- true
-
setDebugging
public void setDebugging(boolean debug) set the debugging switch- Parameters:
debug-
-
isSymbolTableInMainMemory
public boolean isSymbolTableInMainMemory()returns whether symbol table is located in main memory- Returns:
- true if symbol table is in main memory
-
setSymbolTableInMainMemory
public void setSymbolTableInMainMemory(boolean symbolTableInMainMemory) sets the location of symbol table (in main memory or persistent)- Parameters:
symbolTableInMainMemory-
-
getSymbolTableInMainMemory
public boolean getSymbolTableInMainMemory()returns whether symbol table is in main memory- Returns:
- , symbol table is in main memory
-
getSymbolTableParts
public int getSymbolTableParts()into how many pieces is the symbol table split- Returns:
-
setSymbolTableParts
public void setSymbolTableParts(int parts) set into how many pieces the symbol table is split -
isDirectEncoding
public boolean isDirectEncoding()Returns the direct encoding flag. Direct encoding means that the values of constants are
directly encoded into the codes for constants. This is faster for pure reasoning.
This is not applicable if the values of codes are changed, e.g. by an editor.- Returns:
- true if symbols are directly encoded in 8 bytes (if possible)
-
getSetProperties
get all JSON properties which are represented as closed sets- Returns:
-
setSetProperties
set JSON properties which are represented as closed sets- Parameters:
props- , names of properties
-
isSymbolTableTextIndex
public boolean isSymbolTableTextIndex()- Returns:
trueif the text index for symbols is turned on,falseotherwise
-
setSymbolTableTextIndex
defines whether a text index is created.- Parameters:
value-
-
isConsumerProducer
public boolean isConsumerProducer()is result deilvered by consumer producer pattern- Returns:
-
isSymbolTableGeoIndex
public boolean isSymbolTableGeoIndex()- Returns:
trueif the geo index for symbols is turned on,falseotherwise
-
isCompressEDB
public boolean isCompressEDB()Is edb compressed- Returns:
-
setSymbolTableGeoIndex
defines whether a geo index is created- Parameters:
value-
-
setDirectEncoding
public void setDirectEncoding(boolean directEncoding) Sets the direct encoding flag.
This means that terms are stored in the codes directly, if possible as a code has 7 bytes max.
This has the advantage that for instance in built-ins the symbol table must not be accessed.- Parameters:
directEncoding-
-
getMaxTermLength
public int getMaxTermLength()Returns the max prefix of a term which uniquely identifies the term. The term can be longer though.- Returns:
- the maxTermLength
-
setMaxTermLength
public void setMaxTermLength(int maxTermLength) sets the max unique identifying prefix of a term- Parameters:
maxTermLength- , the number of characters a term is uniquely identified with
-
isRecreateSymbolTableSearchIndexesOnStartup
public boolean isRecreateSymbolTableSearchIndexesOnStartup()Is symbol table recreated during start up- Returns:
-