The construction index (/construction.html) renders its category sections in alphabetical order:
Enclosure · Genre/Form · Materials · Process/Technique · Structure/Physical Format
The Book Arts Research Database glossary we follow (docs/bard-glossary.pdf) sequences them differently, and that sequence is meaningful — it runs from what a book is made of through how it is made to what it ends up as:
Materials · Process/Technique · Hand Papermaking Traditions ·
Structure/Physical Format · Enclosure · Genre/Form
Our alphabetical rendering is an accident of ORDER BY ?categoryLabel in web/queries/construction-methods.rq:52, not a decision. It puts Enclosure first and buries Materials in the middle.
Why this isn't a one-line fix
The category label is the only thing the web query knows about a category, so there's nothing to sort on but its text. Fixing it means carrying an explicit rank from the place the categories are actually defined — the VALUES block in sources/construction/build-scheme.rq — through the graph and into the query.
Sketch:
- Add an ordinal to the
VALUES block alongside the slug and label:
VALUES (?category ?catSlug ?catLabel ?catRank) {
("material" "material" "Materials"@en 1)
("process-technique" "process-technique" "Process/Technique"@en 2)
...
}
- Emit it on the category top concept, e.g.
ab:categoryRank ?catRank (new property — would also want adding to docs/vocab.ttl, which is already noted as needing a normalization pass in CLAUDE.md).
web/queries/construction-methods.rq selects it and orders ?catRank LCASE(?label) instead of ?categoryLabel LCASE(?label).
The template needs no change — since #117 it opens a new section whenever ?categoryLabel changes, so it follows whatever order the query returns.
Notes
sources/subjects/ has the same shape (a VALUES block of categories, an index grouped by label), so whatever we land here probably wants mirroring there.
hand-papermaking-traditions currently has no rows, so it emits no top concept and won't appear until it does — the ordinal should still be reserved for it.
- Purely presentational; nothing about the concepts or their
skos:broader links changes.
Context: came out of the review on #117, where the categories moved to the BARD vocabulary and the index sections became data-driven.
The construction index (
/construction.html) renders its category sections in alphabetical order:The Book Arts Research Database glossary we follow (
docs/bard-glossary.pdf) sequences them differently, and that sequence is meaningful — it runs from what a book is made of through how it is made to what it ends up as:Our alphabetical rendering is an accident of
ORDER BY ?categoryLabelinweb/queries/construction-methods.rq:52, not a decision. It puts Enclosure first and buries Materials in the middle.Why this isn't a one-line fix
The category label is the only thing the web query knows about a category, so there's nothing to sort on but its text. Fixing it means carrying an explicit rank from the place the categories are actually defined — the
VALUESblock insources/construction/build-scheme.rq— through the graph and into the query.Sketch:
VALUESblock alongside the slug and label:ab:categoryRank ?catRank(new property — would also want adding todocs/vocab.ttl, which is already noted as needing a normalization pass in CLAUDE.md).web/queries/construction-methods.rqselects it and orders?catRank LCASE(?label)instead of?categoryLabel LCASE(?label).The template needs no change — since #117 it opens a new section whenever
?categoryLabelchanges, so it follows whatever order the query returns.Notes
sources/subjects/has the same shape (aVALUESblock of categories, an index grouped by label), so whatever we land here probably wants mirroring there.hand-papermaking-traditionscurrently has no rows, so it emits no top concept and won't appear until it does — the ordinal should still be reserved for it.skos:broaderlinks changes.Context: came out of the review on #117, where the categories moved to the BARD vocabulary and the index sections became data-driven.