Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions specs/015-graph-exports/contracts/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Each check is shown failing on wrong output before it is trusted (constitution I

## SBML comparison (FR-002, FR-003)

A tool (`tools/exports-compare/sbml-compare.ts`) that compares an exporter's SBML with a reference file, wherever the file came from: the exporter's own run, or the website's answer.
`sbml-exporter`'s `ci/compare.py` (its spec 001, T016), which compares two folders of SBML, wherever the files came from: the exporter's own run, or the website's answer. It replaces the tool this spec first planned here.

- **The model:** byte for byte, after removing the generation note's timestamp. What the layout changes in the model (the drawn species' SBO terms, the root's `layout:required` and layout namespace; FR-002) is compared with the layout, not here. The reference is the corrected graph-only converter's file (research R1).
- **The model:** element by element with today's relational file of the same release: compartments, species, reactions, reactants, products and modifiers (role, stoichiometry), names, SBO terms, notes, annotations and identifier URLs. Set aside: the generation note's timestamp, element order (today's is HashSet order; elements are matched by id) and the layout, compared below.
- **The layout:** the glyph sets, ids, roles, order and targets exactly, compared with today's file. Coordinates are compared by meaning: today's equal the diagram's plus one offset, except at the nodes Java resized, which are listed.
- **Inputs:** the 30-event sample (pathways of several sizes, reactions, disease and inferred events), drawn once from a private graph of the same release (research R8).
- **Output:** each difference, by element path. Personal values (vCard names) appear as hashes.
- **Shown failing:** on a file with a species reference removed, a sboTerm changed, and a glyph moved.
- **Shown failing:** on a file with a species reference removed, a sboTerm changed, and a glyph moved (the glyph once the layout is compared, its T021).

## BioPAX comparison (FR-005, FR-009)

Expand Down
7 changes: 1 addition & 6 deletions specs/015-graph-exports/contracts/differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

Each way the new exports differ from their reference, with the reason. An export switches only when every difference its sample shows is here. Additions found during the work are recorded with the pull request that finds them.

## SBML, from the corrected graph-only reference

| Difference | Reason |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| The four defects of the graph-only converter are corrected, in the harness ([reference-harness.md](../reference-harness.md)) (one reactant and one product per reaction; catalysts and negative regulators filled from the positive regulators; positive regulators never written) | The reference is the corrected converter; the uncorrected one would lose participants that today's file has (research R1) |
| The generation note's timestamp | It differs on every answer, today too |
SBML's model is compared with today's relational file of the same release (decided 24 Oct 2026; there is no separate corrected-converter reference any more). The one list for SBML is `sbml-exporter`'s [`specs/001-graph-only-sbml/differences.md`](https://github.com/reactome/sbml-exporter/blob/graph-only/specs/001-graph-only-sbml/differences.md), which its T016 creates; the rows below move there then. The generation note's timestamp is set aside, as it differs on every answer, today's too.

## SBML, from today's relational file

Expand Down
4 changes: 2 additions & 2 deletions specs/015-graph-exports/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ What BioPAX3Exporter must write (spec FR-005), and where each value is in the gr
- **compartments.**
- **BioPAX document**: one per event. RDF/XML. Individuals carry `rdf:ID="{Class}{n}"` and are written in a deterministic order. `xml:base` is `http://www.reactome.org/biopax/{release}/{topDbId}#`.
- **Reference answer**: what each export is compared with:
- SBML's model: the corrected graph-only converter's file, exactly;
- SBML's model: today's relational file of the same release, element by element, order set aside;
- SBML's layout: today's file (structure exactly, coordinates by meaning);
- BioPAX: today's file, canonicalised.
- **Accepted difference**: a way the new output differs from its reference, with the reason, recorded in [contracts/differences.md](contracts/differences.md). An export switches only when every difference found is in that record.
Expand Down Expand Up @@ -53,5 +53,5 @@ The first two are recorded differences.

## Validation rules (from the requirements)

- **SBML:** byte-identical to the reference apart from the layout, the SBO terms the layout sets, the root's `layout:required` and layout namespace, and the generation note (FR-002). The layout has the same glyphs, ids, roles and order as today's (FR-003). libSBML reports 0 errors (FR-008).
- **SBML:** the model matches today's relational file element by element, apart from element order, the generation note's timestamp and recorded differences (FR-002). The layout has the same glyphs, ids, roles and order as today's (FR-003). libSBML reports 0 errors (FR-008).
- **BioPAX:** the canonical triples equal today's, apart from recorded differences (FR-005). The BioPAX validator reports 0 errors (FR-008).
7 changes: 3 additions & 4 deletions specs/015-graph-exports/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Each format gets one implementation, reading the graph, used by both the release
- **The website** gets both from spec 010's Java library service, fronted by node at the URLs R6 decided, with no fallback (R10). That service is spec 010's to build; this spec changes its SBML operation and adds BioPAX.
- **This repository keeps the instruments:**
- the sample;
- the corrected SBML reference;
- today's answers, and the release's published bulk files;
- the comparison tools;
- the validator runs.
Expand Down Expand Up @@ -83,7 +82,7 @@ The changes to the two exporters go to their maintainers: an issue first, then p

**Constraints**:

- byte parity for SBML's model;
- SBML's model matching today's relational file element by element;
- comparison by meaning for SBML's layout and for BioPAX;
- the deep shares;
- no personal data in this repository's fixtures, logs or output;
Expand Down Expand Up @@ -124,7 +123,7 @@ _GATE: Must pass before Phase 0 research. Re-check after Phase 1 design._
- **V. Comments carry the failure.** Every recorded difference states why ([contracts/differences.md](contracts/differences.md)). **Pass.**
- **The repository's working rules** (CLAUDE.md, and keeping `RELEASE-TESTING.md` and `CURATOR-REPORT.md` current):
- **An explicit exception to "byte-identical to Java's answer".**
- The SBML body is compared with the corrected reference and today's layout, by T030.
- The SBML body is compared with today's relational file, model and layout, by `sbml-exporter`'s `ci/compare.py` (T030).
- The BioPAX body has no Java counterpart at its URL, and is compared by T031.
- Status, headers and errors are still compared live with the parity harness.
- **T054 updates the two documents** when the site's links move.
Expand Down Expand Up @@ -177,7 +176,7 @@ projects/…/download-tab/, …/detail-download-bar/ # the BioPAX links
## Order of work

1. **Done:**
- the sample, the corrected SBML reference made from a private graph copy (since removed; T032 recreates it), and today's answers (T001–T004);
- the sample, the SBML reference harness that found the converter's defects, and today's answers (T001–T004);
- the interim BioPAX link (T009, #634);
- the issue drafts (T027);
- the amendments to spec 010 (T043).
Expand Down
6 changes: 3 additions & 3 deletions specs/015-graph-exports/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Each exporter's own CI runs its validator over its output for a small fixture gr

## 3. SBML against the reference

1. Generate the reference files once, for the 30-event sample, with the corrected graph-only converter (research R1). Run it against a private graph database of the same release where possible (research R8). The references stay outside the repository: they hold personal names.
1. Get today's relational files for the 30-event sample from a ContentService of the same release that is not production, one event at a time (research R1). They stay outside the repository: they hold personal names.
2. Run the fixed `sbml-exporter` over each event, from the private graph copy (or, once switched, ask the website).
3. Run the SBML comparison tool over the pairs.
3. Run `sbml-exporter`'s `ci/compare.py` over the two folders.

Expected: the model is identical apart from the generation note and what the layout changes in the model (FR-002). The layout has the same glyphs, ids, roles and order as today's file. The coordinate differences are only those [differences.md](contracts/differences.md) lists.
Expected: the model matches element by element apart from element order, the generation note's timestamp and what the layout changes in the model (FR-002). The layout has the same glyphs, ids, roles and order as today's file. The coordinate differences are only those [differences.md](contracts/differences.md) lists.

## 4. BioPAX against today's file

Expand Down
2 changes: 1 addition & 1 deletion specs/015-graph-exports/research.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Personal data: SBML's History (creators) and BioPAX's citations and curation com

**Decision.**

- **The reference** for FR-002 is the graph-only converter with the four defects corrected (a new `Participant` per row; catalysts read from their own column; positive regulators set; negative regulators set from their own column) and `setUseIdentifierURL(true)`.
- **The reference** for FR-002 was first the graph-only converter with the defects corrected and `setUseIdentifierURL(true)` (the harness, [reference-harness.md](reference-harness.md)). **Changed 24 Oct 2026:** it is today's relational file of the same release, compared element by element, since the files people use are today's and their order (HashSet order) cannot be reproduced. The harness stays as the record of how the defects were found.
- **It is run by a harness** of about 40 lines of Java (a throwaway module, depending on sbml-exporter and graph-core): `findById`, then `SbmlConverter(event, version, ads).convert().toString()`, written as UTF-8. It runs on JDK 11 with UTC, en_US and UTF-8.
- **The fixes are offered upstream**, and recorded as accepted deviations.

Expand Down
12 changes: 6 additions & 6 deletions specs/015-graph-exports/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Each exporter reads the graph and lives in its own repository: `reactome/sbml-ex
What the first version produced is kept and used as the instruments for proving the exporters:

- the 30-event sample ([sample.md](sample.md));
- the corrected SBML reference and its harness ([reference-harness.md](reference-harness.md));
- the SBML reference harness, which found the graph-only converter's defects ([reference-harness.md](reference-harness.md));
- today's answers from the beta host ([today.md](today.md));
- the BioPAX mapping ([data-model.md](data-model.md));
- the comparison and validator decisions ([research.md](research.md) R1, R3–R5, R8).
Expand Down Expand Up @@ -72,19 +72,19 @@ The people served are:

A researcher downloads SBML for one pathway or reaction from the website, or the whole set from the download page. Either way the file comes from the same exporter, reading the graph. It has the same model as today, its species, reactions, compartments, identifiers and annotations, and a layout drawn from the diagram the website shows. Making it needs no relational database.

**Why this priority**: the model has an exact reference (the corrected graph-only converter, already built), and the exporter already has a graph-only half. It is the smaller of the two proofs, and it retires the relational database from both the release's SBML and the website's.
**Why this priority**: the model has a reference to match (today's relational file of the same release), and the exporter already has a graph-only half. It is the smaller of the two proofs, and it retires the relational database from both the release's SBML and the website's.

**Independent Test**:

- **The model.** For the 30-event sample, the exporter's model is byte-identical to the corrected reference, generation note aside.
- **The model.** For the 30-event sample, the exporter's model matches today's relational file element by element, element order and the generation note's timestamp aside.
- **The layout.** It matches today's by meaning (R3).
- **The bulk run.** With no relational database configured, it produces the same set of files under the same names as the release's published archives in its download directory (`download.reactome.org/{release}/`), and a sample of its files compares with theirs.
- **Validity.** Every file passes the SBML consistency check.
- **On the website.** The site's SBML URL answers from the same exporter.

**Acceptance Scenarios**:

1. **Given** a pathway or a reaction, **When** the exporter writes its SBML, **Then** everything but the layout and the generation note is byte-identical to the corrected reference.
1. **Given** a pathway or a reaction, **When** the exporter writes its SBML, **Then** its model matches today's relational file element by element, apart from element order, the generation note's timestamp and recorded differences.
2. **Given** a pathway with its own diagram drawing a reaction, **When** its SBML is written, **Then** the layout places and connects every element today's does, with the same identifiers, roles and order, at the diagram's own coordinates.
3. **Given** a release, **When** the bulk SBML is made with no relational database, **Then** both archives hold the same file names as that release's published archives, and every file is valid.
4. **Given** the website's SBML link, **When** it is followed, **Then** the status, content type, file name and errors are today's, and the file is the exporter's.
Expand Down Expand Up @@ -152,7 +152,7 @@ The people who run a release can make the SBML and BioPAX bulk files without the
**SBML (`reactome/sbml-exporter`)**

- **FR-001**: The graph-only converter MUST be corrected: the five defects (R1, R9) fixed, with tests that fail without each fix. With those fixes it is the SBML model for both the bulk files and the website.
- **FR-002**: Its model MUST be byte-identical to the corrected reference (R1) for every event in the sample, apart from the generation note and what the layout changes in the model: the drawn species' SBO terms, and the root's `layout:required` and layout namespace (R3).
- **FR-002**: Its model MUST match today's relational file of the same release (R1) for every event in the sample, element by element (compartments, species, reactions, participants with role and stoichiometry, names, SBO terms, notes, annotations and identifier URLs), apart from element order, the generation note's timestamp and what the layout changes in the model (the drawn species' SBO terms, and the root's `layout:required` and layout namespace; R3), or each difference recorded with its reason.
- **FR-003**: It MUST write the layout from the diagram files the site draws (R3), for the events that have one today and only those. It MUST place and connect the same elements, with the same identifiers, roles and order, as today's layout. Coordinate differences are recorded and accepted (R3).
- **FR-004**: Its command line MUST make the bulk files with no relational database. The relational options become unnecessary, and the file names and archives stay today's.

Expand Down Expand Up @@ -189,7 +189,7 @@ The people who run a release can make the SBML and BioPAX bulk files without the
- **Event**: a pathway or a reaction. It is what one on-demand file describes.
- **Species file**: one species' whole BioPAX, or the set of per-event SBML files in an archive.
- **Reference**: what an exporter is compared with:
- for SBML's model, the corrected graph-only converter (exact);
- for SBML's model, today's relational file (element by element);
- for SBML's layout, today's layout (by meaning);
- for BioPAX, today's Pathway-Exchange files (by meaning): the release's published `biopax.zip` for the species files, and the legacy service's answer for one event.
- **Accepted difference**: a recorded way the new output may differ from its reference, with the reason. Nothing switches until every difference found is recorded.
Expand Down
Loading
Loading