Skip to content

Split the ontology into core, disease, symptoms, anatomy and biomarkers modules - #157

Merged
KrishnaTO merged 13 commits into
mainfrom
ontology-modules-split
Oct 26, 2026
Merged

KrishnaTO merged 13 commits into
mainfrom
ontology-modules-split

Conversation

@KrishnaTO

@KrishnaTO KrishnaTO commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Project 1 of the ontology modules design (#153): ontologies/ari_t1d.owl is split into modules, and the OWL files become the only record. Plan: docs/superpowers/plans/2026-10-25-ontology-modules-split.md.

Merge only together with KrishnaTO/ARI-metadata-manager#251, at a confirmed cutover (staging rehearsal first).

What changed

  • Modules.
    • ari_core.owl holds every property (103) and the key classes, under new Disease / AnatomicalEntity / Biomarker umbrella classes.
    • ari_disease.owl is the renamed disease file. It imports core, symptoms, anatomy and biomarkers.
    • ari_anatomy.owl holds the 25 tissue classes and the 23 Tissue_* individuals. The UBERON notes are now rdfs:comments.
    • ari_symptoms.owl moves in from notebook/.
    • ari_biomarkers.owl is empty for now.
    • ari_symp.owl is a generated SYMP slice.
    • catalog-v001.xml resolves every import.
    • Every entity IRI is unchanged.
  • symptomConcept is renamed to sharedConcept on 2,248 Symptom individuals.
  • "No concept" decisions are recorded. ARI_NoConcept marks 46 Symptom individuals as "not a symptom", 3 tissue classes as "no term", and 2 tissue classes as "not linked".
  • Validator (validate_mappings.py):
    • Symptom links are now checked by label lookup in ari_symptoms.owl.
    • New checks:
      • properties declared only in core
      • each subject in one module only
      • every sharedConcept target exists
      • no label or id names two concepts
      • ARI_NoConcept values are valid
      • every tissue class is linked to UBERON or carries ARI_NoConcept
    • Under --since, a change to ari_symptoms.owl re-checks every symptom link.
  • Build scripts. The UBERON and SYMP builders now only extract their slices, and reproduce them byte for byte. Report 4's symptom sheets are built from the OWL with identical cells.
  • Retired. symptom_mapping.tsv and uberon_mapping.tsv are deleted. Every script path now names the modules.
  • .gitattributes keeps tools/robot.version LF, because CRLF broke format-owl.sh on Windows.

Verification

  • ROBOT diff of old vs new. The whole old ontology (t1d plus symptoms) and the whole new one differ only in the intended changes: the rename, the umbrella classes, ARI_NoConcept, the tissue comments and the new property declarations.
  • Formatter. format-owl.sh --check ontologies/*.owl passes.
  • Validator. 0 errors and the 5 existing dxcode-without-snomed warnings, on the full audit and with --since main. Every new check was proved with a deliberately injected fault.
  • Report scripts. Report 4, report 10 (compare.py) and report 12 give the same cells before and after.
  • App load. The real modules load through the app's OntologyService: 23 tissues, a 26-class tissue tree, and all 2,248 links reproduced by the app's lookup.
  • Not yet done. Opening ari_disease.owl in Protégé from ontologies/ still needs a manual check.

Known, not fixed here

🤖 Generated with Claude Code

KrishnaTO and others added 12 commits October 25, 2026 15:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ontologies/

A rename-only commit lets git follow both files' history through the module split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs modules

ari_core.owl now holds the seven key classes under three new umbrella classes
(Disease, AnatomicalEntity, Biomarker) and every property declaration;
ari_anatomy.owl the 25 tissue/system classes and 23 Tissue_* individuals;
ari_biomarkers.owl is an empty module so the import graph is final; the SYMP
terms move out of ari_symptoms.owl into the generated ari_symp.owl slice, and
the ARIS root classes go under Symptom. ari_disease.owl imports the four modules
and the catalog maps every import to its file.

symptomConcept becomes sharedConcept on all 2,248 links. What the two TSVs held
that the OWL did not moves into it: uberon Notes as rdfs:comment, and decided-none
as ARI_NoConcept (46 "not a symptom" individuals, 5 tissue classes).

notebook/ontology-modules/split_ontology.py did the split and is kept for the
record; robot diff of old vs new content shows only these intended changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With CRLF the version string carries a trailing CR, which makes curl reject
the ROBOT download URL and breaks tools/format-owl.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ies only in core, one module per subject

The validator now reads the five ARI-owned modules instead of ari_t1d.owl and
the symptom_mapping.tsv table. A Symptom's sharedConcept is checked against the
label/altLabel lookup over ari_symptoms.owl, ARI_NoConcept records a decision
not to link, only ari_core.owl may declare properties, no subject is described
in two modules, and anatomy classes must link UBERON or say why not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
symptom-concept-mismatch now sits on both the link and the label line,
symptom-concept-repeated on every link line, symptom-decided-and-linked on the
ARI_NoConcept line and each link line. A PR that only repoints or adds a link,
or only adds ARI_NoConcept, was filtered out because the label line was
unchanged. When ari_symptoms.owl differs from the base, every symptom link
finding is kept, since a label moving between classes changes what each link
should be without touching a disease line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owned modules

build_uberon_import.py now reads the UBERON links in ari_anatomy.owl and writes only ari_uberon.owl.
build_symptom_mapping.py is renamed build_symp_import.py and reads the SYMP and HPO links in
ari_symptoms.owl, writes only ari_symp.owl; its report-writing half moves to a separate script.
Both stop on a linked term missing or obsolete in the release. The links are curated in the
modules, not generated into them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….owl

symptom_mapping.tsv is retiring: the OWL modules are now the record of every symptom
mapping. build_symptom_report.py rebuilds the Symptoms and Symptom Mapping sheets from the
ARIS classes (labels, altLabels, SYMP/HPO matches, parents), the ari_symp slice's labels,
and the Symptom individuals' ARI_NoConcept and hasSymptom links. hp.obo supplies HPO labels
and symp.owl the release order of multi-parent SYMP cells. Strings the ontology does not
know keep their existing cells. The regenerated workbook is cell-for-cell and
hyperlink-for-hyperlink identical to main's; only openpyxl's re-save changes the bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… at the modules

Nothing reads the two mapping TSVs any more: the symptom concept links and
UBERON judgments live in ari_symptoms.owl and ari_anatomy.owl. Delete them and
repoint the scripts from ari_t1d.owl to ari_disease.owl. compare.py also loads
ari_anatomy.owl from the disease file's folder, because the Tissue_* individuals
that targetsTissue points at moved there; report 10 is cell-for-cell identical
to the one built from main. Report 12's legend now says ari_core.owl declares
the properties.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…og entry

Rewrites the symptom and UBERON READMEs now that the OWL modules, not the retired mapping TSVs,
hold the judgments (how to map a new symptom string or link a tissue class, the slice builders and
the report script). Adds notebook/ontology-modules/README.md (file table, Protege catalog,
owlready2 onto_path, which tool writes which file). README, CLAUDE.md and the data READMEs now
name ari_disease.owl and the module set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oConcept values

concept-label-ambiguous and concept-id-repeated were reported only on the
later class, so a PR adding the duplicate to an earlier class left the
finding on an unchanged line and --since dropped it, while the app cannot
load an ontology with an ambiguous label. Both are now reported on the line
of every class carrying the string, and kept unscoped when ari_symptoms.owl
changed. New no-concept-value error: ARI_NoConcept must be exactly
"not a symptom", "no term" or "not linked".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…RON linking steps

build_symptom_report.py now strips class labels and altLabels as the app
and validator do (report 4 sheets stay cell-identical to main). The build
blocks in both mapping READMEs run every line from the repo root and use
wsl for the formatter. Linking a tissue class now says to set ARI_ID to the
UBERON CURIE, which the editor's tissue tree shows and nothing generates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	changelog.md
#	notebook/master-list-comparison/import_columns.py
#	notebook/master-list-comparison/import_gaps.py
@KrishnaTO
KrishnaTO merged commit cb231bc into main Oct 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant