Repository navigation
Add a vocabulary manifest for normalized ids - #60
Merged
Merged
Conversation
src/study_schema/vocabularies.json pins the release of every vocabulary whose ids land in a record's `normalized` entries (MONDO 2026-09-01, ONVOC 1.0.0, and ns-pond's canonical tasks, task families, condition atoms and phases, contrast keys, contrast sets and their orientation, medical roles) under neutral names, with the legacy strings records carry today. study_schema.vocabularies loads and validates it. Normalization.vocabulary's description states the rule; models regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
canonical_task and task_family now list their upstream vocabularies: HED-task (MIT) at the hed-standard/hed-task merge commits ns-pond's copies match byte for byte, Cognitive Atlas names through HED-task's crosswalk, and the BrainMap paradigm classes behind tct_bm_* tasks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
src/study_schema/vocabularies.json, shipped in the package and loaded bystudy_schema.vocabularies. It pins the release of every vocabulary whose ids land in a record'snormalizedentries, and gives each one a neutral name. The rule, now inNormalization.vocabulary's description and the README: anormalizedentry'svocabularyis a manifest name, or an enum this schema defines (AgeUnit), and itsvalueresolves against the release the manifest pins.vocabularystays free text and its description lists the names. It isn't an enum: pondie's closed-field normalizers write schema enum names (AgeUnit,SexCategory, …), and every record written so far carries the legacy strings, so an enum would reject both.The entries
mondoMONDOpurl.obolibrary.org/obo/mondo/releases/2026-09-01/mondo.json, sha256is_aonvocONVOCskos.ttl(see below), sha256skos:broadercanonical_taskastra canonical taskdata/task_inventory_v3.json@ 47e8470, sha256family→task_familytask_familyastra task familycondition_atomastra condition atom: {axis}(andastra condition atomon unmapped entries)taskcat/conditions.py, sha256:(the axis)condition_phaseastra condition phasetaskcat/conditions.py(11 phases, listed)contrast_keyastra contrast keyrecords.py(the key rule)|→task_familycontrast_setns-pond contrast set {fit_id}contrast_sets/sets.jsonlsha256 +contrasts.py#→task_familycontrast_set_orientationns-pond contrast set orientation {fit_id}sidecars.py(same/reversed)medical_roleastra medical rolemedical.py(none/comorbid/primary)ns-pond pins point at merge commit
47e84703(#202), the last merge that touchedingestion_workflow/normalization/. Main's copy of that directory is still identical to it.The entries also carry an
upstreamlist, described below.study_schema.vocabularies.vocabulary(name)returns one entry.for_legacy(string)maps an old string back to its entry:{axis}matches[a-z_]+and{fit_id}matchesfit-<12 hex>.Borrowed vocabularies
canonical_taskandtask_familylist their sources underupstream. Each hash below was checked against ns-pond's copy.hed-standard/hed-task, MIT):hedtsk_*ids, their names and definitions, their primary family, and thehedvar_*variations. The source isdata/task_details.jsonat merge4a9e8582(Say in the JSON Schema which slots key a nested list #35, 2026-09-23); ns-pond's copy is byte-identical, and that file hasn't changed on HED-task's main since.data/task_family_defs.tsvat the same commit. ns-pond addsanimal_behavior,dyadic_interaction_observation,information_evaluation_and_beliefandingestive_behavior.data/mappings/atlas_task_to_hed.tsvat merge55f7d586(Describe the inverse sign-split half as negated values (text only) #31). No Cognitive Atlas id is written. ns-pond's copy is older than HED-task's main.tct_bm_*tasks come from BrainMap paradigm classes, through ns-pond'sbrainmap_crosswalk.json. I didn't verify a BrainMap release or license, so that entry gives neither.tct_*tasks.Verified
ba19a3be…. It is byte-identical to pondie'sdata/vocab/mondo.json, and its version IRI is…/releases/2026-09-01/mondo.owl, the release the fit manifest names.skos.ttlat OpenNeuroOrg/onvoc-widget commit05d2df56is byte-identical to pondie'sdata/vocab/onvoc.ttl(sha256459a51cc…,owl:versionInfo "1.0.0").code_sha256.fit-ed5ac7b08c20's manifest (on beast) namesmondo/releases/2026-09-01. Itssets.jsonlhas 5,445 sets, sha2567a398fa0….Not verified
fit-ed5ac7b08c20, the newest fit, built 2026-11-05 for #202. Nonormalize_fit_diris set in beast's ns-pond configs, so I couldn't confirm that assign runs with this fit. The fit directory isn't published anywhere; the manifest pins only the hash ofsets.jsonl.taskcat/lexicon.pydiffers from the merged #202, which adds a word-mask fix. This changes which canonical task some names match, not the vocabulary itself.normalize_condition_ctxproduces atoms thatATOMSdoesn't list (for examplecongruency:neutral), so the manifest pins the rules file, not a list of values.Decisions for James
<axis>:<value>, the form taskcat itself produces. Today the axis sits in the vocabulary string and the value alone invalue.contrast_set_orientation. Its values also land innormalized.pyyamlwould have become a runtime dependency.vocabularies/onvoc.pywrites CognitiveAtlas mappings only to corpus rows, never intonormalized.Generated files
python tools/generate_models.pyregeneratedmodels/extraction.pyandjsonschema/extraction-record.schema.json(the description change), and--checkpasses. Tests run locally:test_vocabularies.py(new),test_normalized.pyandtest_generated.py, 38 passed; with the HED-task test added,test_vocabularies.pyalone runs 31.🤖 Generated with Claude Code