Package com.semedy.reasoner.api.core
Class Core
java.lang.Object
com.semedy.reasoner.api.core.Core
- All Implemented Interfaces:
Closeable
,AutoCloseable
A core stores all relevant data for the inference engine
the extensional database (edb), intensional database (idb),
symbol table, built-ins, rewriters, configuration, transactions,
external datatypes, query materialization, query management
the extensional database (edb), intensional database (idb),
symbol table, built-ins, rewriters, configuration, transactions,
external datatypes, query materialization, query management
- Author:
- angele
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
close()
Finalizes all components.createReasoner
(InterruptFlag interruptflag, boolean skipsendinganswers, int pulsedTuples) creates a new resonercreateReasoner
(InterruptFlag interruptflag, boolean skipsendinganswers, int pulsedTuples, Properties builtinConfig) creates a new resonervoid
delete()
deletes all resources (files)void
flush()
returns the container for built-insreturns the configuration switchesreturns the extensional database (store for facts)returns the provider for external data types.returns the intensional database (store for rules)getLock()
get the lock for handling transactionsget partitioning literalsreturns the container for rewritersreturns the symbol table ,Get the system monitor.returns the version number of the reasonerboolean
Is shut down finished?boolean
Is a shut down currently in progress?void
reOpen()
reopen a corevoid
setSymbolTable
(SymbolTable symbols) set the symbol tablevoid
shutdown()
Shutdown this deductive database instance (and closes the core).void
slowLoadMixed
(InputStream input) Loads from an input stream facts and rules in usual predicate syntax.void
slowLoadMixedFiles
(List<String> files) Loads files for facts and rules in usual predicate syntax.boolean
Tries to shutdown this deductive database instance (and closes the core).
-
Constructor Details
-
Core
-
Core
-
-
Method Details
-
getPartitioningLiterals
get partitioning literals- Returns:
- Throws:
IOException
SemReasonerException
-
reOpen
reopen a core -
getSystemMonitor
Get the system monitor.
System monitor collects statistics and is used
to optimize the system using these statistics -
getLock
get the lock for handling transactions- Returns:
- the lock for read write operations
-
isShutDownInProgress
public boolean isShutDownInProgress()Is a shut down currently in progress?- Returns:
-
isShutDownFinished
public boolean isShutDownFinished()Is shut down finished?- Returns:
-
close
Finalizes all components. Must be called at the end- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
flush
- Throws:
IOException
-
getIntensionalDB
returns the intensional database (store for rules)- Returns:
- the intensional database (store for rules)
-
getExtensionalDB
returns the extensional database (store for facts)- Returns:
- the extensional database (store for facts)
-
getRewriterProvider
returns the container for rewriters- Returns:
- provider for rewriters
-
getBuiltinProvider
returns the container for built-ins- Returns:
- the provider for built-ins
-
getExternalDataTypeProvider
returns the provider for external data types.- Returns:
- the provider for external data types
-
getConfiguration
returns the configuration switches- Returns:
- the system configuration
-
delete
deletes all resources (files)- Throws:
IOException
SemReasonerException
-
createReasoner
public Reasoner createReasoner(InterruptFlag interruptflag, boolean skipsendinganswers, int pulsedTuples) creates a new resoner- Parameters:
interruptflag
- , flag for interruptsskipsendinganswers
- , answers are not producedpulsedTuples
- , number of pulsed tuples, -1 if not pulsed- Returns:
- a reasoner
-
createReasoner
public Reasoner createReasoner(InterruptFlag interruptflag, boolean skipsendinganswers, int pulsedTuples, Properties builtinConfig) creates a new resoner- Parameters:
interruptflag
- , flag for interruptsskipsendinganswers
- , answers are not producedpulsedTuples
- , number of pulsed tuples, -1 if not pulsedbuiltinConfig
- , configuration of built-in like access tokens etc.- Returns:
- a reasoner
-
getSymbolTable
returns the symbol table ,- Returns:
- the symboltable
-
setSymbolTable
set the symbol table -
slowLoadMixedFiles
public void slowLoadMixedFiles(List<String> files) throws IOException, SimpleParseException, SemReasonerException, EDBException Loads files for facts and rules in usual predicate syntax.
This is slow and not adequate for large facts sets- Parameters:
files
- , input files- Throws:
IOException
SimpleParseException
SemReasonerException
EDBException
-
slowLoadMixed
public void slowLoadMixed(InputStream input) throws IOException, SimpleParseException, SemReasonerException, EDBException Loads from an input stream facts and rules in usual predicate syntax.
This is slow and not adequate for large facts sets- Parameters:
input
- , input stream- Throws:
IOException
SimpleParseException
SemReasonerException
EDBException
-
getVersion
returns the version number of the reasoner- Returns:
-
tryShutdown
Tries to shutdown this deductive database instance (and closes the core).- Returns:
- true if shutdown is successful
- Throws:
SemReasonerException
- if an error occursInterruptedException
-
shutdown
Shutdown this deductive database instance (and closes the core).- Throws:
SemReasonerException
- if an error occursInterruptedException
-
checkSanity
- Throws:
IOException
SemReasonerException
-