Interface IComponentBuilder
- All Known Implementing Classes:
ComponentBuilder
public interface IComponentBuilder
Interface for building various InteGraal components related to query
answering, rule-based reasoning, query rewriting, and rule compilation.
Provides methods to construct these components from input fact bases, rule
bases, and queries.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChasebuildAndGetChase(FactBase fb, RuleBase rb, InteGraalKeywords.Algorithms.Parameters.Chase.Checker chaseType, ExternalHaltingCondition... conds) Creates a Chase-based reasoning component.static ChasebuildAndGetChase(FactBase fb, RuleBase rb, InteGraalKeywords.Algorithms.Parameters.Chase.Checker chaseType, IGParameter<InteGraalKeywords, ?> params) Creates a Chase-based reasoning component.static ChasebuildAndGetChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Creates a Chase-based reasoning component.buildAndGetOMQRewriter(RuleBase rb, Collection<Query> queries, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Creates a query rewriter for Ontology-Mediated Query (OMQ) Rewriting.buildAndGetOMQRewriter(RuleBase rb, Collection<Query> queries, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, IGParameter<InteGraalKeywords, ?>... params) Creates a query rewriter for Ontology-Mediated Query (OMQ) Rewriting.buildAndGetOMQRewriter(RuleBase rb, Collection<Query> queries, IGParameter<InteGraalKeywords, ?>... params) Creates a query rewriter for Ontology-Mediated Query (OMQ) Rewriting.buildAndGetQueryEvaluator(FactBase fb, Query query, ExternalHaltingCondition... conds) Creates a query evaluator for answering a single query on a fact base.buildAndGetQueryEvaluator(FactBase fb, Query query, IGParameter<InteGraalKeywords, ?>... params) Creates a query evaluator for answering a single query on a fact base.buildAndGetQueryEvaluator(FactBase fb, Set<Query> queries, ExternalHaltingCondition... conds) Creates a query evaluator for answering a set of queries on a fact base.buildAndGetQueryEvaluator(FactBase fb, Set<Query> queries, IGParameter<InteGraalKeywords, ?>... params) Creates a query evaluator for answering a set of queries on a fact base.static RuleCompilationResultbuildAndGetRuleCompilation(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Creates a component builder for rule compilation.static RuleCompilationResultbuildAndGetRuleCompilation(RuleBase ruleBase, IGParameter<InteGraalKeywords, ?>... params) Creates a component builder for rule compilation.Builds or gets the Chase algorithm component.Builds or gets the query answering algorithm component.Builds or gets the query rewriter component.static ComponentBuildercreateBuilderFrom(IInputDataScenario inputKB, IAlgorithmParameters algoParam) Creates a default component builder.static ComponentBuildercreateBuilderFrom(IInputDataScenario inputKB, IAlgorithmParameters algoParam, boolean init) Creates a default component builder.Gets the fact base created by the component.Gets the queries handled by the component.Gets the rule base created by the component.Gets the result of the rule compilation process.voidinit()Initializes all components of the builder.
-
Method Details
-
buildAndGetQueryEvaluator
static QueryEvaluatorWithMultiEvaluator buildAndGetQueryEvaluator(FactBase fb, Query query, IGParameter<InteGraalKeywords, ?>... params) Creates a query evaluator for answering a single query on a fact base.- Parameters:
fb- the fact base to be used for query answering.query- a single query to be evaluated.params- the parameters for storage and halting conditions- Returns:
- an instance of
QueryEvaluatorWithMultiEvaluatorconfigured for query answering.
-
buildAndGetQueryEvaluator
static QueryEvaluatorWithMultiEvaluator buildAndGetQueryEvaluator(FactBase fb, Set<Query> queries, IGParameter<InteGraalKeywords, ?>... params) Creates a query evaluator for answering a set of queries on a fact base.- Parameters:
fb- the fact base to be used for query answering.queries- a set of queries to be evaluated.params- the parameters for storage and halting conditions- Returns:
- an instance of
QueryEvaluatorWithMultiEvaluatorconfigured for query answering.
-
buildAndGetChase
static Chase buildAndGetChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Creates a Chase-based reasoning component.- Parameters:
fb- the fact base for the chase.rb- the rule base for the chase.params- the parameters for storage and halting conditions- Returns:
- an instance of
Chaseconfigured for reasoning, ornullif an error occurs.
-
buildAndGetOMQRewriter
static QueryRewriterWitMultiEvaluator buildAndGetOMQRewriter(RuleBase rb, Collection<Query> queries, IGParameter<InteGraalKeywords, ?>... params) Creates a query rewriter for Ontology-Mediated Query (OMQ) Rewriting.- Parameters:
rb- the rule base for rewriting.queries- a collection of queries to be rewritten.params- the parameters for storage and halting conditions- Returns:
- an instance of
QueryRewriterWitMultiEvaluatorconfigured for query rewriting, ornullin case of an error.
-
buildAndGetRuleCompilation
static RuleCompilationResult buildAndGetRuleCompilation(RuleBase ruleBase, IGParameter<InteGraalKeywords, ?>... params) Creates a component builder for rule compilation.- Parameters:
ruleBase- the rule base for rewriting.params- the parameters for storage and halting conditions- Returns:
- an instance of
RuleCompilationResultconfigured for rule compilation, ornullin case of an error.
-
buildAndGetQueryEvaluator
static QueryEvaluatorWithMultiEvaluator buildAndGetQueryEvaluator(FactBase fb, Query query, ExternalHaltingCondition... conds) Creates a query evaluator for answering a single query on a fact base.- Parameters:
fb- the fact base to be used for query answering.query- a single query to be evaluated.conds- he external halting conditions (e.g., timeout, rank).- Returns:
- an instance of
QueryEvaluatorWithMultiEvaluatorconfigured for query answering.
-
buildAndGetQueryEvaluator
static QueryEvaluatorWithMultiEvaluator buildAndGetQueryEvaluator(FactBase fb, Set<Query> queries, ExternalHaltingCondition... conds) Creates a query evaluator for answering a set of queries on a fact base.- Parameters:
fb- the fact base to be used for query answering.queries- a set of queries to be evaluated.conds- he external halting conditions (e.g., timeout, rank).- Returns:
- an instance of
QueryEvaluatorWithMultiEvaluatorconfigured for query answering.
-
buildAndGetChase
static Chase buildAndGetChase(FactBase fb, RuleBase rb, InteGraalKeywords.Algorithms.Parameters.Chase.Checker chaseType, ExternalHaltingCondition... conds) Creates a Chase-based reasoning component.- Parameters:
fb- the fact base for the chase.rb- the rule base for the chase.chaseType- the type of chase algorithm (optional).conds- he external halting conditions (e.g., timeout, rank).- Returns:
- an instance of
Chaseconfigured for reasoning, ornullif an error occurs.
-
buildAndGetChase
static Chase buildAndGetChase(FactBase fb, RuleBase rb, InteGraalKeywords.Algorithms.Parameters.Chase.Checker chaseType, IGParameter<InteGraalKeywords, ?> params) Creates a Chase-based reasoning component.- Parameters:
fb- the fact base for the chase.rb- the rule base for the chase.chaseType- the type of chase algorithm (optional).params- he external halting conditions (e.g., timeout, rank).- Returns:
- an instance of
Chaseconfigured for reasoning, ornullif an error occurs.
-
buildAndGetOMQRewriter
static QueryRewriterWitMultiEvaluator buildAndGetOMQRewriter(RuleBase rb, Collection<Query> queries, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Creates a query rewriter for Ontology-Mediated Query (OMQ) Rewriting.- Parameters:
rb- the rule base for rewriting.queries- a collection of queries to be rewritten.ruleCompilation- the rule compilation method (optional, null means no compilation).conds- he external halting conditions (e.g., timeout, rank).- Returns:
- an instance of
QueryRewriterWitMultiEvaluatorconfigured for query rewriting, ornullin case of an error.
-
buildAndGetOMQRewriter
static QueryRewriterWitMultiEvaluator buildAndGetOMQRewriter(RuleBase rb, Collection<Query> queries, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, IGParameter<InteGraalKeywords, ?>... params) Creates a query rewriter for Ontology-Mediated Query (OMQ) Rewriting.- Parameters:
rb- the rule base for rewriting.queries- a collection of queries to be rewritten.ruleCompilation- the rule compilation method (optional, null means no compilation).params- the external halting conditions (e.g., timeout, rank) and the compilation type- Returns:
- an instance of
QueryRewriterWitMultiEvaluatorconfigured for query rewriting, ornullin case of an error.
-
buildAndGetRuleCompilation
static RuleCompilationResult buildAndGetRuleCompilation(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Creates a component builder for rule compilation.- Parameters:
ruleBase- the rule base for rewriting.ruleCompilation- the rule compilation method.conds- he external halting conditions (e.g., timeout, rank).- Returns:
- an instance of
RuleCompilationResultconfigured for rule compilation, ornullin case of an error.
-
createBuilderFrom
static ComponentBuilder createBuilderFrom(IInputDataScenario inputKB, IAlgorithmParameters algoParam, boolean init) Creates a default component builder.- Parameters:
inputKB- the input data scenario for the builder.algoParam- the algorithm parameters.init- whether to initialize the builder immediately. prefer setting it to false if the factbase is large, and then call method init()- Returns:
- a
ComponentBuilderconfigured based on the provided inputs.
-
createBuilderFrom
static ComponentBuilder createBuilderFrom(IInputDataScenario inputKB, IAlgorithmParameters algoParam) Creates a default component builder. By default, it initializes all components by setting init=true.- Parameters:
inputKB- the input data scenario for the builder.algoParam- the algorithm parameters.- Returns:
- a
ComponentBuilderconfigured based on the provided inputs.
-
getFactbase
FactBase getFactbase()Gets the fact base created by the component.- Returns:
- the fact base created by the component.
-
getRulebase
RuleBase getRulebase()Gets the rule base created by the component.- Returns:
- the rule base created by the component.
-
getQueries
Collection<Query> getQueries()Gets the queries handled by the component.- Returns:
- the collection of queries handled by the component.
-
getRuleCompilationResult
RuleCompilationResult getRuleCompilationResult()Gets the result of the rule compilation process.- Returns:
- the result of the rule compilation.
-
buildOrGetChase
-
buildOrGetRewriter
QueryRewriterWitMultiEvaluator buildOrGetRewriter()Builds or gets the query rewriter component.- Returns:
- the
QueryRewriterWitMultiEvaluatorcomponent.
-
buildOrGetQueryAnsweringAlgorithm
QueryEvaluatorWithMultiEvaluator buildOrGetQueryAnsweringAlgorithm()Builds or gets the query answering algorithm component.- Returns:
- the
QueryEvaluatorWithMultiEvaluatorcomponent.
-
init
void init()Initializes all components of the builder.
-