src.dackar.knowledge_graph.visualize_schema =========================================== .. py:module:: src.dackar.knowledge_graph.visualize_schema Functions --------- .. autoapisummary:: src.dackar.knowledge_graph.visualize_schema._iter_relations src.dackar.knowledge_graph.visualize_schema._collect_nodes src.dackar.knowledge_graph.visualize_schema._collect_relations src.dackar.knowledge_graph.visualize_schema.createInteractiveFile Module Contents --------------- .. py:function:: _iter_relations(relations_section) Yield (relation_name, relation_entry) for each concrete relation entry. Supports both: - relation_name -> dict - relation_name -> list[dict] .. py:function:: _collect_nodes(schema) .. py:function:: _collect_relations(schema) .. py:function:: createInteractiveFile(schema_list, output_file = 'knowledge_graph_schema_interactive.html', namespace_by_schema = False, raise_on_collision = True) Build an interactive HTML visualization from a list of parsed schema dicts. :param schema_list: Each dict is a parsed TOML schema with 'node' and 'relation'. :type schema_list: list[dict] :param output_file: Where to write the HTML. :type output_file: str :param namespace_by_schema: If True, prefix node and relation labels with schema index to prevent collisions. :type namespace_by_schema: bool :param raise_on_collision: If True, raise on duplicate node or relation names; else, log warning and overwrite. :type raise_on_collision: bool