Publish the Transmodel model as pages of the site (0.14.0) #9

Merged
moof merged 0 commits from refs/pull/9/head into main 2026-10-21 15:05:03 +00:00
moof commented 2026-10-21 09:42:36 +00:00 (Migrated from code.moof.space)

Requested by Moof · project thread

Adds --transmodel-pages, which publishes the Transmodel 6.2 UML model as a transmodel/ section of the site.

What readers get

  • Index (transmodel/index.html): the model's packages as a collapsible tree, with each package's diagrams and classes. A "Transmodel 6.2 model" link sits at the top of the sidebar.
  • Class pages (1,633): definition, attributes (type, multiplicity, definition), supertypes and subtypes, associations with roles and multiplicities, the diagrams the class appears on, the NeTEx elements and types that implement it ("In NeTEx"), and a Graphviz drawing of its neighbourhood. In that drawing every class, attribute row and relationship is a link.
  • Diagram pages (1,000 with classes): 699 are laid out by Graphviz from the diagram's classes and the relationships between them. The 301 with more than 20 classes or 30 relationships show EA's own image from transmodel-cen.eu, with its image map pointed at the local pages.
  • Transmodel links on element and type pages, and concept names in documentation, now go to these pages instead of transmodel-cen.eu. --transmodel without --transmodel-pages behaves as before.

How it works

  • scripts/update_transmodel_model.py reads the EA XMI export, and the HTML export's index for each object's page, into data/transmodel-6.2-model.json.gz (759 KB). It also draws every neighbourhood and small diagram with Graphviz into data/transmodel-6.2-diagrams.json.gz (5.5 MB). Links in the SVGs are tm:<GUID> and are resolved at generation, so builds need neither Graphviz nor the network.
  • In a neighbourhood drawing, associated classes alternate above and below the class across two rows each, so busy classes like STOP PLACE stay about 1,800 px wide instead of 2,400 px or more. Only the far end of each association is labelled; the table lists both.
  • Definitions keep EA's simple markup (bold, lists, links) and drop the rest (mostly <font>). Capitalised concept names in them are linked.

Checks

  • uv run pytest: 59 passed, including a new tests/test_transmodel_pages.py.
  • A local build of the nx and netex-publication variants with --transmodel-pages took 21 s. The transmodel/ section is 63 MB, and the 128,736 internal links checked from Transmodel pages and 400 element pages have no broken targets.
  • The drawings here were made with Graphviz 12 compiled to WebAssembly (@viz-js/viz), because the container had no system Graphviz. A rebuild with native dot should give the same layout.

Notes

  • 0.14.0, because the open #8 takes 0.13.0. #8 also touches cli.py and render.py, so whichever merges second will need a small rebase.
  • The Transmodel content is CEN's. Every Transmodel page carries an attribution line, and large diagrams load their images from transmodel-cen.eu rather than copying them.

🤖 Generated with Claude Code

https://claude.ai/code/session_019EUw76i961mxumC6sVRdBV

<!-- claude-projects-attribution --> _Requested by **Moof** · [project thread](https://claude.ai/code/project/chan_01BmPQxcG1UuS21Gfai9Zcdh?thread=cmsg_01BmPQxcG1UuS21Gfai9ZcdhSAMdDbSmRt4P2BBhadPt1K)_ Adds `--transmodel-pages`, which publishes the Transmodel 6.2 UML model as a `transmodel/` section of the site. ## What readers get - **Index** (`transmodel/index.html`): the model's packages as a collapsible tree, with each package's diagrams and classes. A "Transmodel 6.2 model" link sits at the top of the sidebar. - **Class pages** (1,633): definition, attributes (type, multiplicity, definition), supertypes and subtypes, associations with roles and multiplicities, the diagrams the class appears on, the NeTEx elements and types that implement it ("In NeTEx"), and a Graphviz drawing of its neighbourhood. In that drawing every class, attribute row and relationship is a link. - **Diagram pages** (1,000 with classes): 699 are laid out by Graphviz from the diagram's classes and the relationships between them. The 301 with more than 20 classes or 30 relationships show EA's own image from transmodel-cen.eu, with its image map pointed at the local pages. - Transmodel links on element and type pages, and concept names in documentation, now go to these pages instead of transmodel-cen.eu. `--transmodel` without `--transmodel-pages` behaves as before. ## How it works - `scripts/update_transmodel_model.py` reads the [EA XMI export](https://transmodel-cen.eu/model6.2/Transmodel2024-EA_extract_for_publication.xml), and the HTML export's index for each object's page, into `data/transmodel-6.2-model.json.gz` (759 KB). It also draws every neighbourhood and small diagram with Graphviz into `data/transmodel-6.2-diagrams.json.gz` (5.5 MB). Links in the SVGs are `tm:<GUID>` and are resolved at generation, so builds need neither Graphviz nor the network. - In a neighbourhood drawing, associated classes alternate above and below the class across two rows each, so busy classes like STOP PLACE stay about 1,800 px wide instead of 2,400 px or more. Only the far end of each association is labelled; the table lists both. - Definitions keep EA's simple markup (bold, lists, links) and drop the rest (mostly `<font>`). Capitalised concept names in them are linked. ## Checks - `uv run pytest`: 59 passed, including a new `tests/test_transmodel_pages.py`. - A local build of the `nx` and `netex-publication` variants with `--transmodel-pages` took 21 s. The `transmodel/` section is 63 MB, and the 128,736 internal links checked from Transmodel pages and 400 element pages have no broken targets. - The drawings here were made with Graphviz 12 compiled to WebAssembly (`@viz-js/viz`), because the container had no system Graphviz. A rebuild with native `dot` should give the same layout. ## Notes - 0.14.0, because the open #8 takes 0.13.0. #8 also touches `cli.py` and `render.py`, so whichever merges second will need a small rebase. - The Transmodel content is CEN's. Every Transmodel page carries an attribution line, and large diagrams load their images from transmodel-cen.eu rather than copying them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_019EUw76i961mxumC6sVRdBV
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transmodel/prettyxsd!9
No description provided.