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
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
Output directory containing
graph_data.json (defaults to output/)Custom export file/directory path
Verbose logging
Export Formats
GraphML
Best for: yEd, Cytoscape, Gephi, NetworkX, igraph- 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
.graphml file
GraphML Structure
GraphML Structure
GEXF
Best for: Gephi (native format)- Gephi’s native format (best compatibility)
- RGB colors for nodes and edges
- Pre-computed positions (spring layout)
- All attributes preserved
.gexf file
Gephi Import:
- Open Gephi
- File → Open → Select
.gexffile - Graph loads with colors and layout already applied
CSV
Best for: Excel, Pandas, R, SQL imports, manual analysisentities.csv— Entity nodesrelations.csv— Relation edges
entities.csv
relations.csv
SQLite
Best for: SQL queries, BI tools, joins with other data.sqlite database file
Schema:
JSON
Best for: Python scripts, JavaScript apps, re-importing to sift-kggraph_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 runsift narrate, entity descriptions are automatically included in exports:
- GraphML/GEXF:
descriptionattribute on nodes - CSV:
descriptioncolumn inentities.csv - SQLite:
descriptioncolumn innodestable
Without
sift narrate, the description field will be empty.Use Cases
Network Analysis in Python/R
Network Analysis in Python/R
Export to CSV, then analyze with Pandas/NetworkX/igraph:
Graph Visualization in Gephi
Graph Visualization in Gephi
Export to GEXF, open in Gephi:In Gephi:
- File → Open →
gephi-import.gexf - Graph loads with colors and positions
- Apply layout algorithms (Force Atlas 2, Fruchterman-Reingold)
- Adjust styling and export publication-quality images
Business Intelligence / Dashboards
Business Intelligence / Dashboards
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
- Entity counts by type over time
- Most connected entities
- Confidence score distributions
- Document coverage (entities per doc)
Data Lineage / Audit Trails
Data Lineage / Audit Trails
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)
Graph Database Import (Neo4j)
Graph Database Import (Neo4j)
Export to CSV, import to Neo4j:Neo4j Cypher import script:
Format Comparison
| Format | Best For | Node Attrs | Edge Attrs | Multi-Edges | File Size |
|---|---|---|---|---|---|
| GraphML | General-purpose, yEd, Cytoscape | ✅ Full | ✅ Full | ⚠️ Merged | Large |
| GEXF | Gephi | ✅ Full | ✅ Full | ⚠️ Merged | Large |
| CSV | Excel, Pandas, SQL import | ✅ Full | ✅ Full | ✅ Preserved | Small |
| SQLite | SQL queries, BI tools | ✅ Full | ✅ Full | ✅ Preserved | Medium |
| JSON | Python, backup, re-import | ✅ Full | ✅ Full | ✅ Preserved | Medium |
Advanced Options
Custom Export Paths
Batch Exports
Troubleshooting
”Graph not found”
Runsift 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