Skip to content

Add GraphML generator for galaxies/clusters with optional inferred links#1176

Merged
adulau merged 1 commit intomainfrom
codex/add-python-tool-for-galaxy-relationship-graph
Apr 12, 2026
Merged

Add GraphML generator for galaxies/clusters with optional inferred links#1176
adulau merged 1 commit intomainfrom
codex/add-python-tool-for-galaxy-relationship-graph

Conversation

@adulau
Copy link
Copy Markdown
Member

@adulau adulau commented Apr 12, 2026

Motivation

  • Provide a single tool to export the entire repository of galaxies and clusters as a GraphML graph for visualization and analysis.
  • Allow both existing explicit relationships and inferred relationships (value/synonym matches) to be examined without modifying source JSON files.

Description

  • Add a new CLI script tools/gen_graphml.py which loads galaxies/*.json and clusters/*.json and emits a GraphML graph with galaxy nodes, cluster nodes, and membership (contains) edges.
  • The tool includes explicit edges from cluster.related by default and can disable them with --no-existing-relationships.
  • The tool can infer cross-galaxy edges by matching normalized cluster values or values+meta.synonyms via --cross-cluster-matching value or value-or-synonyms, and it only creates inferred links between different galaxy types.
  • Adds CLI options for input directories and output path, uses simple normalization of terms, and writes GraphML using xml.etree.ElementTree to the specified output file.

Testing

  • Performed static validation with python -m py_compile tools/gen_graphml.py, which succeeded.
  • Ran the tool to produce a full export with --output /tmp/misp.graphml, which completed and printed a summary (wrote GraphML with 115 galaxies and 48744 clusters).
  • Ran the tool with inferred matching via --cross-cluster-matching value-or-synonyms and it completed successfully producing a GraphML file.

Codex Task

@adulau adulau merged commit 8ccf22c into main Apr 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant