org.deri.iris.api
Interface IKnowledgeBase

All Known Implementing Classes:
KnowledgeBase

public interface IKnowledgeBase

The interface of a knowledge-base as seen by a user of IRIS.


Method Summary
 IRelation execute(IQuery query)
          Execute a query over this knowledge-base.
 IRelation execute(IQuery query, List<IVariable> variableBindings)
          Evaluate a query and optionally return the variable bindings.
 List<IRule> getRules()
          Get the rules hidden within the knowledge-base.
 

Method Detail

execute

IRelation execute(IQuery query)
                  throws ProgramNotStratifiedException,
                         RuleUnsafeException,
                         EvaluationException
Execute a query over this knowledge-base.

Parameters:
query - The query to evaluate.
Returns:
The relation of results.
Throws:
ProgramNotStratifiedException - If the program (knowledge-base)can not be stratified
RuleUnsafeException - If the program (knowledge-base) contains an unsafe rule.
EvaluationException - If the execution of a query fails for any other reason.

execute

IRelation execute(IQuery query,
                  List<IVariable> variableBindings)
                  throws ProgramNotStratifiedException,
                         RuleUnsafeException,
                         EvaluationException
Evaluate a query and optionally return the variable bindings.

Parameters:
query - The query to evaluate.
outputVariables - If this is not null, it will be filled with the variable bindings of the result relation, i.e. there will be one variable instance for each term (in one row) of the results set
Returns:
The relation of results.
Throws:
ProgramNotStratifiedException - If the program (knowledge-base)can not be stratified
RuleUnsafeException - If the program (knowledge-base) contains an unsafe rule.
EvaluationException - If the execution of a query fails for any other reason.

getRules

List<IRule> getRules()
Get the rules hidden within the knowledge-base.

Returns:
The unmodifiable list of rules.