Read GEXF

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
data

Research direction

Start with issue #8, which the issue says should land first, and use its XML reader, registration and documentation as the design reference. Then inspect FormatId and parseGraph in packages/formats/src/index.ts, detection in packages/formats/src/detect.ts, and the listed CLI and playground entry points. Done means static GEXF 1.2 and 1.3 files are detected and parsed, NetworkX GEXF hashes match equivalent node-link JSON, drawing and dynamic data produce warnings, and both language docs plus a changeset are included.

Written by the indexing model from the issue text.

Description

enhancement formats help wanted
Why

GEXF is Gephi's native format, and NetworkX writes it too
(nx.write_gexf). Like GraphML, kgdiff recognises it today and stops with "export it as JSON
first"
(detect.ts#L167).

What

A gexf format in @kgdiff/formats (GEXF 1.2 and 1.3):

  • <node id label> → node id and label; <edge source target> → edge, with id and label.
  • <attvalue for value> values, typed by the <attributes class="node|edge"> declarations
    and their defaults → fields, mapped like the JSON graph shapes (label, type and predicate
    from the same field names).
  • viz: elements (position, colour, size, shape) are drawing state: drop them with a warning.
  • Dynamic graphs (mode="dynamic", start / end / spells): out of scope for now. Read the
    static structure and warn.
Where to start

This is much easier once GraphML (#8) has landed: it adds the XML-based graph reader,
the format registration and the docs this issue can copy. If you want to pick this up before,
comment on #8 so the two share one design.

The files to touch are the same as in #8: FormatId and parseGraph in
packages/formats/src/index.ts, FORMAT_EXTENSIONS and sniffing in detect.ts, the CLI's
--format values, the playground, docs/formats.md and docs/architecture.md (en + zh).

Done when
  • kgdiff a.gexf b.gexf works, with detection from the extension and the content.
  • A graph written by NetworkX as GEXF and as node-link JSON gives the same hashGraph.
  • Docs updated in both languages, and a changeset.
Dominant language
TypeScript
Stars
47
Forks
6
Avg merge
2h 32m
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from iiwish/kgdiff

All issues in iiwish/kgdiff

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.