Skip to content
Open
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
19 changes: 18 additions & 1 deletion schemas/V_epsilon/conversions/from_did_v1/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,27 @@ field-level changes on top.
| `hartley_reverse_correlation` | NDIcalc-vis-matlab `neuro/hartley_reverse_correlation` | drafted | [hartley_reverse_correlation.md](hartley_reverse_correlation.md) |
| `hartley_calc` | NDIcalc-vis-matlab `calc/hartley_calc` | drafted | [hartley_calc.md](hartley_calc.md) |
| `probe_location` | legacy NDI/DID `probe_location` (V_alpha shape) | drafted | [probe_location.md](probe_location.md) |
| `treatment` | legacy NDI/DID `treatment` (V_alpha shape) | drafted | [treatment.md](treatment.md) |
| `ontology_image` | legacy NDI/DID `ontologyImage` (V_alpha shape) | drafted | [ontology_image.md](ontology_image.md) |
| `ontology_label` | legacy NDI/DID `ontologyLabel` (V_alpha shape) | drafted | [ontology_label.md](ontology_label.md) |

## V_epsilon subject_interaction-family conversions (active)

V_epsilon converts the five deprecated families **actively** into the new
observation / manipulation / annotation classes (not passively into their
deprecated shapes). These conversions fan out — one did_v1 document can
mint several V_epsilon documents (a manipulation plus a `time_reference`,
a `subject` plus a `group_assignment`, etc.). They are implemented in
DID-matlab's `+did2/+convert/+migrators/`.

| did_v1 source | V_epsilon target(s) | Status | Doc |
|---|---|---|---|
| `treatment` | `temperature_` / `procedural_` / `environmental_manipulation` (+ companion `generic_scalar_observation`) | applied-in-tooling | [treatment.md](treatment.md) |
| `treatment_drug` | `injection` (kind=drug) (+ `utc_reference`) | applied-in-tooling | [treatment_drug.md](treatment_drug.md) |
| `virus_injection` | `injection` (kind=virus) (+ `utc_reference`) | applied-in-tooling | [virus_injection.md](virus_injection.md) |
| `treatment_transfer` | `biological_transfer` (+ `utc_reference`) | applied-in-tooling | [treatment_transfer.md](treatment_transfer.md) |
| `subject_group` | `subject` (is_group) (+ `group_assignment`) | applied-in-tooling | [subject_group.md](subject_group.md) |
| `stimulus_bath` | `stimulus_bath` v2 (re-rooted under `bath`) | applied-in-tooling | [stimulus_bath.md](stimulus_bath.md) |

## Notes

- **Not migrated:** `stimloopsplitter_calc` (deprecated per domain owner
Expand Down
60 changes: 60 additions & 0 deletions schemas/V_epsilon/conversions/from_did_v1/stimulus_bath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Conversion: did_v1 → V_epsilon — `stimulus_bath` (re-rooted under `bath`)

## Identity

- **V_epsilon target class:** `stimulus_bath` (v2.0.0), now a concrete
subclass of `bath` (← `pharmacological_manipulation` ← `manipulation`
← `subject_interaction`). Moved from `stable/` to `draft/`.
- **V_epsilon tier:** `draft`
- **did_v1 source:**
`ndi_common/schema_documents/stimulus/stimulus_bath_schema.json`:
`location` (structure), `mixture_table` (CSV); superclasses
`[base, epochid]`; depends_on `stimulus_element_id` (req).
- **Status:** `applied-in-tooling`
(`DID-matlab/+did2/+convert/+migrators/stimulus_bath.m`)

## Summary

V_epsilon re-roots `stimulus_bath` into the pharmacological-manipulation
tree. The legacy `epochid` superclass is dropped (timing now lives in
`time_reference` documents). Fields redistribute across the inherited
blocks; the migration is 1:1 (no companion) because the legacy class
carries neither a subject nor a wall-clock time.

## Field mapping

| did_v1 field | V_epsilon field | Transformation |
|---|---|---|
| `mixture_table` | `pharmacological_manipulation.mixture` | CSV → records `{chemical, amount:concentration}`; empty ⇒ one blank backfill record |
| `location` | `bath.location` | `{ontologyNode→node, name}` |
| — | `bath.kind` | constant `"drug"` default (legacy has no kind; backfill vehicle/wash/tracer) |
| `stimulus_element_id` | `stimulus_element_id` | carried |
| (epochid fields) | — | dropped; timing → `time_reference` (backfill) |
| — | `subject_id` | omitted — legacy carries no subject; backfill |

## Default values for new fields

`bath.kind = "drug"`; `stimulus_bath` block is empty (no own fields).
`subject_id` and `time_reference` dependencies are omitted (the did2
validator enforces field/block shape, not depends_on cardinality), and
flagged for curator backfill.

## Worked example

`stimulus_bath` (location LGN, one-row `mixture_table` for a blocker,
`stimulus_element_id → E`) → `stimulus_bath` v2 with `mixture` on the
`pharmacological_manipulation` block, `bath.location = LGN`,
`bath.kind = "drug"`, and `stimulus_element_id → E`.

## Open questions

- `bath.kind` defaulting to `"drug"` is a heuristic; wash/vehicle baths
need curator confirmation.
- Whether `stimulus_bath` should also gain a `stimulus_presentation`
link (vs the bare `stimulus_element_id`) is open in `Bath_Proposal.md`.

## Cross-references

- `Bath_Proposal.md`, `Injection_Proposal.md`
- Migrator: `DID-matlab/src/did/+did2/+convert/+migrators/stimulus_bath.m`
- General file-handling rules: [`_files.md`](_files.md)
58 changes: 58 additions & 0 deletions schemas/V_epsilon/conversions/from_did_v1/subject_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Conversion: did_v1 → V_epsilon — `subject_group` → `subject` + `group_assignment`

## Identity

- **V_epsilon target classes:** `subject` (with `is_group = true`) and,
when a member is named, a companion `group_assignment`.
`subject_group` moves to `deprecated/`.
- **V_epsilon tier:** `stable` (`subject`), `draft` (`group_assignment`),
`deprecated` (`subject_group`)
- **did_v1 source:**
`ndi_common/schema_documents/subject_group_schema.json`: no fields;
depends_on `subject_id` (opt) — an optional member reference.
- **Status:** `applied-in-tooling`
(`DID-matlab/+did2/+convert/+migrators/subject_group.m`)

## Summary

With `subject` carrying `is_group`, the standalone `subject_group`
identity class is redundant (`Placement_and_Group_Assignment_Proposal.md`
§2). The migration rewrites the group into a `subject{is_group:true}`,
**carrying the legacy `base.id` forward so references to the group still
resolve**, and re-expresses any named member as an event-sourced
`group_assignment`.

## Field mapping

| did_v1 field | V_epsilon field | Transformation |
|---|---|---|
| (identity) | `subject` document | `base.id` carried; `subject.is_group = true`, `is_biological = false`, `local_identifier`/`description` empty |
| depends_on `subject_id` (member) | companion `group_assignment` | `group_assignment.depends_on`: `subject_id` = the member, `group_id` = the new subject's `base.id` |
| — | `group_assignment.batch_id` | empty |
| — | `group_assignment.time_reference_#` | omitted — legacy has no assignment time; backfill |

## Default values for new fields

`subject.is_group = true` (the whole point), `is_biological = false`. The
`subject` keeps the legacy `base.id` and `session_id`; the
`group_assignment` mints a fresh id and shares the `session_id`.

## Worked example

`subject_group` (id `G`, member `M`) → `subject{is_group:true}` with
`base.id = G`, plus `group_assignment{subject_id:M, group_id:G}`.

## Open questions

- The real legacy `subject_group` carries at most one optional member; a
group with many members was represented by many `subject_group` docs or
by member-side links. Multi-member groups may need a corpus-specific
pass to mint one `group_assignment` per member.
- "Migrate-then-tighten": `group_assignment.group_id` targets `subject`;
the migration must complete before any tightening of that reference.

## Cross-references

- `Placement_and_Group_Assignment_Proposal.md` §2, `Subject_Document_Proposal.md`
- Migrator: `DID-matlab/src/did/+did2/+convert/+migrators/subject_group.m`
- General file-handling rules: [`_files.md`](_files.md)
Loading
Loading