Skip to main content
The sift export command converts your knowledge graph into standard formats for use in external tools like Gephi, Cytoscape, Neo4j, Excel, and more.

Quick Start

Command Syntax

choice
required
Export format:
  • graphml — GraphML XML (yEd, Cytoscape, NetworkX)
  • gexf — GEXF XML (Gephi native format)
  • csv — CSV tables (Excel, Pandas, R)
  • sqlite — SQLite database (SQL queries, BI tools)
  • json — sift-kg native JSON format
path
Output directory containing graph_data.json (defaults to output/)
path
Custom export file/directory path
boolean
Verbose logging

Export Formats

GraphML

Best for: yEd, Cytoscape, Gephi, NetworkX, igraph
Features:
  • Full attribute preservation (entity types, confidence, evidence)
  • Pre-computed layout (spring layout, 1000x1000 canvas)
  • Node colors by entity type
  • Edge colors by relation type
  • Compatible with most graph analysis tools
Output: Single .graphml file

GEXF

Best for: Gephi (native format)
Features:
  • Gephi’s native format (best compatibility)
  • RGB colors for nodes and edges
  • Pre-computed positions (spring layout)
  • All attributes preserved
Output: Single .gexf file Gephi Import:
  1. Open Gephi
  2. File → Open → Select .gexf file
  3. Graph loads with colors and layout already applied
Use GEXF for Gephi, GraphML for everything else. Both contain the same data.

CSV

Best for: Excel, Pandas, R, SQL imports, manual analysis
Output: Directory with two CSV files
  • entities.csv — Entity nodes
  • relations.csv — Relation edges

entities.csv

relations.csv

Excel Import:
Pandas Import:

SQLite

Best for: SQL queries, BI tools, joins with other data
Output: Single .sqlite database file Schema:
Example Queries:
Open in DB Browser:

JSON

Best for: Python scripts, JavaScript apps, re-importing to sift-kg
Output: sift-kg native format (same as graph_data.json) This is the internal format used by sift-kg. Use for:
  • Backups and versioning
  • Sharing graphs between sift-kg installations
  • Custom processing with NetworkX:

Including Descriptions

If you’ve run sift narrate, entity descriptions are automatically included in exports:
Descriptions appear in:
  • GraphML/GEXF: description attribute on nodes
  • CSV: description column in entities.csv
  • SQLite: description column in nodes table
Without sift narrate, the description field will be empty.

Use Cases

Export to CSV, then analyze with Pandas/NetworkX/igraph:
Export to GEXF, open in Gephi:
In Gephi:
  1. File → Open → gephi-import.gexf
  2. Graph loads with colors and positions
  3. Apply layout algorithms (Force Atlas 2, Fruchterman-Reingold)
  4. Adjust styling and export publication-quality images
Export to SQLite, connect from BI tools:
Connect from:
  • Tableau: SQLite connector
  • Power BI: ODBC driver for SQLite
  • Metabase: SQLite database connection
  • Apache Superset: SQLite support
Build dashboards showing:
  • Entity counts by type over time
  • Most connected entities
  • Confidence score distributions
  • Document coverage (entities per doc)
Export to CSV for audit reports:
Use source_documents, support_documents, evidence fields to trace:
  • Which documents mention each entity
  • Evidence supporting each relation
  • Cross-document validation (entities in 3+ docs = high confidence)
Export to CSV, import to Neo4j:
Neo4j Cypher import script:

Format Comparison

GraphML and GEXF don’t support multi-edges well (multiple relations between same entity pair). Parallel edges are merged, with relation types concatenated: WORKS_FOR; FOUNDED.Use CSV or SQLite if you need to preserve every individual relation.

Advanced Options

Custom Export Paths

Batch Exports

Troubleshooting

”Graph not found”

Run sift build first to create graph_data.json.

Attribute truncation in GraphML/GEXF

Complex attributes (nested dicts, long lists) are JSON-serialized to strings. This is a format limitation. For full attribute access, use CSV or SQLite exports.

Large file sizes

GraphML/GEXF are verbose XML formats. For large graphs (>10k entities):

Parallel edges collapsed

GraphML/GEXF collapse multi-edges (same source/target, different types). Solution: Use CSV or SQLite to preserve all individual relations:

Special characters in CSV

Entity names with commas, quotes, or newlines are properly escaped. If importing to Excel and seeing issues:
  • Use “From Text/CSV” import wizard (not drag-and-drop)
  • Select UTF-8 encoding
  • Use semicolon delimiter for list fields (source_documents, support_documents)

Next Steps

Visualize Graph

Interactive exploration before exporting

API Reference

Programmatic export from Python scripts