Skip to content

feat(view): recognise every Egeria graph key; show action and activity graphs beside the context graph - #573

Merged
dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:feat/mermaid-graph-keys
Nov 9, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:feat/mermaid-graph-keys

Conversation

@dwolfson

@dwolfson dwolfson commented Nov 9, 2026

Copy link
Copy Markdown
Member

Egeria graph keys: a generic Mermaid rule, and the action and activity graphs follow the context graph (6.2.29)

Branch feat/mermaid-graph-keys at b872720, based on upstream/main 8d5bd55 (#572). Two signed commits:

  1. 400b3c61: the generic rule and the companion graphs.
  2. b8727207: the owner's "key on every row" for DICT, and the release-note fix (both from the Architect's read-back of 400b3c6).

Why

From Egeria 6.2.29 the context graph, mermaidGraph, leaves out relationships whose purpose is Action or Activity. Two graphs show them instead: actionMermaidGraph and activityMermaidGraph. Egeria returns 25 graph keys in all, and pyegeria did not name 9 of them, activityMermaidGraph among them. So without this change those relationships would vanish from every report that shows mermaidGraph.

What changes

  1. A generic rule (is_mermaid_graph_key, pyegeria/view/output_formatter.py).
    • A key ending in MermaidGraph, MermaidMindMap, MermaidPieChart or LineageGraph is a Mermaid graph; the ending's case is ignored. LineageGraph covers fieldLevelLineageGraph and localLineageGraph, which carry no "Mermaid".
    • The rule is used by _is_mermaid_attribute (REPORT/MERMAID rendering) and by populate_common_columns. The latter fills a generic graph column only when the element carries it, so a column the element lacks keeps the value it had before.
    • A column title ending in "Mermaid Graph", "Mermaid Mind Map", "Mermaid Pie Chart" or "Lineage Graph" also counts.
    • Vega-Lite keys (...BarGraph, ...PieGraph) are not matched, and are checked first anyway. I checked every spec column: none changes classification.
    • MERMAID_ATTRIBUTE_KEYS stays, plus activityMermaidGraph. The _globals.MERMAID_GRAPHS and MERMAID_GRAPH_TITLES lists are unchanged (exported; the rule does not depend on them).
  2. The action and activity graphs follow the context graph (MERMAID_COMPANION_GRAPHS, _companion_mermaid_columns). Wherever a report offers the context graph (a column keyed mermaidGraph, or the mermaid column filled from it), each companion the element carries follows it:
    • MERMAID (extract_mermaid_only): one more Mermaid block each;
    • REPORT, and so HTML: ### Action Mermaid Graph / ### Activity Mermaid Graph sections right after the context graph;
    • DICT: Action Mermaid Graph / Activity Mermaid Graph entries right after the context graph's entry. Key on every row (owner's decision): in a result of several rows, if any row carries a companion, every row gets that key, after its context graph, "" where the element has none, so table renderers (the Portal Run panel, Trellis tiles) see one row shape. A single row, or rows none of which carries a companion, are unchanged. DICT is the only row builder that adds companions;
    • TABLE, LIST, MD and FORM: nothing. Every row of a table has the same columns, and MD/FORM show no graphs.
    • A companion the spec already selects is not repeated: Asset-Graph's REPORT shows its own Action Graph once.
    • Output changes today, because Egeria already returns actionMermaidGraph (for Assets, for example): a report that offers the context graph now also shows the action and activity graphs when Egeria returns them. For example, Asset-Graph MERMAID now shows the asset's action graph after its context graph (2 blocks live, for an asset with one). test_asset_graph_spec.py is updated for this.
  3. The ISC typo is already fixed upstream. pyegeria asks for iscImplementationMermaidGraph, and _get_mermaid_graph_value still reads the pre-6.3 iscimplementationMermaidGraph case-insensitively. That existing test still passes. Nothing else in pyegeria, md_processing or the seed uses the lower-case form.
  4. governanceActionProcessMermaidGraph is real: it comes from GovernanceActionProcessGraph in Egeria's open-governance-framework (setGovernanceActionProcessMermaidGraph). It is just missing from the 25-key list. Untouched.
  5. Docs: docs/output-formats-and-report-specs.md explains the rule, the companions and key on every row, and its key table gains the missing keys. The 6.2.29 release note has two new bullets. The first leads with "a report that offers the context graph (mermaidGraph) now also shows the action and activity graphs when Egeria returns them", and says this changes output today.

Byte-identical where neither companion graph is present

This holds only for elements without actionMermaidGraph and activityMermaidGraph. Where Egeria already returns actionMermaidGraph, output changes, as intended.

  • Seed: python -m pyegeria.view.seed check reports the seed is current. A fresh seed build is identical to the packaged seed (diff -r). Census 437 = 376 runnable / 0 unrunnable / 61 format-only. No spec declaration changed.
  • Renders: every spec in every declared format (674 renders), via generate_output and extract_mermaid_only, on upstream and on this branch. Two recorded elements without actionMermaidGraph/activityMermaidGraph were used: the Asset-Graph response minus its action graph, and a header+properties+mermaidGraph element. All 674 sha256 hashes match. The preamble's minute timestamp and construct_mermaid_web's random id were masked; both were already nondeterministic.

Tests

tests/micro-tests/test_mermaid_graph_keys.py, new, uses recorded responses: data/graph_keys_responses.json (new; a GovernanceZone and an asset lineage graph from qs-view-server, read only) and the existing data/asset_graph_by_guid_response.json. It checks:

  • all 25 Egeria keys, plus new-kind and legacy keys, are recognised;
  • Vega and ordinary keys are not;
  • every graph key in the recorded responses renders as one Mermaid block;
  • each key the platform does not return yet renders when selected. Those are added to copies of the recorded elements: activityMermaidGraph, collectionMermaidMindMap, zoneProfileAnchoredMermaidPieChart, the two user-account pie charts, fieldLevelLineageGraph and localLineageGraph;
  • populate_common_columns fills a generic key only when present;
  • companions appear in order (context, action, activity) in MERMAID, REPORT, HTML and DICT, and not in TABLE;
  • only the companions an element carries are added;
  • no companion keys means no change;
  • no companions without the context graph;
  • no repeat when the spec already selects one;
  • key on every row: mixed DICT rows share one shape and key order, with "" where absent;
  • only the companions some row carries are added to every row;
  • no companion in any row means no key is added;
  • a single row is unchanged.

The 674-render check and seed check were re-run after commit 2: still byte-identical, and the seed is current.

Live (read only, page_size ≤ 5)

  • Seen live:
    • mermaidGraph and anchorMermaidGraph;
    • actionMermaidGraph, on 2 of 5 asset graphs;
    • edgeMermaidGraph and fullLineageMermaidGraph, from asset lineage graphs;
    • zoneProfileMermaidPieChart and zoneProfileAllMermaidPieChart, from GovernanceZones.
  • Not returned yet: activityMermaidGraph, collectionMermaidMindMap, zoneProfileAnchoredMermaidPieChart, userAccountTypeProfileMermaidPieChart, userAccountStatusProfileMermaidPieChart, fieldLevelLineageGraph and localLineageGraph. So the platform has not shipped the split yet. A SecretsCollection find returned a server 500 (read; nothing written).
  • Live render with this branch: Asset-Graph MERMAID gives 2 blocks (context, then action).

Suite

Full micro-suite on Python 3.13 (uv run -p 3.13 pytest tests/micro-tests/, JUnit): 2668 tests, 0 failures, 0 errors, 3 skipped (run 18:10Z, at b872720). After commit 1: 2664/0/0/3.

Not in this PR

  • The Portal side (graph tabs, diagram viewer) is being done in parallel by the Portal builder.
  • TABLE/LIST deliberately get no companion columns.

Review

  • Coordinator gate on Python 3.13 at b872720: 2,668 tests, 0 failed, 0 errors, 3 skipped.
  • Architect read-back: PASS (all 25 owner keys recognised; companion graphs after the context graph; key on every row, as the owner chose; census 437/376/0/61 unchanged; seed check clean).
  • Output changes today for Assets: Egeria already returns actionMermaidGraph, so reports that show the context graph gain the action graph.

🤖 Generated with Claude Code

…follow mermaidGraph

From Egeria 6.2.29 mermaidGraph leaves out relationships whose purpose is
Action or Activity; actionMermaidGraph and activityMermaidGraph show them.

- is_mermaid_graph_key(): a key ending in MermaidGraph, MermaidMindMap,
  MermaidPieChart or LineageGraph is a Mermaid graph, so a new kind of
  graph needs no code change (covers the 9 keys pyegeria did not name).
  Used for REPORT/MERMAID detection and populate_common_columns (which
  fills a generic key only when the element carries it).
- Wherever a report offers the context graph (mermaidGraph or the
  'mermaid' column), the action and activity graphs the element carries
  follow it in MERMAID, REPORT/HTML and DICT; not in TABLE/LIST/MD/FORM;
  never repeated when the spec selects one. Asset-Graph MERMAID now also
  shows the action graph.
- Output is byte-identical when neither key is present: 674 renders
  (every spec x declared format) hash-equal to upstream; seed unchanged.
- Tests use recorded responses (zone pie charts, lineage graph, asset
  graph); keys the platform does not return yet are added to copies.
- Docs and the 6.2.29 release note.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…te fix

Owner decision on the Architect's P2 ("Key on every row"): in a DICT
result of several rows, when any row carries a companion graph (Action or
Activity Mermaid Graph), every row gets that key right after its context
graph, "" where the element has none, so table renderers (Portal Run
panel, Trellis tiles) see one row shape. A single row, or rows none of
which carries a companion, are unchanged (674-render check still
byte-identical; seed current). DICT is the only row builder that adds
companions (TABLE adds none).

Tests: mixed rows share one shape and key order; only companions some row
carries are added; no companion means no key; a single row is unchanged.

Release note and docs: say plainly that output changes today, because
Egeria already returns actionMermaidGraph (e.g. Asset-Graph's MERMAID now
has two blocks).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 26aa406 into odpi:main Nov 9, 2026
5 checks passed
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