Skip to content

Add support for openMINDS v5#96

Open
apdavison wants to merge 3 commits into
openMetadataInitiative:mainfrom
apdavison:openminds-v5
Open

Add support for openMINDS v5#96
apdavison wants to merge 3 commits into
openMetadataInitiative:mainfrom
apdavison:openminds-v5

Conversation

@apdavison
Copy link
Copy Markdown
Member

The user can now choose to generate either openMINDS v4 or v5 content.

apdavison added 3 commits May 29, 2026 11:42
The converter previously hard-coded openMINDS v4. This adds an
`--openminds-version {v4,v5}` CLI flag and an `openminds_version`
parameter to `convert()`, defaulting to v4 so existing behaviour is
unchanged and v5 is opt-in.

A new `openminds_version` module is the single source of truth for the
active schema: `configure()` rebinds the `core`/`controlled_terms`
submodules for the chosen version, which main.py and utility.py
reference via `om.core` / `om.controlled_terms`.

v5 schema differences handled:
- DatasetVersion/Dataset: `authors` -> `contributions` (a Contribution
  of type "authoring"); `behavioral_protocols` is dropped; the
  version-to-dataset link moves from Dataset.has_versions to
  DatasetVersion.is_version_of.
- Person: set `preferred_name` (the required identifying field in v5).
- SubjectState.age: wrap the QuantitativeValue in a SpecimenAge
  (reference = age since birth).

The chosen version is printed in the conversion report, since it is not
recorded in the JSON-LD output and must be passed to
`Collection.load(..., version=...)` when reloading.

Adds tests for version selection plus a conftest fixture that resets the
global version around each test. Updates README and usage docs.
# Conflicts:
#	bids2openminds/main.py
@apdavison apdavison added the enhancement New feature or request label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant