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 enum
How 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 schemaint
returns the number of threads used for loading (max)local host namereturns the directory for logging informationint
Returns the max prefix of a term which uniquely identifies the term.long
Relations 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 queriesint
returns the number of threads used for reasoning (max)String[]
get all JSON properties which are represented as closed setsget the settings for geo indexingboolean
returns whether symbol table is in main memoryint
into how many pieces is the symbol table splitget the settings for the text indexingreturns the directory for temporary filesreturns the directory for the unit testsboolean
returns whether body ordering is onboolean
Is edb compressedboolean
is result deilvered by consumer producer patternboolean
returns whether reasoner swaps intermediate resultsboolean
Returns the direct encoding flag.boolean
returns whether duplicates are eliminatedboolean
measure times during reasoning?boolean
Is symbol table recreated during start upboolean
are facts retractable during stream reasoningboolean
ist fast levenshtein on and lucene index offboolean
returns whether answers are skippedboolean
Is stream reasoning enabled?boolean
returns whether reasoner swaps intermediate resultsboolean
boolean
returns whether symbol table is located in main memoryboolean
boolean
Returns whether top-down reasoning (backward chaining) in on,
i.e. whether supplementary magic sets transformation is applied to the rulesboolean
should transactions be logged in transaction logvoid
load()
load the configuration from the standard pathvoid
load
(InputStream in) load the configuration from the given pathvoid
load the configuration from the given pathvoid
load
(Properties properties) load the configuration from a given properties objectvoid
load the properties for built-ins from given input streamvoid
loadBuiltinProperties
(String path) load the properties for built-ins from given pathvoid
Merge the current configuration with the configuration c.void
seBackupDir
(String dir) set the directory for backupsvoid
setBenchmarkDir
(String benchmarkDir) sets the benchmark directoryvoid
setBodyOrdering
(boolean bo) set body ordering on or offvoid
setCEPReasoning
(boolean stream) set stream reasoningvoid
setCompressEDB
(boolean b) Should edb be compressed?void
setDebugging
(boolean debug) set the debugging switchvoid
setDirectEncoding
(boolean directEncoding) Sets the direct encoding flag.void
sets the directory for the extensional databasevoid
defines where the extensional database (edb) is storedvoid
setImportDir
(String importDir) sets the directory for the importsvoid
setIndexedProperties
(String[] properties) set the edb properties to be indexedvoid
sets the json partitioning schemavoid
setLoadingThreads
(int threads) returns the number of threads used for loading (max)void
setLoggingDir
(String dir) set the directory for logsvoid
setMaxTermLength
(int maxTermLength) sets the max unique identifying prefix of a termvoid
sets the tuple partitioning schemavoid
setQueryDir
(String dir) set the directory for the queriesvoid
setRetracts
(boolean b) set whether facts are retractable during stream reasoningvoid
setSetProperties
(String[] props) set JSON properties which are represented as closed setsvoid
setShinglesIndex
(boolean b) set fast Levenshtein index (switch lucene index off)boolean
setSkipAnswers
(boolean b) sets whether answers are skippedvoid
setSwapping
(boolean swap) set swapping of intermediate reasoning resultsvoid
setSymbolTableGeoIndex
(Boolean value) defines whether a geo index is createdvoid
setSymbolTableInMainMemory
(boolean symbolTableInMainMemory) sets the location of symbol table (in main memory or persistent)void
setSymbolTableParts
(int parts) set into how many pieces the symbol table is splitvoid
setSymbolTableTextIndex
(Boolean value) defines whether a text index is created.void
setTempDir
(String tempDir) sets the directory for temporary filesvoid
setThreads
(int threads) sets the max number of threads for reasoningvoid
setTopDownReasoning
(boolean topDownReasoning) sets the top-down reasoning flagvoid
setTransactionLog
(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:
true
if the text index for symbols is turned on,false
otherwise
-
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:
true
if the geo index for symbols is turned on,false
otherwise
-
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:
-