|
| 1 | +# METPO Term Deprecation Workflow |
| 2 | + |
| 3 | +**Purpose:** How to deprecate terms and allocate new IDs in METPO, and how the |
| 4 | +deprecated-term machinery works. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## The Short Version |
| 9 | + |
| 10 | +- `src/templates/deprecated.tsv` is the **authoritative list of all deprecated METPO terms**. |
| 11 | + It is committed to the repo and merged into `metpo.owl` on every release build. |
| 12 | +- **Never reuse a burned ID.** Check `reports/id-allocation-audit.md` for the full list. |
| 13 | +- When you deprecate a term, edit `deprecated.tsv` directly — do not re-run the research tools. |
| 14 | +- When you add a new term, use the next safe ID from the audit report. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Background: Three Eras of METPO IDs |
| 19 | + |
| 20 | +METPO has gone through three numbering schemes. All are burned and must never be reused. |
| 21 | + |
| 22 | +| Era | Format | Range | Status | |
| 23 | +|-----|--------|-------|--------| |
| 24 | +| Era 1 | 6-digit with leading zeros | `000001`–`000274` | Abandoned (submissions 2–3) | |
| 25 | +| Era 2 | 7-digit with leading zeros | `0000001`–`0000351` | Abandoned (submissions 4–5) | |
| 26 | +| Era 3 | `1xxxxxx` classes, `2xxxxxx` properties | `1000001`+ / `2000001`+ | Current scheme | |
| 27 | + |
| 28 | +Within Era 3, IDs `1000001`–`1000327` were used for literature-mining terms (derived from |
| 29 | +OntoGPT/IJSEM extraction) and retired in BioPortal submission 9. They must not be reused. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Allocating New IDs |
| 34 | + |
| 35 | +Run `make audit-ids` to regenerate `reports/id-allocation-audit.md` and get current |
| 36 | +"next safe ID" values. As of the last regeneration: |
| 37 | + |
| 38 | +- **Next safe class ID:** `METPO:1005041` (highest active class + 1) |
| 39 | +- **Next safe property ID:** `METPO:2000735` (highest active property + 1) |
| 40 | + |
| 41 | +Always use `make audit-ids` for current values — the numbers above go stale as terms are added. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Deprecating a Term |
| 46 | + |
| 47 | +When a term is removed from the active templates (`src/templates/metpo_sheet.tsv` or |
| 48 | +`src/templates/metpo-properties.tsv`), it must be added to `src/templates/deprecated.tsv`. |
| 49 | + |
| 50 | +### Step 1 — Remove from the active template |
| 51 | + |
| 52 | +Delete the row from `metpo_sheet.tsv` or `metpo-properties.tsv`. This is typically done |
| 53 | +by editing the upstream Google Sheet and running `make download-sheets`. |
| 54 | + |
| 55 | +### Step 2 — Add a row to `src/templates/deprecated.tsv` |
| 56 | + |
| 57 | +The file is a ROBOT template. Column layout: |
| 58 | + |
| 59 | +``` |
| 60 | +ID label TYPE deprecated obsolescence reason |
| 61 | +ID LABEL TYPE A owl:deprecated AI IAO:0000231 |
| 62 | +METPO:XXXXXXX obsolete <former label> owl:Class true OMO:0001000 |
| 63 | +``` |
| 64 | + |
| 65 | +Add one row per deprecated term. Use: |
| 66 | +- **label**: `obsolete ` + the former rdfs:label (e.g. `obsolete lyses`) |
| 67 | +- **TYPE**: `owl:Class` for classes, `owl:ObjectProperty` / `owl:DataProperty` / |
| 68 | + `owl:AnnotationProperty` for properties |
| 69 | +- **deprecated**: always `true` |
| 70 | +- **obsolescence reason**: use `OMO:0001000` (out of scope) or `IAO:0000226` |
| 71 | + (placeholder removed) — see the existing rows for precedent. When in doubt, use |
| 72 | + `IAO:0000226`. |
| 73 | + |
| 74 | +### Step 3 — Commit both changes together |
| 75 | + |
| 76 | +The removal from the active template and the addition to `deprecated.tsv` should be in |
| 77 | +the same commit so the ontology is never in a state where an ID simply vanishes. |
| 78 | + |
| 79 | +### Step 4 — Verify |
| 80 | + |
| 81 | +```bash |
| 82 | +# Check the deprecated template is valid ROBOT input |
| 83 | +uv run generate-deprecated-template --help # confirms the CLI is available |
| 84 | + |
| 85 | +# Regenerate the audit report to confirm the ID now shows as burned |
| 86 | +make audit-ids |
| 87 | +grep "METPO:XXXXXXX" reports/id-allocation-audit.md |
| 88 | +``` |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## How `deprecated.tsv` Gets Into the Ontology |
| 93 | + |
| 94 | +`src/ontology/metpo.Makefile` passes `deprecated.tsv` to ROBOT alongside the main |
| 95 | +templates when building `components/metpo_sheet.owl`: |
| 96 | + |
| 97 | +```makefile |
| 98 | +components/metpo_sheet.owl: ... ../templates/deprecated.tsv |
| 99 | + $(ROBOT) template \ |
| 100 | + --template ../templates/deprecated.tsv \ |
| 101 | + ... |
| 102 | +``` |
| 103 | + |
| 104 | +The resulting component is then merged into `metpo.owl` during `prepare_release`. |
| 105 | +Every deprecated term in the file becomes a real OWL entity with: |
| 106 | +- `owl:deprecated true` |
| 107 | +- `rdfs:label "obsolete ..."` |
| 108 | +- `IAO:0000231` (has obsolescence reason) annotation |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## The Audit and Bootstrap Tools (Research Machinery) |
| 113 | + |
| 114 | +Two CLI tools support this workflow: |
| 115 | + |
| 116 | +### `audit-id-allocation` → `reports/id-allocation-audit.md` |
| 117 | + |
| 118 | +```bash |
| 119 | +make audit-ids |
| 120 | +# or directly: |
| 121 | +uv run audit-id-allocation -o reports/id-allocation-audit.md |
| 122 | +``` |
| 123 | + |
| 124 | +Scans current templates, all BioPortal entity extracts under |
| 125 | +`metadata/ontology/historical_submissions/entity_extracts/`, and all tagged git releases. |
| 126 | +Produces a markdown report with active counts, burned ID lists, provenance chains, and |
| 127 | +next safe IDs. **Run this before allocating any new ID.** |
| 128 | + |
| 129 | +### `generate-deprecated-template` → `src/templates/deprecated.tsv` |
| 130 | + |
| 131 | +```bash |
| 132 | +make -C src/ontology -f metpo.Makefile regenerate-deprecated |
| 133 | +# or directly: |
| 134 | +uv run generate-deprecated-template -o src/templates/deprecated.tsv |
| 135 | +``` |
| 136 | + |
| 137 | +Regenerates `deprecated.tsv` from scratch by rerunning the same scan as the audit tool. |
| 138 | +**This is a bootstrap/recovery tool.** Under normal maintenance you should not need to |
| 139 | +run it — just edit `deprecated.tsv` by hand when deprecating a term. Run it only if you |
| 140 | +suspect `deprecated.tsv` has drifted from reality (e.g. after a large batch deprecation |
| 141 | +or if the file is corrupted). |
| 142 | + |
| 143 | +### How `deprecated.tsv` was originally created |
| 144 | + |
| 145 | +`generate-deprecated-template` was run once (March 2026, PR #375) after a comprehensive |
| 146 | +scan of all 9 BioPortal submissions and 13 tagged releases. It found 1,168 burned IDs |
| 147 | +across all three eras and wrote them into `deprecated.tsv` with labels recovered from |
| 148 | +the same historical sources. That file is now the source of truth — the scan tools exist |
| 149 | +as a safety net, not as a required step in the maintenance loop. |
| 150 | + |
| 151 | +If the BioPortal submission extracts or the `generate-deprecated-template` script are |
| 152 | +ever removed, the methodology is documented in `docs/metpo_id_ranges_research.md` and |
| 153 | +the full provenance is in `reports/id-allocation-audit.md`. |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +## Never-Reuse Checklist |
| 158 | + |
| 159 | +Before allocating any new ID, verify it does not appear in: |
| 160 | + |
| 161 | +1. `src/templates/metpo_sheet.tsv` or `src/templates/metpo-properties.tsv` |
| 162 | +2. `src/templates/deprecated.tsv` |
| 163 | +3. `reports/id-allocation-audit.md` |
| 164 | + |
| 165 | +```bash |
| 166 | +ID=1005041 |
| 167 | +grep "$ID" src/templates/*.tsv src/templates/deprecated.tsv reports/id-allocation-audit.md |
| 168 | +``` |
| 169 | + |
| 170 | +If any of those grep hits, pick a different ID. |
0 commit comments