Package com.semedy.reasoner.api.core
Class StreamReasoningDB
java.lang.Object
com.semedy.reasoner.api.core.DeductiveDatabase
com.semedy.reasoner.api.core.StreamReasoningDB
- Direct Known Subclasses:
QueryRegister
This extension of the deductive database enables
stream reasoning.
While usually a query is sent to the deductive database and
result are get back, stream reasoning turns this around.
For stream reasoning queries are registered and facts which are
added may trigger these queries and thus produce results. DDB is thread local, so every thread has its own instance of DDB.
Core which is a member of DDB is shared for different DDBs.
stream reasoning.
While usually a query is sent to the deductive database and
result are get back, stream reasoning turns this around.
For stream reasoning queries are registered and facts which are
added may trigger these queries and thus produce results. DDB is thread local, so every thread has its own instance of DDB.
Core which is a member of DDB is shared for different DDBs.
- Author:
- angele
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
materializeQueries
(InterruptFlag interruptFlag, String squeries, ReasoningMonitor monitor) Materialize queries.void
materializeQueries
(InterruptFlag interruptFlag, String squeries, ReasoningMonitor monitor, Configuration config, Properties builtinConfig) Materialize queries.void
materializeQueries
(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor) Materialize queries.void
materializeQueries
(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor, Configuration config, Properties builtinConfig) Materialize queries.void
registerQueries
(InterruptFlag interruptFlag, String queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver) Register a set of queries for stream reasoning.void
registerQueries
(InterruptFlag interruptFlag, String queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver, Properties builtinConfig) Register a set of queries for stream reasoning.void
registerQueries
(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver) Register a set of queries for stream reasoning.void
registerQueries
(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver, Properties builtinConfig) Register a set of queries for stream reasoning.Methods inherited from class com.semedy.reasoner.api.core.DeductiveDatabase
addFact, addFacts, addRule, addRule, addRules, addRulesAndFacts, applyChangeSet, backup, export, exportNQuads, exportNQuads, exportOOLogic, exportOOLogic, exportOOLogic, exportOOLogic, exportRules, exportRules, getCore, getRuleById, getRules, getSnapshotEDB, getSymbolTable, load, load, loadByStream, loadPredicates, longTransactionBegin, longTransactionCommit, longTransactionRollback, query, query, query, query, query, query, query, query, query, removeFact, removeFactEncoded, removeFacts, removeFactsEncoded, removeRuleById, removeRules, removeRulesAndFacts, transactionBegin, transactionCommit, transactionRollback
-
Constructor Details
-
StreamReasoningDB
create a new stream reasoning database- Parameters:
core
-- Throws:
SemReasonerException
IOException
-
-
Method Details
-
registerQueries
public void registerQueries(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver) throws SemReasonerException, InterruptedException, IOException Register a set of queries for stream reasoning.
Each time a sensor built-in delivers new results or facts are added to edb
new results may be produced. For every new result the receiver methods
in EventReceiver are called.- Parameters:
interruptFlag
- , interrupt queryqueries
- , the queriesmonitor
- , monitor for reasoning (may be null)receiver
- , for each query a receiver- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
registerQueries
public void registerQueries(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver, Properties builtinConfig) throws SemReasonerException, InterruptedException, IOException Register a set of queries for stream reasoning.
Each time a sensor built-in delivers new results or facts are added to edb
new results may be produced. For every new result the receiver methods
in EventReceiver are called.- Parameters:
interruptFlag
- , interrupt queryqueries
- , the queriesmonitor
- , monitor for reasoning (may be null)receiver
- , for each query a receiverbuiltinConfig
- , built-in configuration like access token- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
registerQueries
public void registerQueries(InterruptFlag interruptFlag, String queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver) throws SemReasonerException, InterruptedException, IOException Register a set of queries for stream reasoning.
Each time a sensor built-in delivers new results or facts are added to edb
new results may be produced. For every new result the receiver method
in EventReceiver is called.- Parameters:
interruptFlag
- , interrupt queryqueries
- , the queriesmonitor
- , monitor for reasoning (may be null)receiver
- , for each query a receiver- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
registerQueries
public void registerQueries(InterruptFlag interruptFlag, String queries, ReasoningMonitor monitor, List<EventResultReceiver> receiver, Properties builtinConfig) throws SemReasonerException, InterruptedException, IOException Register a set of queries for stream reasoning.
Each time a sensor built-in delivers new results or facts are added to edb
new results may be produced. For every new result the receiver method
in EventReceiver is called.- Parameters:
interruptFlag
- , interrupt queryqueries
- , the queriesmonitor
- , monitor for reasoning (may be null)receiver
- , for each query a receiverbuiltinConfig
- , built-in configuration like access token- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
materializeQueries
public void materializeQueries(InterruptFlag interruptFlag, String squeries, ReasoningMonitor monitor) throws InterruptedException, IOException, SemReasonerException Materialize queries.
This means that the queries are evaluated and the results are stored in the database.
Materialization is incremental, which means that every fact which is added is
immediately materialized.- Overrides:
materializeQueries
in classDeductiveDatabase
- Parameters:
interruptFlag
-squeries
- , the queries to be materializedmonitor
- , reasoning monitor- Throws:
ReasoningException
InterruptedException
ReasoningException
IOException
SemReasonerException
-
materializeQueries
public void materializeQueries(InterruptFlag interruptFlag, String squeries, ReasoningMonitor monitor, Configuration config, Properties builtinConfig) throws SemReasonerException, InterruptedException, IOException Materialize queries.
This means that the queries are evaluated and the results are stored in the database.
Materialization is incremental, which means that every fact which is added is
immediately materialized.- Overrides:
materializeQueries
in classDeductiveDatabase
- Parameters:
interruptFlag
-squeries
- , the queries to be materializedmonitor
- , reasoning monitorconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Throws:
ReasoningException
InterruptedException
ReasoningException
SemReasonerException
IOException
-
materializeQueries
public void materializeQueries(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor) throws SemReasonerException, InterruptedException, IOException Materialize queries.
This means that the queries are evaluated and the results are stored in the database.
Materialization is incremental, which means that every fact which is added is
immediately materialized.- Overrides:
materializeQueries
in classDeductiveDatabase
- Parameters:
interruptFlag
-queries
- , the queries to be materializedmonitor
- , reasoning monitor- Throws:
ReasoningException
InterruptedException
IOException
ReasoningException
SemReasonerException
-
materializeQueries
public void materializeQueries(InterruptFlag interruptFlag, List<Rule> queries, ReasoningMonitor monitor, Configuration config, Properties builtinConfig) throws SemReasonerException, InterruptedException, IOException Materialize queries.
This means that the queries are evaluated and the results are stored in the database.
Materialization is incremental, which means that every fact which is added is
immediately materialized.- Overrides:
materializeQueries
in classDeductiveDatabase
- Parameters:
interruptFlag
-queries
- , the queries to be materializedmonitor
- , reasoning monitorconfig
- , configurationbuiltinConfig
- , built-in configuration like access token- Throws:
ReasoningException
InterruptedException
IOException
ReasoningException
SemReasonerException
-