Add support for openMINDS v5#96
Open
apdavison wants to merge 3 commits into
Open
Conversation
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
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.
The user can now choose to generate either openMINDS v4 or v5 content.