engine.rete_factory =================== .. py:module:: engine.rete_factory .. autoapi-nested-parse:: Factory for constructing per-context RETE engine instances. Classes ------- .. autoapisummary:: engine.rete_factory.RETEEngineFactoryConfig engine.rete_factory.RETEEngineFactory Module Contents --------------- .. py:class:: RETEEngineFactoryConfig Explicit per-context RETE engine assembly configuration. This configuration is supplied to :class:`RETEEngineFactory` and specifies the template for new engines. It is used to create a new engine for each context. :param rules: The common ruleset applied to all engines. :param contradiction_recorder_factory: The factory to use to create a new contradiction recorder for each context. Recorders are shared iff the same instance is always returned by this factory. :param derivation_logger_factory: The factory to use to create a new derivation logger for each context. Loggers are shared iff the same instance is always returned by this factory. :param builtins: The builtins (predicates / callbacks) to use for new engines. These are shared across all engines and are generally assumed to be stateless. :param literal_subject_policy: The literal subject policy to use for the engine. :param predicate_term_policy: The predicate term policy to use for the engine. .. py:attribute:: rules :type: collections.abc.Sequence[engine.rules.Rule] .. py:attribute:: contradiction_recorder_factory :type: collections.abc.Callable[[rdflib_reasoning.axiom.common.ContextIdentifier], engine.derivation.ContradictionRecorder] .. py:attribute:: derivation_logger_factory :type: collections.abc.Callable[[rdflib_reasoning.axiom.common.ContextIdentifier], engine.derivation.DerivationLogger] .. py:attribute:: builtins :type: engine.builtins.Builtins .. py:attribute:: literal_subject_policy :type: engine.rete_engine.LiteralSubjectPolicy .. py:attribute:: predicate_term_policy :type: engine.rete_engine.PredicateTermPolicy .. py:class:: RETEEngineFactory(*, config: RETEEngineFactoryConfig) Factory for per-context RETE engine instances. This factory is used by :class:`RETEStore` to lazily create new RETE engines for each context (read: graph) whenever they are needed. :param config: The configuration for the factory. This configuration will be reused for each new engine. .. py:attribute:: config :type: RETEEngineFactoryConfig .. py:property:: rules_template :type: collections.abc.Sequence[engine.rules.Rule] Return the shared rules applied to every engine created by this factory. .. py:method:: new_engine(context: rdflib_reasoning.axiom.common.ContextIdentifier) -> engine.rete_engine.RETEEngine Create a fresh RETE engine bound to ``context``.