Class ComponentBuilder

java.lang.Object
fr.inria.rules.integraal.component_builder.ComponentBuilder
All Implemented Interfaces:
IComponentBuilder

public class ComponentBuilder extends Object implements IComponentBuilder
A component builder is able to return an InteGraal object performing a main task, such as chasing, rewriting, evaluating queries, compiling rules.
  • Constructor Details

    • ComponentBuilder

      public ComponentBuilder(IInputDataScenario inputScenario, IAlgorithmParameters algorithmParameters)
      Constructs a component builder from the specified input scenario and algorithm parameters.
      Parameters:
      inputScenario - the knowledge base scenario, not null.
      algorithmParameters - the algorithm parameters for the InteGraal component, not null. base files specified by the by the kbscenario.
  • Method Details

    • getFactbase

      public FactBase getFactbase()
      Returns the factbase object used by the builder.
      Specified by:
      getFactbase in interface IComponentBuilder
      Returns:
      the fact base created by the component.
    • getRulebase

      public RuleBase getRulebase()
      Returns a new rulebase containing all rules used by the builder.
      Specified by:
      getRulebase in interface IComponentBuilder
      Returns:
      the rule base created by the component.
    • getQueries

      public Collection<Query> getQueries()
      Returns the query set object used by the builder.
      Specified by:
      getQueries in interface IComponentBuilder
      Returns:
      the collection of queries handled by the component.
    • getRuleCompilationResult

      public RuleCompilationResult getRuleCompilationResult()
      Returns the rule compilation result used by the builder.
      Specified by:
      getRuleCompilationResult in interface IComponentBuilder
      Returns:
      the result of the rule compilation.
    • buildOrGetChase

      public Chase buildOrGetChase()
      Returns chase algorithm based on the provided configuration.
      Specified by:
      buildOrGetChase in interface IComponentBuilder
      Returns:
      the prepared instance of the Chase algorithm.
    • buildOrGetRewriter

      public QueryRewriterWitMultiEvaluator buildOrGetRewriter()
      Description copied from interface: IComponentBuilder
      Builds or gets the query rewriter component.
      Specified by:
      buildOrGetRewriter in interface IComponentBuilder
      Returns:
      a rewriting algorithm based on the current configuration
    • buildOrGetQueryAnsweringAlgorithm

      public QueryEvaluatorWithMultiEvaluator buildOrGetQueryAnsweringAlgorithm()
      Description copied from interface: IComponentBuilder
      Builds or gets the query answering algorithm component.
      Specified by:
      buildOrGetQueryAnsweringAlgorithm in interface IComponentBuilder
      Returns:
      a query evaluator based on the current configuration
    • buildOrGetCountingQueryAnsweringAlgorithm

      public CountingQueryEvaluatorWithMultiEvaluator buildOrGetCountingQueryAnsweringAlgorithm()
      Builds or retrieves the counting query-answering component.
      Returns:
      a query evaluator based on the current configuration
    • trySetFactBase

      public IOperationResult trySetFactBase()
      Loads the data into the factbase.
      Returns:
      metadata describing the operation result
    • init

      public void init()
      Description copied from interface: IComponentBuilder
      Initializes all components of the builder.
      Specified by:
      init in interface IComponentBuilder
    • trySetRuleBase

      public IOperationResult trySetRuleBase()
      sets the rule base
      Returns:
      the result of the rule-base loading operation
    • trySetQueryBase

      public IOperationResult trySetQueryBase()
      sets the query base
      Returns:
      the result of the query-base loading operation
    • tryCompileRuleset

      public IOperationResult tryCompileRuleset()
      (if required) compiles the rules
      Returns:
      the result of the compilation attempt
    • close

      public void close()
      Closes any database connections opened by this component builder.