Ruled: column groups = Annotation Pages, ordered @list lines, next/previous chain; layers = Collections

Ouverte
#326 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
8/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
node.js
Domaine
api, backend

Piste de recherche

This is a data-model ruling, not an edit: read classes/Column/Column.js (createNewColumn and updatePrevAndNextColumns) and the ordering calls in page/index.js, then compare them with sortAnnotations() in components/annotorious-annotator/line-parser.js and the concatenation in utilities/columnOrdering.js. The open work is assessing conformance of the datastore and TPEN-services to the maintainer's ruling (Annotation Pages as column groups, ordered @list lines, next/previous chain, purpose Collections). Done means the ruling is recorded and the two competing order sources are reconciled in writing.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement ready-for-human

This was generated by AI during triage.

Superseded on 2026-11-23. The three options enumerated below — IIIF Ranges, partOf, or a documented ordering convention — were replaced by the maintainer's ruling, quoted here exactly as given:

column groups are all Annotation Pages, lines are in ordered @list arrays within. Pages have next and previous properties for internal ordering and each purpose is a layer of transcription as an Annotation Collection that has a count, first, and last Page reference.

Conformance of the datastore (and of TPEN-services, where these shapes actually live today) is assessed in the latest comment on this issue. The original text below is preserved verbatim and unedited.


This was generated by AI during triage.

The question

How does TPEN 3.0 express grouping and reading order for transcription lines — and which system owns it? One ruling is requested. It is a data-model decision, not code, and it currently blocks three interface issues plus a server parse API.

Filed by the TPEN 3.0 restart triage. The maintainer's Section 5 ruling (2026-11-23) on TPEN-interfaces #579 was "group and amend": #579, #583 and #573 are to be decided together as one RERUM data-model ruling — "IIIF Ranges vs partOf vs a documented ordering convention". This ticket is that ruling.

The requirement, from the consumer issues

TPEN-interfaces #579 "Organize Grouping Structures within a Canvas" (2015, transferred from TPEN3#4):

"Group and order lines within a column (currently just xMin,yMin to xMax,yMax) and order columns on the page. It may be possible or pleasant to allow infinite recursion with this so the group is just a sc:Range-like structure to organize an ordered list of annotations or other lists. Each of these should also have their own label."

Its triage scope note (2026) narrows this to the data model: flat column management is already built; what remains is "nested/grouping structures WITHIN a canvas (sub-groups of lines, joined groups)". One sub-question was already settled on that issue and should not be re-opened — only given a home for the data: cubap proposed default group labels from a user-chosen character incremented per group ("a char that becomes char+1 so that the default is "A" then "B" then "C"", with an optional prefix such as "Column " / "Stanza "), and AmAntiquarian agreed ("Yes, I like the idea suggested in Comment 2.").

TPEN-interfaces #583 "Support Zones for Image Parsing" (2015, transferred from TPEN3#12):

"Use the natural reading angle and sc:Zone support the designation of transcription areas within a canvas. These regions can be rotated and analyzed for lines and columns specifically."

Use cases named on the issue: scrolls, large-format documents with several areas of interest, pages with large margins and gutters, loosely cropped canvases, complex rotations or foldouts, and complex documents with several hands. Restated on the issue itself to Presentation 3.x terms: "restate the requirement as canvas Ranges + FragmentSelectors (svg:xywh coordinate regions) for zone-based image parsing. The underlying need — parsing labeled sub-regions (columns, margins, interlinear bands) of an image — is unchanged."

TPEN-interfaces #573 (marginalia / interlinear / layered, grant promise 2) needs the same answer: interlinear and marginal lines must be ordered relative to a base text and anchored to canvas regions.

What exists today (verified 2026-11-23, read-only, TPEN-interfaces @ 8742e4a83; TPEN-services main via API)

1. TPEN already has a persisted grouping/order container — flat, one level deep, and it lives in TPEN-services, not in the annotation store.

  • classes/Column/Column.js:10 — a first-class Column object in its own collection (process.env.TPENCOLUMNS, load/save/update/delete at :43/:64/:81/:95).
  • Column.createNewColumn(pageId, projectId, label, annotations = []) :112 produces { label, next: null, prev: null, lines: annotations } :134-139; an absent label defaults to Column ${_id} :117.
  • Order is an explicit linked list: updatePrevAndNextColumns() rewrites columnData.prev / columnData.next from the page's array position (page/index.js:242-250, :249/:250). Line replacement and pruning maintain the containers (page/index.js:157-204), and an emptied column is deleted and dropped from the page (:181-183).
  • The page mirrors { id, label, lines } on the project document, and the UI drives it through PUT ${TPEN.servicesURL}/project/{projectID}/page/{annotationPageID}/column with { newLabel, columnLabelsToMerge } — i.e. merging two labelled groups is already a server operation (interfaces/manage-columns/index.js:723-732; local mirror at :493-512).

2. But the interface keeps a second, competing source of order. Line regions are Web Annotation targets xywh=pixel:x,y,w,h (parsed at components/annotorious-annotator/line-parser.js:1065-1066), and the annotator sorts those by geometry on every load: sortAnnotations() :1055-1073, whose own doc comment says "The order of these Annotations is not guaranteed… Generally, this mocks a column design" (:1056-1057), repeated at :1540-1542 where a temporary reorder "does not persist or change the order in Annotorious". Only one call site consults the container: utilities/columnOrdering.js:12-34 concatenates columns[].lines (used by components/transcription-canvas-panel/index.js:8), and any line not in a column is appended as a synthetic { id: "unordered-lines", label: "Unordered Lines" } bucket (:18-24).

Consequence: for the same page, order can be computed two different ways — geometry in the annotation store, or ID lists in the services store — and nothing declares which is authoritative. Recursive grouping cannot be built on that, and neither can #583's zones: the Column document carries no region/geometry field at all (Column.js:134-139), while detect-lines.js parses the whole image with no region parameter (detectColumns(…) :34, detectLinesInColumn(…) :105, detectTextLinesCombined(url, expandY = true) :170).

3. Orientation is not modelled either. No rotation/flip exists in the current viewer (every rotate() in the repo is a CSS chevron or spinner; detect-lines.js and line-image/index.js contain no rotation code), so #583's "rotated and analyzed" and "complex rotations or foldouts" clauses ask for a capability that has neither UI nor data representation.

The three candidate models (choose one, or reject all three with a stated alternative)

  1. IIIF Presentation 3.x Range tree in the project manifest; lines/columns/groups become Ranges whose items point at canvas segments.
    Consequence for existing data: containers must be projected into structures per project; annotations keep their xywh=pixel: targets so nothing is destroyed; but every consumer (TinyPen line lookup, static export, third-party viewers) must read structures to get order, and Ranges must be maintained on create/delete/reorder/merge. Most interoperable; most new machinery; the existing Column collection becomes an internal cache at best.
  2. partOf chains among Web Annotation containers in the annotation store (each line's partOf points at a group annotation; groups may themselves be partOf other groups).
    Consequence: order and nesting travel with the annotations in RERUM/TinyNode, one store instead of two, and containers can be minted in place from data the client already has — but it requires RERUM/TinyNode to accept and serve partOf faithfully on write and read, and the services-side Column objects must be migrated or retired.
  3. Generalize and document the existing container (the services Column object: add nesting, add an optional region, keep label, and publish array position / prev–next as the normative order).
    Consequence: zero migration — the structure, the labels, the merge endpoint and the UI already exist — and it is the cheapest path to #579's recursion and #583's labelled regions. The cost is that it is TPEN-private vocabulary: it is not IIIF and not Web Annotation, so workstream 1 (IIIF-native, versioned linked open data) and workstream 3 (external workflows, aggregation) keep depending on a TPEN-specific API rather than on standards a third party can read. It also only works if the geometry sort in sortAnnotations() is explicitly demoted.

What the ruling must state

  1. Which model is normative, and which store owns it (RERUM/TinyNode annotations, or the TPEN-services project document, or the manifest).
  2. Which order source wins, and what happens to the losing one (sortAnnotations() vs columns[].lines).
  3. How a line is inserted between two others, and how a group is nested inside a group (#579).
  4. Whether a container may carry a canvas region, in what syntax (#583), and whether groups must be labelable (today a label is auto-supplied when omitted and an empty or non-string label is rejected, Column.js:116-126).
  5. How a canvas segment is addressed publicly, and who may read it (this decides the parse-API companion being filed in TPEN-services from the same ruling).
  6. The migration rule for data already in the TPENCOLUMNS collection and in project page documents.
  7. Whether the project manifest must carry a structures block for static export (TPEN-static) and for collection-level aggregation.

Not this ticket's job

The rendering, editing and import/export behaviour that consumes the ruling (rotated zones, a column-creation dialog, RTL presentation, marginalia placement, TEI round-trips). Those live in the consumer issues listed below. This ticket exists so they all inherit one answer instead of inventing three.

Consumers blocked on this ruling

  • CenterForDigitalHumanities/TPEN-interfaces#573 — marginalia / interlinear / layered (grant promise 2)
  • CenterForDigitalHumanities/TPEN-interfaces#579 — grouping structures within a canvas
  • CenterForDigitalHumanities/TPEN-interfaces#583 — zones as canvas-segment targets
  • The TPEN-services parse-API companion filed from the same ruling (server-side detection over a canvas segment)
  • CenterForDigitalHumanities/TPEN-interfaces — TEI/XML import/export, split from #587 by the same ruling: nested <lg>/<div> and facsimile/zone want exactly this structure

Workstream 1 (Better Data / modern core — RERUM + Web Annotation + IIIF-native, versioned linked open data) feeding workstream 2 (marginalia/interlinear/layered interfaces) and workstream 3 (interoperability / external workflows).

Langage dominant
JavaScript
Étoiles
3
Forks
7
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de CenterForDigitalHumanities/rerum_server_nodejs

Toutes les issues de CenterForDigitalHumanities/rerum_server_nodejs

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.