mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
KGVisualizer.visualize_network() (and sibling methods) only accepted a raw dict. Passing a KnowledgeGraph object — the natural output of GraphBuilder.build() — silently returned without rendering. Added _normalize_graph() which duck-types the input: dicts pass through unchanged; any object exposing .entities / .relationships attributes is converted to the canonical dict form; anything else raises a clear ProcessingError naming the offending type. _normalize_graph() is called as the first statement in visualize_network(), visualize_communities(), visualize_centrality(), visualize_entity_types(), and visualize_relationship_matrix(). Also adds 21 tests in tests/visualization/test_kg_visualizer_normalize_graph.py covering the helper directly, the end-to-end regression for #458, and a guard that every public method routes through _normalize_graph. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>