Class ComponentBuilder
java.lang.Object
fr.inria.rules.integraal.component_builder.ComponentBuilder
- All Implemented Interfaces:
IComponentBuilder
A component builder is able to return an InteGraal object performing a main
task, such as chasing, rewriting, evaluating queries, compiling rules.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentBuilder(IInputDataScenario inputScenario, IAlgorithmParameters algorithmParameters) Constructs a component builder from the specified input scenario and algorithm parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns chase algorithm based on the provided configuration.Builds or retrieves the counting query-answering component.Builds or gets the query answering algorithm component.Builds or gets the query rewriter component.voidclose()Closes any database connections opened by this component builder.Returns the factbase object used by the builder.Returns the query set object used by the builder.Returns a new rulebase containing all rules used by the builder.Returns the rule compilation result used by the builder.voidinit()Initializes all components of the builder.(if required) compiles the rulesLoads the data into the factbase.sets the query basesets the rule base
-
Constructor Details
-
ComponentBuilder
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
Returns the factbase object used by the builder.- Specified by:
getFactbasein interfaceIComponentBuilder- Returns:
- the fact base created by the component.
-
getRulebase
Returns a new rulebase containing all rules used by the builder.- Specified by:
getRulebasein interfaceIComponentBuilder- Returns:
- the rule base created by the component.
-
getQueries
Returns the query set object used by the builder.- Specified by:
getQueriesin interfaceIComponentBuilder- Returns:
- the collection of queries handled by the component.
-
getRuleCompilationResult
Returns the rule compilation result used by the builder.- Specified by:
getRuleCompilationResultin interfaceIComponentBuilder- Returns:
- the result of the rule compilation.
-
buildOrGetChase
Returns chase algorithm based on the provided configuration.- Specified by:
buildOrGetChasein interfaceIComponentBuilder- Returns:
- the prepared instance of the Chase algorithm.
-
buildOrGetRewriter
Description copied from interface:IComponentBuilderBuilds or gets the query rewriter component.- Specified by:
buildOrGetRewriterin interfaceIComponentBuilder- Returns:
- a rewriting algorithm based on the current configuration
-
buildOrGetQueryAnsweringAlgorithm
Description copied from interface:IComponentBuilderBuilds or gets the query answering algorithm component.- Specified by:
buildOrGetQueryAnsweringAlgorithmin interfaceIComponentBuilder- Returns:
- a query evaluator based on the current configuration
-
buildOrGetCountingQueryAnsweringAlgorithm
Builds or retrieves the counting query-answering component.- Returns:
- a query evaluator based on the current configuration
-
trySetFactBase
Loads the data into the factbase.- Returns:
- metadata describing the operation result
-
init
public void init()Description copied from interface:IComponentBuilderInitializes all components of the builder.- Specified by:
initin interfaceIComponentBuilder
-
trySetRuleBase
sets the rule base- Returns:
- the result of the rule-base loading operation
-
trySetQueryBase
sets the query base- Returns:
- the result of the query-base loading operation
-
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.
-