Skip to content

feat: graph-level annotations, proto in wheel, and schema folder consolidation#72

Open
harsh-sikhwal wants to merge 12 commits into
mainfrom
annotate-graph
Open

feat: graph-level annotations, proto in wheel, and schema folder consolidation#72
harsh-sikhwal wants to merge 12 commits into
mainfrom
annotate-graph

Conversation

@harsh-sikhwal

@harsh-sikhwal harsh-sikhwal commented Jul 10, 2026

Copy link
Copy Markdown
Member
  1. Graph-level annotation support — New graph field on Annotation allows annotating the graph itself (not just nodes/edges/links). Attributes are stored in networkx's graph.graph dict and surfaced in both infragraph and networkx outputs from get_graph. Immutable attribute guard applies. 7 tests added in test_graph_annotations.py.

  2. Proto bundled in wheel — infragraph.proto is now generated into src/infragraph/ and included in the sdist/wheel via pyproject.toml. CI commits the generated proto alongside other artifacts.

  3. Schema folder consolidation — api/ (endpoint definitions) and models/ (component schemas) merged into a single schema/ folder. All cross-references in schema/api.yaml updated. generate.py and CI workflow updated accordingly.

Graph-level annotation support

Adds a new graph target to the Annotation API so key-value metadata can be attached to the whole graph, not just nodes/edges/links. Also refactors models/ + api/ into a single schema/ folder.

Annotate the graph

annotation = Annotation()
annotation.graph.add(attribute="cluster", value="rack-a")
annotation.graph.add(attribute="experiment", value="run-42")

service.annotate_graph(annotation)

Query graph-level attributes

request = QueryRequest()
filter = request.graph_filters.add(name="cluster filter")
filter.attribute_filter.name = "cluster"
filter.attribute_filter.operator = QueryAttribute.EQ
filter.attribute_filter.value = "rack-a"

response = service.query_graph(request)
# response.graph_matches -> [NameValue(name="cluster", value="rack-a")]

Schema changes

  • schema/annotation.yaml: Annotation gains a graph field (x-field-uid: 4, array of Annotation.Attribute)
  • schema/api.yaml: relocated from api/api.yaml
  • models/*.yamlschema/*.yaml (folder rename, no schema content change)

Rendered spec: https://keysight.github.io/infragraph/openapi.html

@harsh-sikhwal harsh-sikhwal requested a review from ajbalogh July 10, 2026 12:06

@ajbalogh ajbalogh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add code snippets to the PR summary showing how with the API a user would annotate the graph, query those graph attributes, and what it would look like when retrieving the full/partial graph. Also if there is a change to the schema please include a link to the redocly documentation.

@ajbalogh ajbalogh self-requested a review July 13, 2026 14:02
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.

4 participants