Skip to main content

Overview

Export the knowledge graph to standard formats for use in external tools, analysis platforms, or visualization software.

Usage

Arguments

string
required
Export format. Supported values:
  • json - JSON graph format
  • graphml - GraphML XML format (default)
  • gexf - GEXF XML format for Gephi
  • csv - CSV edge/node lists
  • sqlite - SQLite database

Options

string
Output directory containing graph data. Use -o as shorthand.
string
Export file or directory path. Overrides default location.
boolean
default:"false"
Enable verbose logging. Use -v as shorthand.

Supported Formats

GraphML (Default)

XML-based graph format supported by:
  • Cytoscape
  • yEd
  • Neo4j
  • NetworkX
Default output: {output_dir}/graph.graphml

GEXF

Graph Exchange XML Format for:
  • Gephi
  • Sigma.js
  • Graph visualization tools
Default output: {output_dir}/graph.gexf

JSON

Structured JSON with full graph data:
  • Nodes with attributes
  • Edges with properties
  • Metadata
Default output: {output_dir}/graph.json

CSV

Two CSV files:
  • entities.csv - Node list with attributes
  • relations.csv - Edge list with properties
Default output: {output_dir}/csv/

SQLite

Relational database with tables:
  • entities - Entity nodes
  • relations - Edges
  • attributes - Entity attributes
Default output: {output_dir}/graph.sqlite

Entity Descriptions

If entity_descriptions.json exists (from sift narrate), descriptions are included in exports:
Descriptions appear as node attributes in exported formats.

Examples

Export to GraphML

Creates output/graph.graphml.

Export to Gephi format

Creates output/graph.gexf for Gephi visualization.

Export to CSV

Creates output/csv/entities.csv and output/csv/relations.csv.

Custom export path

Exports to specified file path.

Export from custom output directory

Exports graph from custom output directory.

Export to SQLite

Creates SQLite database at specified path.

Output Summary

Displays:
  • Export format
  • Entity count
  • Relation count
  • Output file location(s)

Example Output

For CSV:

Common Workflows

Export for Gephi

Export for Python analysis

Export for Neo4j

Export for R/igraph

Error Handling

Exits with error if:
  • No graph_data.json found (run sift build first)
  • Unsupported format specified
  • Invalid export path

Format Validation

Common Mistake Prevention

If user types sift export --to json (meaning format):
The CLI detects this pattern and auto-corrects.

See Also

  • view - Interactive visualization
  • narrate - Generate descriptions for export
  • build - Build graph for export