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 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 QueryEvaluatorWithMultiEvaluator configured 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 QueryEvaluatorWithMultiEvaluator configured 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 Chase configured for reasoning, or null if 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 QueryRewriterWitMultiEvaluator configured for query rewriting, or null in 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 RuleCompilationResult configured for rule compilation, or null in 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 QueryEvaluatorWithMultiEvaluator configured 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 QueryEvaluatorWithMultiEvaluator configured for query answering.
    • buildAndGetChase

      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 Chase configured for reasoning, or null if an error occurs.
    • buildAndGetChase

      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 Chase configured for reasoning, or null if an error occurs.
    • buildAndGetOMQRewriter

      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 QueryRewriterWitMultiEvaluator configured for query rewriting, or null in 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 QueryRewriterWitMultiEvaluator configured for query rewriting, or null in 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 RuleCompilationResult configured for rule compilation, or null in 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 ComponentBuilder configured 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 ComponentBuilder configured 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

      Chase buildOrGetChase()
      Builds or gets the Chase algorithm component.
      Returns:
      the Chase component.
    • buildOrGetRewriter

      QueryRewriterWitMultiEvaluator buildOrGetRewriter()
      Builds or gets the query rewriter component.
      Returns:
      the QueryRewriterWitMultiEvaluator component.
    • buildOrGetQueryAnsweringAlgorithm

      QueryEvaluatorWithMultiEvaluator buildOrGetQueryAnsweringAlgorithm()
      Builds or gets the query answering algorithm component.
      Returns:
      the QueryEvaluatorWithMultiEvaluator component.
    • init

      void init()
      Initializes all components of the builder.