Link NeTEx declarations to Transmodel 6.2 concepts #2

Merged
moof merged 0 commits from refs/pull/2/head into main 2026-10-21 00:21:41 +00:00
moof commented 2026-10-21 00:10:26 +00:00 (Migrated from code.moof.space)

Requested by Moof · project thread

What

Adds a --transmodel option that links NeTEx elements and types to the Transmodel 6.2 concept they implement, on https://transmodel-cen.eu/model6.2/. A "Transmodel concept STOP PLACE ↗" line appears under the heading of each matching page.

How it matches

  • NeTEx CamelCase names become Transmodel names: StopPlace → STOP PLACE, TypeOfLine → TYPE OF LINE.
  • Types match after their structure suffix is removed (_VersionStructure, _ValueStructure, _VersionedChildStructure, …), and …View elements match the concept they view.
  • A short alias list covers names NeTEx spells differently (Timeband → TIME BAND, TrainElement → TRAIN ELEMENT TYPE, …).
  • Only declarations in the NeTEx namespace are linked by default, so GML/SIRI names like Point are left alone. --transmodel-namespace overrides this.

Catalog

src/prettyxsd/data/transmodel-6.2.json (93 KB) maps the 1,503 Transmodel 6.2 classes and enumerations to their pages. It was built by the new scripts/update_transmodel_catalog.py, which reads the Enterprise Architect export's index and fetches every page title (the site needs a browser-like User-Agent). The site build itself stays offline.

Result on NeTEx NX.xsd

1,433 pages linked (728 elements, 705 types), covering 716 distinct Transmodel concepts.

Also

  • Version bumped to 0.8.0 (0.7.0 was released from #1) so the publish workflow ships a new package.
  • NeTEx-docs needs --transmodel added to its prettyxsd calls to turn this on.

Tests

uv run python -m unittest discover -s tests: 42 tests pass, including three new ones for name matching, namespace scoping and the rendered link.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AmFvj38A6ceghEnxPGvprJ

<!-- claude-projects-attribution --> _Requested by **Moof** · [project thread](https://claude.ai/code/project/chan_01BmPQxcG1UuS21Gfai9Zcdh?thread=cmsg_01BmPQxcG1UuS21Gfai9ZcdhCwVSYkTqHErZYyHGU73Pki)_ ## What Adds a `--transmodel` option that links NeTEx elements and types to the Transmodel 6.2 concept they implement, on https://transmodel-cen.eu/model6.2/. A "Transmodel concept STOP PLACE ↗" line appears under the heading of each matching page. ## How it matches - NeTEx CamelCase names become Transmodel names: `StopPlace` → STOP PLACE, `TypeOfLine` → TYPE OF LINE. - Types match after their structure suffix is removed (`_VersionStructure`, `_ValueStructure`, `_VersionedChildStructure`, …), and `…View` elements match the concept they view. - A short alias list covers names NeTEx spells differently (`Timeband` → TIME BAND, `TrainElement` → TRAIN ELEMENT TYPE, …). - Only declarations in the NeTEx namespace are linked by default, so GML/SIRI names like `Point` are left alone. `--transmodel-namespace` overrides this. ## Catalog `src/prettyxsd/data/transmodel-6.2.json` (93 KB) maps the 1,503 Transmodel 6.2 classes and enumerations to their pages. It was built by the new `scripts/update_transmodel_catalog.py`, which reads the Enterprise Architect export's index and fetches every page title (the site needs a browser-like User-Agent). The site build itself stays offline. ## Result on NeTEx `NX.xsd` 1,433 pages linked (728 elements, 705 types), covering 716 distinct Transmodel concepts. ## Also - Version bumped to 0.8.0 (0.7.0 was released from #1) so the publish workflow ships a new package. - NeTEx-docs needs `--transmodel` added to its prettyxsd calls to turn this on. ## Tests `uv run python -m unittest discover -s tests`: 42 tests pass, including three new ones for name matching, namespace scoping and the rendered link. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01AmFvj38A6ceghEnxPGvprJ
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
Reference4PT/prettyxsd!2
No description provided.