Skip to content

feat: add GraphML and CSV exporters - #85

Merged
yifanfeng97 merged 2 commits into
yifanfeng97:mainfrom
Frankie-Xu:feat/export-graphml-csv
Sep 3, 2026
Merged

feat: add GraphML and CSV exporters#85
yifanfeng97 merged 2 commits into
yifanfeng97:mainfrom
Frankie-Xu:feat/export-graphml-csv

Conversation

@Frankie-Xu

Copy link
Copy Markdown
Contributor

Motivation

he export only supported Obsidian (#37). Desktop graph tools and spreadsheets need GraphML and node/edge tables.

Design

  • Pure functions in hyperextract/utils/exporters (same layer as export_to_obsidian). AutoType classes are unchanged — avoids coupling to v0.5.0 isolation helpers on types/graph.py.
  • Pairwise GraphML: edgedefault="directed", endpoint order preserved (sourcetarget). Never sort endpoints.
  • CSV: nodes.csv + edges.csv; hypergraphs get hyperedges.csv. GraphML on a hypergraph KA errors and points at CSV.
  • CLI: he export graphml / he export csv next to obsidian.

Tests

tests/utils/test_exporters.py: B→A direction, XML escaping, CSV quoting, missing endpoints skipped, hypergraph GraphML error, CliRunner.

Compatibility

Additive. No change to Obsidian export, dump/load, or he template validate. Rebased onto current main (including #83).

Made with Cursor

Frankie-Xu and others added 2 commits September 2, 2026 19:27
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@yifanfeng97
yifanfeng97 merged commit 004304d into yifanfeng97:main Sep 3, 2026
4 checks passed
@yifanfeng97

Copy link
Copy Markdown
Owner

Merged — nice scope discipline keeping the exporters as pure functions in utils/ (no AutoType coupling), and the directed-GraphML endpoint-order guarantee is exactly right for graph semantics. The hypergraph → CSV pointer beats emitting broken GraphML. Docs in both languages too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants