Skip to content

Add XML declaration header to GraphML snapshot output#2304

Open
jiebei-668 wants to merge 1 commit intomicrosoft:mainfrom
jiebei-668:feat/graph-visualization
Open

Add XML declaration header to GraphML snapshot output#2304
jiebei-668 wants to merge 1 commit intomicrosoft:mainfrom
jiebei-668:feat/graph-visualization

Conversation

@jiebei-668
Copy link
Copy Markdown

Summary

  • Add <?xml version="1.0" encoding="utf-8"?> XML declaration header to the generated GraphML output
  • Add unit tests for snapshot_graphml operation

Problem

The snapshot_graphml function uses nx.generate_graphml() which does not include an XML declaration header.
This makes the generated file incompatible with strict XML parsers and tools like Gephi desktop, despite the
official visualization guide recommending Gephi as
the primary visualization tool.

Test plan

  • Added unit tests in tests/unit/indexing/test_snapshot_graphml.py
  • uv run poe check passes (ruff + pyright)
  • uv run poe test_unit passes

Fix graph.graphml output to include the XML declaration header
  (<?xml version=1.0 encoding=utf-8?>) required by the XML
  specification, ensuring the generated file can be correctly
  imported by Gephi and other GraphML-consuming tools.
@jiebei-668 jiebei-668 requested a review from a team as a code owner March 29, 2026 07:19
@jiebei-668
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

1 participant