Skip to content

pyegeria 6.2.37: DOCUMENT output + DCAT export, structured tables, report-spec rendering fixes - #589

Merged
dwolfson merged 15 commits into
odpi:mainfrom
dwolfson:release/6.2.37
Nov 11, 2026
Merged

dwolfson merged 15 commits into
odpi:mainfrom
dwolfson:release/6.2.37

Conversation

@dwolfson

Copy link
Copy Markdown
Member

pyegeria 6.2.37

pyegeria 6.2.37 adds standard-document output to report specs (a DCAT-AP 3 catalog of Assets first), and corrects
and extends how report specs render complex values:

  • New output, new shapes, all opt-in: a DOCUMENT output type with validators; a structured TABLE
    (table_shape="structured") and native DICT rows (dict_shape="native"); per-column render intents.
  • Existing applications work unchanged: the same calls return the same result shapes. Structured and native
    results come back only when a caller asks for them, and DICT stays flat by default.
  • Behaviour change: rendered text changes on upgrade (see below). Anything that parses pyegeria's rendered
    text (REPORT, LIST, MD, FORM, HTML or the CLI table), rather than DICT or JSON, should be re-checked.

New

  • DOCUMENT output type (SD-1). A report spec can produce one standard document instead of rendered columns:
    exec_report_spec(name, output_format="DOCUMENT", params=...) returns
    {kind: "document", standard, media_type, file_name, text, validation, notes}.
    • validation is always present: valid, invalid, or not_validated with the reason. A validator that fails
      is not_validated with its error type and line/column, never its parser's text.
    • notes says what the document leaves out and why.
    • Validators are registered by name (register_document_validators); json-schema, shacl and
      dcat-ap-3-shacl are built in. A validator never fetches over the network, and a report spec may name only
      package: files (a spec can be held in Egeria and written by any user).
    • run_report --output-format DOCUMENT --output <dir> [--force] writes the file and prints the validation line.
    • See "Document outputs" in docs/output-formats-and-report-specs.md.
  • DCAT Catalog (SD-2). The built-in specs "DCAT Catalog" (JSON-LD) and "DCAT Catalog (Turtle)" export the
    Assets in a collection (scope, a qualifiedName or GUID) as a DCAT-AP 3 catalog, read as the caller and
    validated against the DCAT-AP 3.0.1 SHACL shapes shipped with pyegeria (CC BY 4.0; source and hashes in
    pyegeria/view/data/dcat-ap-3/README.md).
    • DigitalProducts and Agreements are Bitol's: each is named in the notes, never exported.
    • A zoned Asset the caller can read is dct:accessRights NON_PUBLIC; a member Egeria refuses with a 403 is noted
      as "not visible", never as absent.
    • Every property left out says why in the notes.
  • Structured TABLE (R1). exec_report_spec(..., output_format="TABLE", table_shape="structured") (and the
    async _async_run_report) returns kind: "table":
    • columns, each with an inferred type (scalar, text, list, map, elements, table) and a render;
    • rows of native values keyed by column key, related elements as {guid, qualifiedName, displayName, type};
    • total, shown, total_basis ("one page") and notes for every cap or reduction;
    • an empty relationship cell is "none" when the relationship was read, and "not read" when it was not
      requested;
    • a table shows two levels: a third is reduced to a count and names, with a note.
  • Native DICT (R1). dict_shape="native" on exec_report_spec, generate_output and the async twin returns
    DICT rows with native values: lists stay lists, related elements carry both names, classifications and zones are
    lists, and format=True columns are not stringified. The default "flat" is unchanged; TABLE stays flat under
    dict_shape. Any other table_shape or dict_shape value is refused in words.
  • Column render intents (R2). A report-spec column can set render (text, join, bullets, kv, subtable, count,
    link), max_items (default 10), max_lines (default 3) and label (qualified_name, the default, or
    display_name for related elements in text outputs). All four are carried in Egeria-held specs (label as
    related_label in a microflow column item).
  • The CLI draws the structured table (R3). run_report --output-format TABLE renders with Rich: lists one
    item per line, maps as nested tables, long text cut at max_lines with "…", each sub-table as a separate table
    after the main one, and dropped columns named in a footer. list_generic keeps flat rows unless asked.
  • My Egeria and the report TUI read native DICT (R4).
    • Shop for Data's catalog, root-collection and domain details ask for dict_shape="native" and read related
      elements as lists (value_names). The Domains tree no longer shows one leaf per character of a joined string,
      and a link-wrapped "Containing Members" value is unwrapped.
    • The report TUI (my_reports) shows a list as one joined cell (+N more past 10) and a dict as JSON in one
      cell, instead of turning list items or dict keys into extra columns.
    • The Data Products demo no longer splits a value that can be a list.

Fixed

  • Digital-Products Members was empty on every row (F7). Egeria returns a collection's members as
    collectionMembers; the spec's members column now reads it when the element has no members field.
  • A capped result said nothing (F8). Digital-Products returned exactly 100 of 445 products with no word. A
    result that fills its page now says so, as notes beside data and as a line in text output:
    "Showing the first 100: the query stopped at its page size of 100; more may exist." The record of what each
    list request sent is kept per call, so concurrent runs on one shared client never mix their notes.
  • page_size / start_from given as text are converted to whole numbers; anything else is refused in words
    instead of reaching Egeria.

Behaviour change: rendered text changes on upgrade

These corrections change rendered text (REPORT, LIST, MD, FORM, HTML and the CLI table). DICT and JSON row
shapes are unchanged
; a DICT/TABLE result that filled its page also carries a top-level notes list beside
data.

  • F1: header classifications are joined with ", " (no stray newline before the comma).
  • F2: REPORT/MD/FORM show a False or 0 value instead of dropping it.
  • F3: FORM/MD say "Diagram omitted in this format; see REPORT or MERMAID." where a diagram was silently dropped
    (the camelCase solutionBlueprintMermaidGraph now matches too); links, implemented by and sub_components
    render as values.
  • F4: the CLI table shows list items with "(+N more)" instead of "N items", and a map as one k: v; ... cell
    instead of dotted columns.
  • F5: the CLI table keeps the author's column order and names the columns it cannot show
    ("+N more columns: ...") instead of dropping them silently.
  • F6: LIST no longer drops an unnamed object in a list value: it shows its first text value or
    "(unnamed )".
  • F7: the Digital-Products Members column is filled. Relationship columns still show qualifiedNames by
    default.
  • F8: capped results say so (above).
  • F9: markdown table cells escape | and turn newlines into <br>; markdown emphasis is kept.
  • F10: format="bulleted-list" works in REPORT/MD (a markdown list), not only in LIST.
  • R2, Digital-Products: its Product Manager and License columns show the related element's display name (for
    example "Data for Internal Use" instead of "LicenseType::Jacquard::LICENSE-TYPE-IOU::Data for Internal Use") in
    every output of that spec (DICT, TABLE, LIST, REPORT, FORM). This is the spec's own label: display_name; no
    other spec or column changes.
  • R3, LIST cells: a list of scalars renders as bullets (a<br>b) instead of "a, b"; a related-element list
    past max_items (10) shows "(+N more: ...)", and a map shows k: v<br>.... Columns with format=True or a
    detail_spec render as before.

Dependencies and size

  • rdflib, pyshacl and jsonschema are now plain dependencies (about 2.25 MB of wheels: pyshacl 1.31 MB, rdflib
    0.62 MB, pyparsing 0.13 MB, html5rdf 0.11 MB, owlrl 0.06 MB, prettytable 0.04 MB; jsonschema was already
    installed).
  • The pyegeria wheel is 3,366,371 bytes, 76,742 bytes (about 75 KB) more than 6.2.36's 3,289,629. The DCAT-AP 3.0.1
    shapes account for most of it.

Release branch release/6.2.37 @ c0f8840 (signed). Micro-tests on 3.13: 3244 passed, 0 failed, 3 skipped, run independently on laz. Wheel 3,366,371 bytes, checked in a clean venv.

🤖 Generated with Claude Code

A report spec can now produce one standard document instead of rendered columns.

- Format.types accepts DOCUMENT, with a `document` block (standard, media_type,
  file_name template, optional validator + validator_options). Load refuses a
  DOCUMENT spec without action.analytic_function, a find-only one (with a
  sentence), a DOCUMENT row mixed with other types or other formats, and a
  file_name with path separators or "..".
- exec_report_spec(..., output_format="DOCUMENT") runs the exporter (an
  analytic function returning {text, notes?}), fills the file name from the
  run's parameters (values made file-name safe, result re-checked) and returns
  {kind: "document", standard, media_type, file_name, text, validation, notes}.
  validation is always present; a missing/unregistered/crashing validator is
  not_validated with the reason, never invalid. Other formats of a DOCUMENT
  spec, and DOCUMENT of any other spec, are refused in words.
- pyegeria.view.document_validators: register_document_validators (collision
  raises) with built-ins json-schema and shacl. Both read only local paths,
  file:// URLs or package data; http(s) references and remote JSON-LD
  @contexts are refused, so a validator never fetches over the network.
- run_report: --output-format DOCUMENT --output <dir> [--force] writes the
  document as file_name and prints the validation line and notes.
- rdflib, pyshacl and jsonschema are plain dependencies (D4).
- docs: "Document outputs" in output-formats-and-report-specs.md.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
… spec (SD-1 C1, C2)

Read-back CHANGES on e430870:

- C1: json_schema_validator passes an empty referencing.Registry() (no
  retrieve), so a $ref outside the schema is Unresolvable instead of being
  urlopened by jsonschema's default remote-warning registry. Tests fail on
  any urlopen or socket connect.
- C2a: a report spec's validator_options.schema/shapes must be a package:
  reference (spec_option_refusal), refused when the DocumentSpec loads and
  again when run_document_validator runs a spec given as a raw dict ("was
  not run"). Local paths and file:// stay available to code only
  (make_shacl_validator, direct validator calls).
- C2b: a failed validator's reason is the error type plus line/column
  (and, for an unresolvable $ref, the ref), never the parser's text, which
  can quote the input (rdflib's BadSyntax did). The remote-@context refusal
  no longer echoes the document's context values.

N1: the DOCUMENT-spec lookup on every run measured at 0.10 ms in-process
(a live analytic tile on laz is ~1 s), so it stays.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…Catalog spec (SD-2)

- pyegeria/view/export_dcat.py: the export_dcat analytic function (built-in,
  inputs egeria_client:EgeriaTech, declaration result_kind "finding"). Scope is
  a collection qualifiedName/GUID or a search over the asset domain; reads as
  the caller; members read page by page (startFrom += page_size) to an empty
  page, and a repeated page ends the reading with a note (laz's asset search
  rounds startFrom down). One element read per Asset, asking only for the
  relationships the mapping uses. Mapping is the design's section 7 table;
  DigitalProduct/Agreement members are named "not a DCAT dataset (Bitol)",
  other non-Assets "not an Asset"; a 403 member is "not visible to <viewer>";
  zoned Assets are NON_PUBLIC; every omitted property is a grouped note.
  rdflib graph, urn:egeria:guid IRIs (no blank nodes), JSON-LD with an inline
  prefix @context or Turtle, sorted for stable bytes.
- DCAT-AP 3.0.1 SHACL shapes vendored as package data (CC BY 4.0, source
  commit and hashes in pyegeria/view/data/dcat-ap-3/README.md); built-in
  validator dcat-ap-3-shacl. SHACL findings now read per focus node and path
  ("Dataset <identifier>: missing dct:description").
- Built-in specs "DCAT Catalog" (application/ld+json, {scope}-dcat.jsonld)
  and "DCAT Catalog (Turtle)", family Standard Documents; seed rebuilt.
- microflow carries a DOCUMENT formatter's document block both ways, and
  egeria_spec_cache._build skips (with words) a held spec whose document
  block refuses to load instead of aborting the tier sync (read-back N2).
- Fixtures: real responses captured read-only on laz as erinoverview by
  scripts/capture_dcat_fixtures.py (tests/micro-tests/data/dcat/).
- Tests: tests/micro-tests/test_sd2_export_dcat.py; three registry-count
  tests extended for the new built-in and output type.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…aset note says why (SD-2 C1, C2)

Read-back CHANGES on efa38a8:

- C1: Egeria's asset-domain pages can be short AND overlap (a live
  "Clinical" probe found one element on page 0 and page 5), so "stop when a
  page brings nothing new" could cut a catalog short. _paged now skips
  elements already read but stops early only on a page identical to the one
  before it (the server ignored startFrom) or after two pages in a row with
  nothing new, and the note says which. _MAX_PAGES stays.
- C2: "No dataset exported" no longer always blames visibility. Each element
  in scope is counted as Bitol-excluded, not an Asset, not visible, no
  longer found or unreadable, and an empty scope or search says so.

Tests: overlapping short pages all read; two no-new pages stop with a note;
identical page stops with a note; empty scope, empty search, Bitol/non-Asset
scope and all-refused scope each give their own sentence.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
BRIEF-REPORT-SPEC-FIX-NOW-2026-11-11, on SD-2 (be77eaf):

- F1 header classifications join with ", " (was "\n, ").
- F2 REPORT/MD/FORM render False and 0.
- F3 FORM/MD say a diagram is omitted ("see REPORT or MERMAID") instead of
  dropping it; the camelCase blueprint graph name now matches; links,
  implemented by and sub_components render as values.
- F4 CLI cells: list items with "(+N more)", never only a count; a map is one
  "k: v; ..." cell, never dotted columns.
- F5 CLI keeps the author's column order and names the columns past 12.
- F6 LIST never drops a nameless object: first text value, else
  "(unnamed <type>)".
- F7 relationship columns use the display name (displayName > name >
  qualifiedName), and spec key `members` reads Egeria's `collectionMembers`
  (Digital-Products Members was empty on all 100 rows). Uses/Used by/Solution
  Blueprint are genuinely none for those rows (Egeria omits empty lists).
- F8 a result that filled its page says so in `notes` (and in text): the
  client records it from the request it sent (_elements_noting_page_cap),
  so a find method that renders text itself is covered; page_size and
  start_from are coerced to whole numbers or refused in words.
- F9 markdown cells escape | and turn newlines into <br>, keeping emphasis
  (the flat-dict table too).
- F10 format="bulleted-list" works in REPORT/MD.

Fixtures: the five CDO-sheet tiles captured read-only on laz as erinoverview
at the HTTP layer (scripts/capture_report_fixtures.py, raw Egeria JSON,
gzipped) and replayed through the whole stack (report_fixture_replay.py).
Draft release notes: docs/release-notes/6.2.37.md.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The F7 read-back held the global display-name flip: My Egeria splits
relationship qualifiedNames and the "::" link wrap needs them. A display-name
label becomes a per-column choice (Column.label, R2). The members ->
collectionMembers alias stays. Tests and the draft release note follow.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…t (fix-now C1)

Read-back C1 on a88824b: `last_page_cap` was mutable state on the client, so
concurrent async report runs on one cached client (dashboard tiles) could
read each other's cap or lose their own.

- pyegeria.core._server_client.LIST_REQUEST_RECORD: a ContextVar holding a
  per-call dict. recording_list_requests() sets a fresh dict for the caller;
  every list helper (_elements_noting_page_cap) writes the cap -- read back
  from the request body it sent -- plus the graph depth and relationship
  filters into the current dict; the caller reads its own dict afterwards.
  The sync wrappers run the coroutine in a task that copies the context, so
  the same dict receives the writes. Nothing is stored on the client.
- exec_report_spec / _async_run_report record around the find call and pass
  their own record to page_cap_notes.
- Test: five interleaved async runs on one EgeriaTech (Digital-Products
  capped at 100 and the same spec asked for 200, as DICT and REPORT, plus
  Risk), each with its own notes, and no page-cap attribute on the client or
  any sub-client. The replay now yields on every request so runs interleave.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…d caller flags (R1)

BRIEFS-R1-R2-R3-PYEGERIA-STRUCTURED-TABLE-2026-11-11, R1, on fix-now (289f9e6):

- Native layer: populate_common_columns records each column's native value
  beside its text: related elements as {guid, qualifiedName, displayName,
  name?, type} (related_ref), classifications as {name, properties?}, zones
  as a list. The legacy strings come from that layer through one function,
  _legacy_text (qualifiedName first, unnamed related elements left out, as
  before).
- exec_report_spec(..., output_format="TABLE", table_shape="structured") and
  the async twin return kind "table" (pyegeria/view/structured_table.py):
  columns with an inferred type (scalar/text/list/map/elements/table) and a
  default render, native rows keyed by column key, total/shown, notes. A
  capped query has total None and the "more may exist" note; a mixed column
  takes the widest type with a note; a third level becomes {count, names,
  guid?} with a note. Reuses the already-selected spec struct; DOCUMENT,
  chart and analytic paths are unchanged and ignore the flag.
- dict_shape="native" on exec_report_spec / generate_output / the async twin:
  native DICT rows (no format=True stringification). TABLE stays flat under
  dict_shape. A contextvar carries the shape into find methods that render
  through their own generator. Unknown values are refused in words.
- Gate: all 31 default outputs on the 5 CDO fixtures are byte-identical to
  the fix-now head (scripts/golden_report_outputs.py; "created at" minute
  stamp normalised).
- Docs: "Structured tables and native rows"; release-note lines.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…basis (R1 follow-up)

Read-back of R1 (f75d977) and the F7 rulings:

- An empty relationship cell in the structured TABLE and native DICT now
  says what it means. The request record (graph depth and relationship
  filters sent, from the per-call list-request record) decides: requested
  (depth >= 1, not excluded by includeOnly/skip filters) -> an explicit []
  and the note "<column>: none on N rows (read at graph depth D)"; not
  requested -> None and "not read (...)"; unknowable -> "not established".
  Flat DICT and text outputs are unchanged (golden identical).
- Which columns are relationships, and their relationship types: Egeria's
  own element classes (AttributedMetadataElement, OpenMetadataRootElement,
  egeria ebafb08fdc), generated into pyegeria/view/egeria_relationship_fields.py
  (285 fields); the members -> collectionMembers alias applies.
- N1: the structured result carries total_basis "one page" (a short page is
  not promised to be the last); total stays None when the page was full.
  No "of M": no exact count of the same query is available yet.
- Docs and release-note lines.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
AUDIT-NATIVE-DICT-CONSUMERS-2026-11-11, on R1 (f75d977):

- pyegeria.view.output_formatter.value_names(): the names a DICT cell holds,
  native list or flat string alike (a "[text](#guid)" link wrap unwrapped,
  never iterated by character).
- Shop for Data: build_catalog_details (break 1, Member Of .split),
  build_root_collection_details via _fetch_one (break 2, Containing Members,
  incl. the latent link-wrap split), build_domain_details (break 5, one leaf
  per character) and the Glossaries Folders watch item read with
  value_names; the BusinessCapabilities, Digital-Product-Catalog and
  _fetch_one calls ask for dict_shape="native".
- my_reports TUI (break 3): a list is one joined cell (+N more past 10), a
  dict is JSON in one cell; neither becomes extra columns (tui_cell).
- Data Products demo (break 4): no .split on a value that can be a list.
- Tests: native vs flat give the same names on real fixtures; the
  character-per-leaf and link-wrap regressions; the call sites ask for
  native (AST); the TUI through display_response with a recording table.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
… Egeria-held specs (R2)

BRIEFS-R1-R2-R3-PYEGERIA-STRUCTURED-TABLE-2026-11-11, R2, on R4 (dd0c289):

- Column gains render (text|join|bullets|kv|subtable|count|link),
  max_items and max_lines (>= 1; effective defaults 10 and 3) and label
  (qualified_name|display_name). subtable without detail_spec is allowed.
  DocumentSpec/Format.document are untouched.
- microflow carries all four in the column item, as detail_spec and
  valid_values are; Column.label travels as `related_label` because an item's
  `label` is the column's title. The JSON schema documents the new keys (and
  SD-2's formatter `document`). A held spec with a bad value is _Skip with
  "the spec does not load: ..." (SD-2 N2 path).
- label applies to related-element text: display_name opts a column in;
  qualifiedName stays the default (F7 read-back). Digital-Products opts in
  on Product Manager and License (both format rows; seed rebuilt).
- Structured TABLE defaults follow the inferred type; a related-element
  column with a cell longer than max_items defaults to count.
- Golden: only the five Digital-Products outputs change (the two labelled
  columns), regenerated deliberately; every other default output is
  byte-identical.
- Docs and release-note lines.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ed table (R3)

BRIEFS-R1-R2-R3-PYEGERIA-STRUCTURED-TABLE-2026-11-11, R3, on R2 (07a6542):

- LIST markdown cells are drawn from each column's native value by its
  render intent (markdown_cell_from_native): bullets one per line (a<br>b,
  "+N more" past max_items), join "a, b (+N more: c, d)" in the column's
  label, kv "k: v<br>...", count the number; every piece cell-escaped (|,
  newlines as <br>). format=True and detail_spec columns render as before;
  markdown documents (REPORT, LIST) do not clamp. REPORT is unchanged
  (lists are already markdown lists; detail_spec sub-reports follow rows).
- run_report CLI: --output-format TABLE asks for table_shape="structured"
  and draws it with Rich (render_structured_table): bullets one per line,
  kv as a nested grid, long text cut at max_lines with "…", each subtable
  as a separate table after the main one titled "<row name> · <column>"
  (owner §7.3) with the cell "N items · see below", columns that do not fit
  dropped from the end of the author's order and named in a footer, and
  the cap/notes after. list_generic keeps flat rows by default (the Textual
  TUI and hey_egeria commands read them); _flatten/_collect_columns stay
  for that path.
- Golden: only the Risk, Governance Metric and Ninety Day Plan LIST outputs
  change (their list columns are now bullets), regenerated deliberately;
  every other default output is byte-identical.
- Docs and release-note lines.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…rendered-text behaviour change (R2 n1)

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…the relationship-map regeneration script

Read-back nits on the rebased stack: recording_list_requests() says it keeps
the last list request of a call; egeria_relationship_fields.py names its
generator, scripts/gen_egeria_relationship_fields.py (added; regenerates the
285-entry map byte-for-byte from egeria ebafb08fdc).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
- version 6.2.37 (pyproject, uv.lock); 6.2.37 is not on PyPI.
- docs/release-notes/6.2.37.md finalized: SD-1 (DOCUMENT output, validators),
  SD-2 (DCAT Catalog), R1 (structured TABLE, native DICT), R2 (Column render,
  max_items, max_lines, label), R3 (CLI renderer), R4 (My Egeria and the TUI on
  native DICT), the fixes (Members alias, F8 notes, paging params), the
  rendered-text behaviour change (F1-F10, Digital-Products display names, R3
  LIST cells), dependencies and wheel size.
- Wheel sanity in a clean 3.13 venv: dcat-ap-3 shapes packaged, a DOCUMENT runs
  end to end through dcat-ap-3-shacl, my_egeria installs top-level,
  serve_my_profile is on PATH.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit becdacf into odpi:main Nov 11, 2026
6 checks passed
dwolfson added a commit to odpi/egeria-trellis that referenced this pull request Nov 18, 2026
pyegeria 6.2.37 (odpi/egeria-python#589): DOCUMENT output and DCAT
export, structured tables (table_shape) and native DICT (dict_shape),
both opt-in, Column render/max_lines/label, and the report-spec
rendering fixes. The lock moves pyegeria and adds SD-1's validator
dependencies (rdflib, pyshacl, owlrl, html5rdf).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
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