[BUG] KGVisualizer.visualize_network() does not accept a KnowledgeGraph object
bug
Description:
KGVisualizer.visualize_network() is typed as graph: Dict[str, Any] and internally accesses graph["entities"] and graph["relationships"] directly. Passing a KnowledgeGraph instance — the natural output of GraphBuilder.build() — silently does nothing: no error, no progress, no output.
Expected behavior: visualize_network(kg) where kg is a KnowledgeGraph should work, since the entire purpose of the visualizer is to visualize the result of building a knowledge graph.
Actual behavior: The method silently returns without rendering. No exception is raised, no warning is logged.
Workaround:
fig = viz.visualize_network(
{"entities": entities, "relationships": relationships},
output="interactive",
)
Steps to reproduce:
from semantica.kg.graph_builder import GraphBuilder
from semantica.visualization import KGVisualizer
kg = GraphBuilder().build([{"entities": [...], "relationships": [...]}])
viz = KGVisualizer(layout="force")
fig = viz.visualize_network(kg, output="interactive") # silent no-op
Version: semantica 0.4.0
关闭于 2026-04-14 0 条评论