Class Configuration

java.lang.Object
com.semedy.reasoner.api.core.Configuration

public class Configuration extends Object
Provides configurations for the reasoning kernel
Author:
angele
  • Field Details

    • CONFIG_UNIT_TESTS_DIRECTORY

      public static String CONFIG_UNIT_TESTS_DIRECTORY
      Option to overwrite default unit tests directory.
    • _edbDir

      public String _edbDir
      extensional database settings
    • _tempDir

      public String _tempDir
    • _logDir

      public String _logDir
    • _backupDir

      public String _backupDir
    • _importDir

      public String _importDir
    • _EDBStorageType

      public Configuration.StorageType _EDBStorageType
    • _transactionLog

      public Boolean _transactionLog
    • MAXTERMSPERGIG

      public int MAXTERMSPERGIG
    • _backupSchedule

      public String _backupSchedule
    • _compressEDB

      public Boolean _compressEDB
    • _partitioning

      public String _partitioning
    • _jsonPartitioning

      public String _jsonPartitioning
    • _indexedProperties

      public String[] _indexedProperties
    • _loadingThreads

      public Integer _loadingThreads
    • _setProperties

      public String[] _setProperties
    • _symbolTableInMainMemory

      public Boolean _symbolTableInMainMemory
      symbol table settings
    • _directEncoding

      public Boolean _directEncoding
    • _maxTermLength

      public Integer _maxTermLength
    • _symbolTableTextIndex

      public Boolean _symbolTableTextIndex
    • _symbolTableTextIndexSettings

      public Map<String,String> _symbolTableTextIndexSettings
    • _symbolTableGeoIndex

      public Boolean _symbolTableGeoIndex
    • _symbolTableGeoIndexSettings

      public Map<String,String> _symbolTableGeoIndexSettings
    • _recreateSymbolTableSearchIndexesOnStartup

      public Boolean _recreateSymbolTableSearchIndexesOnStartup
    • _isShingles

      public Boolean _isShingles
    • _symbolTableParts

      public Integer _symbolTableParts
    • _topDownReasoning

      public Boolean _topDownReasoning
      reasoning settings
    • _bodyOrdering

      public Boolean _bodyOrdering
    • _reasoningThreads

      public Integer _reasoningThreads
    • _retracts

      public Boolean _retracts
    • _swapping

      public Boolean _swapping
    • _debugging

      public Boolean _debugging
    • _streamReasoning

      public Boolean _streamReasoning
    • _consumerProducer

      public Boolean _consumerProducer
    • _measureTimes

      public Boolean _measureTimes
    • _skipAnswers

      public Boolean _skipAnswers
    • _unitTestsDir

      public String _unitTestsDir
      directories
    • _benchmarkDir

      public String _benchmarkDir
    • _queryDir

      public String _queryDir
    • _eliminateDuplicates

      public Boolean _eliminateDuplicates
      others
    • _path

      public String _path
    • _builtinProperties

      public Properties _builtinProperties
    • _clusterId

      public String _clusterId
      cluster
    • _proxy

      public String _proxy
  • Constructor Details

    • Configuration

      public Configuration()
    • Configuration

      public Configuration(String path)
  • Method Details

    • merge

      public void merge(Configuration c)
      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

      public Object clone()
      clone configuration
    • getClusterId

      public String getClusterId()
      get the cluster id
      Returns:
    • getIndexedProperties

      public String[] getIndexedProperties()
      get the edb properties to be indexed
      Returns:
    • setIndexedProperties

      public void setIndexedProperties(String[] properties)
      set the edb properties to be indexed
    • getBuiltinProperties

      public Properties 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

      public String getLocalHost() throws UnknownHostException
      local host name
      Returns:
      Throws:
      UnknownHostException
    • load

      public void load() throws IOException
      load the configuration from the standard path
      Throws:
      IOException
    • loadBuiltinProperties

      public void loadBuiltinProperties(String path) throws IOException
      load the properties for built-ins from given path
      Parameters:
      path - , the path where the configuration is taken from
      Throws:
      IOException
    • loadBuiltinProperties

      public void loadBuiltinProperties(InputStream in) throws IOException
      load the properties for built-ins from given input stream
      Parameters:
      in - , input stream
      Throws:
      IOException
    • load

      public void load(String path) throws IOException
      load the configuration from the given path
      Parameters:
      path - , the path where the configuration is taken from
      Throws:
      IOException
    • load

      public void load(InputStream in) throws IOException
      load the configuration from the given path
      Parameters:
      in - , input stream
      Throws:
      IOException
    • load

      public void load(Properties properties) throws IOException
      load the configuration from a given properties object
      Parameters:
      properties - , given properties object
      Throws:
      IOException
    • getProxy

      public String 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

      public Map<String,String> 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

      public Map<String,String> 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

      public String 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

      public Configuration.StorageType getEDBStorageType()
      returns where extensional database (edb) is stored
      in main memory, persistent on disc or mixed
      Returns:
      storage type
    • setEDBStorageType

      public void setEDBStorageType(Configuration.StorageType type)
      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

      public String getEDBDir()
      returns the directory for the extensional database
      Returns:
      the directory for the extensional database
    • getLoggingDir

      public String getLoggingDir()
      returns the directory for logging information
      Returns:
      the directory for the log directory
    • getBackupDir

      public String getBackupDir()
      returns the directory for bakcups
      Returns:
      the directory for the backup directory
    • getPartitioning

      public String getPartitioning()
      returns the tuple partitioning schema
      Returns:
      the partitioning schema
    • setPartitioning

      public void setPartitioning(String p)
      sets the tuple partitioning schema
    • getJSONPartitioning

      public String getJSONPartitioning()
      returns the json partitioning schema
      Returns:
      the partitioning schema
    • setJSONPartitioning

      public void setJSONPartitioning(String p)
      sets the json partitioning schema
    • getImportDir

      public String getImportDir()
      returns the directory for imports
      Returns:
      the directory for the import
    • getQueryDir

      public String getQueryDir()
      returns the directory for queries
      Returns:
      the directory for the queries
    • setLoggingDir

      public void setLoggingDir(String dir)
      set the directory for logs
    • seBackupDir

      public void seBackupDir(String dir)
      set the directory for backups
    • setQueryDir

      public void setQueryDir(String dir)
      set the directory for the queries
    • getUnitTestsDir

      public String getUnitTestsDir()
      returns the directory for the unit tests
      Returns:
      the unit tests directory
    • getBenchmarkDir

      public String getBenchmarkDir()
      returns the benchmark directory
      Returns:
      the path of the benchmark directory
    • setEDBDir

      public void setEDBDir(String edbDir)
      sets the directory for the extensional database
      Parameters:
      edbDir - the directory for the extensional database
    • setImportDir

      public void setImportDir(String importDir)
      sets the directory for the imports
      Parameters:
      importDir - the directory for the imports
    • setBenchmarkDir

      public void setBenchmarkDir(String benchmarkDir)
      sets the benchmark directory
      Parameters:
      benchmarkDir -
    • getTempDir

      public String getTempDir()
      returns the directory for temporary files
      Returns:
      the path of the temporary directory
    • setTempDir

      public void setTempDir(String tempDir)
      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

      public String[] getSetProperties()
      get all JSON properties which are represented as closed sets
      Returns:
    • setSetProperties

      public void setSetProperties(String[] props)
      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

      public void setSymbolTableTextIndex(Boolean value)
      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

      public void setSymbolTableGeoIndex(Boolean value)
      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: