engine.proof_rendering ====================== .. py:module:: engine.proof_rendering .. autoapi-nested-parse:: Presentation helpers for rendering canonical proof models as text. Classes ------- .. autoapisummary:: engine.proof_rendering.ProofRenderer Functions --------- .. autoapisummary:: engine.proof_rendering.build_rule_lookup engine.proof_rendering.render_proof_markdown engine.proof_rendering.render_proof_mermaid Module Contents --------------- .. py:function:: build_rule_lookup(rules: collections.abc.Iterable[engine.rules.Rule]) -> dict[tuple[str, str], engine.rules.Rule] Map ``(ruleset, rule_id)`` to the :class:`~rdflib_reasoning.engine.rules.Rule`. :raises ValueError: If two rules share the same ``(ruleset, rule_id)`` pair. .. py:class:: ProofRenderer Render canonical proof models as presentation-oriented text. ``rules`` should be the same rule tuple passed to :class:`~rdflib_reasoning.engine.api.RETEEngine` (or :class:`~rdflib_reasoning.engine.api.RETEEngineFactory`) when the proof was produced, so rule steps resolve to IF/THEN patterns. When omitted, :data:`~rdflib_reasoning.engine.rulesets.PRODUCTION_RDFS_RULES` is used. .. py:attribute:: namespace_manager :type: rdflib.namespace.NamespaceManager | None :value: None .. py:attribute:: rules :type: tuple[engine.rules.Rule, Ellipsis] | None :value: None .. py:method:: render_markdown(proof: engine.proof.DirectProof) -> str Render ``proof`` as a markdown document with goal metadata and step tree. .. py:method:: render_mermaid(proof: engine.proof.DirectProof) -> str Render ``proof`` as a Mermaid flowchart linking the goal to proof steps. .. py:function:: render_proof_markdown(proof: engine.proof.DirectProof, *, namespace_manager: rdflib.namespace.NamespaceManager | None = None, rules: tuple[engine.rules.Rule, Ellipsis] | None = None) -> str Render a `DirectProof` to markdown text. .. py:function:: render_proof_mermaid(proof: engine.proof.DirectProof, *, namespace_manager: rdflib.namespace.NamespaceManager | None = None, rules: tuple[engine.rules.Rule, Ellipsis] | None = None) -> str Render a `DirectProof` to Mermaid graph syntax.