Skip to content

Construction index renders categories alphabetically, not in the BARD glossary's order #120

Description

@rybesh

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:

  1. 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)
      ...
    }
  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).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions