Skip to main content

export_json

Function export_json 

Source
pub fn export_json(graph: &KnowledgeGraph, output_dir: &Path) -> Result<PathBuf>
Expand description

Export graph to graph.json in NetworkX node_link_data format.

Uses streaming serialization via BufWriter to avoid building the entire JSON string in memory. For large graphs (50K+ nodes) this reduces peak memory by ~500 MB compared to to_string_pretty().