Skip to content

Link each Symptom individual to its shared symptom (symptomConcept) - #152

Merged
KrishnaTO merged 3 commits into
mainfrom
claude/symptom-concept-links
Oct 16, 2026
Merged

KrishnaTO merged 3 commits into
mainfrom
claude/symptom-concept-links

Conversation

@KrishnaTO

Copy link
Copy Markdown
Owner

Why

PR #148 kept same-label Symptom individuals apart. Each one is a symptom in one disease: it holds that disease's likelihood, description and source. The editor also destroys an individual when it is removed from a disease, so a shared individual would be removed or edited for every disease at once. This PR keeps the individuals and links each one to its shared ARIS symptom (ARI#142). "Fatigue" across its 76 diseases can then be queried as one thing:

PREFIX ari:  <http://www.aurint.org/ontologies/ari-disease#>
PREFIX aris: <http://www.aurint.org/ontologies/ari-symptoms#>
SELECT ?disease WHERE { ?disease ari:hasSymptom ?s . ?s ari:symptomConcept aris:ARIS_0000190 }

What

  • symptomConcept is a new annotation property in ontologies/ari_t1d.owl. Its value is the IRI of the ARIS_… class in notebook/symptom-mapping/ari_symptoms.owl. It is an annotation property rather than an object property because the target is a class in another file.
  • The TSV owns the link. This is option A from the design discussion. symptom_mapping.tsv, keyed by symptom string, decides the concept, and build_symptom_mapping.py writes it.
    • A merged string links the class of the row it merges into. A not a symptom string links nothing.
    • The script edits only the symptomConcept lines, and a second run changes nothing.
  • Coverage: 2,248 of the 2,294 Symptom individuals are linked, to 763 classes. That is every live individual (2,242) plus 6 obsolete ones whose labels map. The other 46 are obsolete not a symptom entries.
  • One direction only: ari_symptoms.owl no longer carries the reverse ariSymptomIndividual links.
  • Validator: validate_mappings.py checks each Symptom individual's link against the TSV, and the PR gate now also runs when the TSV changes.
    • A link that disagrees with the TSV is an error.
    • A label with no row yet, or a mapped label with no link yet, is a warning. This is the state after a curator adds or renames a symptom in the editor, and it shouldn't block their publish.
    • Each finding is placed on the label line, so a rename shows up in --since mode.
  • Report 4: the Diseases (ontology) counts are corrected for 50 symptoms. The old counts still included individuals retired or merged in Retire 46 non-symptom Symptom individuals (#132) #143, Retire Long COVID symptoms copied from autoimmune pancreatitis #144, Merge the one duplicate individual; explain why other label matches stay apart #148 and Add clinical biomarkers to the data model #149, whose PRs didn't rebuild the report. Only that column changes.

Checked

  • python .github/scripts/validate_mappings.py: 0 errors, 5 warnings. The 5 warnings were already on main.
  • --since origin/main: 0 errors, 0 warnings.
  • Three changes tried on a temporary copy, each caught as expected:
    • renamed label: symptom-unmapped warning
    • removed link: symptom-concept-missing warning
    • re-pointed link: symptom-concept-mismatch error
  • The ontology diff against main is additions only: 2,253 lines, which are the 2,248 links plus the 5-line declaration.
  • owlready2 0.51 loads the file, reads symptomConcept, and keeps all 2,248 links through a load and save. The editor's saves won't drop them.

Follow-up (app repo)

KrishnaTO/ARI-metadata-manager needs a change so that a curator adding or renaming a symptom sets symptomConcept from the TSV row for the new label, or clears it when there is no row. Until then, those symptoms show the warnings above until the next build.

🤖 Generated with Claude Code

KrishnaTO and others added 3 commits October 16, 2026 14:45
…ncept

Same-label Symptom individuals stay one per disease (PR #148): each holds that
disease's likelihood, description and source, and the editor destroys an
individual when it is removed from a disease. To query "Fatigue" across its 76
diseases as one thing, each individual now points at its ARIS class in
notebook/symptom-mapping/ari_symptoms.owl with a new symptomConcept annotation.

symptom_mapping.tsv owns the link, keyed by symptom string; build_symptom_mapping.py
writes it into ari_t1d.owl line by line (idempotent) and drops the reverse
ariSymptomIndividual links from ari_symptoms.owl. 2,249 individuals linked
(all 2,243 live ones). validate_mappings.py checks links against the TSV:
mismatch is an error, an unmapped or not-yet-linked symptom a warning. Report 4
picks up ontology disease counts stale since #143/#144.

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

# Conflicts:
#	changelog.md
#	ontologies/ari_t1d.owl
@KrishnaTO
KrishnaTO merged commit 4a4c212 into main Oct 16, 2026
1 check 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