UTC02:22:32
LAUSANNE03:22:32
46.5196°N 6.6322°E

Case // 06

Stemmaweb and Stemmarest

A textual criticism platform brought back to life, then taught to export TEI P5.

All projects

Illustration: how readings grouped into overlapping hypernodes become a nested TEI P5 apparatus.

Fact sheet

Stemmaweb is open-source software that philologists use to compare the manuscript witnesses of a text and reconstruct its genealogy, the stemma. When I joined the ENLAC project, the code base no longer built or deployed. I restored the Docker build and the collation pipeline, fixed the exports, added TEI P5 and PDF exports, and carried out a feasibility study and first implementation of a critical apparatus generated from overlapping hypernodes in the graph database.

Context
University of Lausanne (UNIL), ENLAC project, IRSB
Role
Developer: build recovery, exports and a TEI P5 research prototype
Team
Research software team and philologists
Period
2024
Status
In production
  • 3components rebuilt and running together
  • 2new TEI export formats in the download dialog
  • TEI P5critical apparatus prototype from overlapping hypernodes

Challenge

01

Stemmaweb (Perl, Catalyst) and its back end Stemmarest (Java, Neo4j) came from earlier academic projects and had stopped working: the images no longer built, the collation pipeline was broken and several exports failed. The team also needed its editions in TEI P5, the XML standard of digital scholarly editing, including the critical apparatus that records each witness's variant readings.

Approach

02

I first made the system reproducible: dependencies, Dockerfiles and configuration fixed until Stemmaweb, Stemmarest and the CollateX collation pipeline came up together under Docker Compose. I then repaired the existing exports and added new ones, the tradition in TEI P5 and its conversion to PDF, so editors can publish what they build in the graph. Finally I studied whether a critical apparatus could be generated from hypernodes, groups of readings that may overlap in the variant graph, and wrote a first implementation that resolves those overlaps into nested TEI P5 apparatus entries.

Outcome

03

A platform the team can build, deploy and run again, distributed as Docker images, and editors who can export their work in TEI P5 and PDF. The feasibility study showed how overlapping groups of readings stored in Neo4j can become valid nested XML, and gave the project a first working path toward a full critical edition export.

Architecture

SCHEMA
Stemmaweb and Stemmarest: ArchitectureDocker Compose stack, restoredSourcesCollationBack endInterfaceTEI transcriptionsManuscript witnesses, TEIencodedxml2stemmarestNormalise, tokenise,uploadCollateX 1.7Aligns readings betweenwitnessesStemmarest (Java)Jersey REST API on Tomcat9Neo4j 5 + APOCVariant graph andhypernodesStemmaweb (Perl)Catalyst app, jQuery andSVGTEI P5 · PDF exportCritical apparatus, PDFimportREST
Transcriptions are collated once; Stemmarest keeps the variant graph in Neo4j and Stemmaweb reads it over REST. The dashed area is the Docker Compose stack I brought back to life, and the highlighted node is the export work I added.
Sources
TEI transcriptionsManuscript witnesses, TEI encoded
Collation
xml2stemmarestNormalise, tokenise, upload
CollateX 1.7Aligns readings between witnesses
Back end
Stemmarest (Java)Jersey REST API on Tomcat 9
Neo4j 5 + APOCVariant graph and hypernodes
Interface
Stemmaweb (Perl)Catalyst app, jQuery and SVG
TEI P5 · PDF exportCritical apparatus, PDF

Swipe sideways to explore the diagram

Work breakdown

WBS

The work, split into the workstreams it actually took.

  1. 01

    Diagnose an inherited code base

    Mapped a three-part system I had not written: a Perl Catalyst web app, a Java REST service on Neo4j, and a Bash and Python collation pipeline. Found why each part no longer built.

  2. 02

    Restore the builds

    Fixed dependencies, Dockerfiles and configuration until every component built again from source and could be published as a container image.

  3. 03

    Repair the pipeline

    Brought TEI XML transcriptions back through CollateX into Stemmarest, and the whole stack up together with Docker Compose.

  4. 04

    Fix the exports

    Repaired the existing download formats so editors receive complete files again.

  5. 05

    Add TEI P5 and PDF exports

    New exports for textual criticism and the genealogy of the text: the tradition and its critical apparatus in TEI P5 XML, and conversion to PDF.

  6. 06

    Feasibility study: overlapping hypernodes

    Analysed how groups of readings that overlap in the graph can become an XML apparatus, a structure that by nature does not allow overlap.

  7. 07

    First implementation

    A first working export that resolves those overlaps into nested TEI P5 app, lem and rdg entries, as a base for the full critical edition export.

What I did

  • Recovered a non-working Perl, Java and Neo4j code base to a reproducible Docker build
  • Repaired the collation pipeline: TEI XML transcriptions, CollateX alignment, import into Stemmarest
  • Fixed broken exports and added two TEI export formats to the Stemmaweb download dialog
  • Exports for textual criticism and text genealogy in TEI P5, with conversion to PDF
  • Feasibility study and first implementation: overlapping hypernodes resolved into a nested TEI P5 apparatus

Stack

Front end
  • JavaScript
  • jQuery
  • SVG
  • Graphviz
Back end
  • Perl
  • Catalyst
  • Template Toolkit
  • Java 17
  • Jersey (JAX-RS)
  • Tomcat 9
Data
  • Neo4j 5
  • APOC
  • TEI P5 XML
Pipeline
  • CollateX
  • Bash
  • Python
Infrastructure
  • Docker
  • Docker Compose
  • Docker Hub

Public references

REF

The code and the container images are public.

Related services

Need something similar? These are the services this project demonstrates.

Get in touch