Repository navigation
Add per-asset dataStandard, HED standard, and extensions to StandardsType #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
602aad4
68be356
b59975f
f454667
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,5 @@ sandbox/ | |
| venv/ | ||
| venvs/ | ||
| dandischema/_version.py | ||
| uv.lock | ||
| .cache/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -859,11 +859,28 @@ class MeasurementTechniqueType(BaseType): | |
| class StandardsType(BaseType): | ||
| """Identifier for data standard used""" | ||
|
|
||
| version: Optional[str] = Field( | ||
| None, | ||
| description="Version of the standard used.", | ||
| json_schema_extra={"nskey": "schema"}, | ||
| ) | ||
| extensions: Optional[List[StandardsType]] = Field( | ||
| None, | ||
| description="Extensions to the standard used " | ||
| "(e.g. NWB extensions like ndx-*, HED library schemas).", | ||
| json_schema_extra={"nskey": DANDI_NSKEY}, | ||
| ) | ||
| # TODO: consider how to formalize BIDS extensions (BEPs) once BIDS | ||
| # has a machine-readable way to declare them. | ||
| schemaKey: Literal["StandardsType"] = Field( | ||
| "StandardsType", validate_default=True, json_schema_extra={"readOnly": True} | ||
| ) | ||
|
|
||
|
|
||
| # Self-referencing model needs rebuild after class definition | ||
| # https://docs.pydantic.dev/latest/concepts/postponed_annotations/#self-referencing-or-recursive-models | ||
| StandardsType.model_rebuild() | ||
|
|
||
| nwb_standard = StandardsType( | ||
| name="Neurodata Without Borders (NWB)", | ||
| identifier="RRID:SCR_015242", | ||
|
|
@@ -879,6 +896,11 @@ class StandardsType(BaseType): | |
| identifier="DOI:10.25504/FAIRsharing.9af712", | ||
| ).model_dump(mode="json", exclude_none=True) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kabilar please add additional constructs for anything LINC related -- like those for bigtiff etc, and then here as to use them in dandi-cli |
||
|
|
||
| hed_standard = StandardsType( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defining I think that should be done in a separate PR though.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed — keeping lowercase here for consistency with the existing pattern, and the rename to UPPER_CASE can be done in a separate PR as you suggest. |
||
| name="Hierarchical Event Descriptors (HED)", | ||
| identifier="RRID:SCR_014074", | ||
| ).model_dump(mode="json", exclude_none=True) | ||
|
|
||
|
|
||
| class ContactPoint(DandiBaseModel): | ||
| email: Optional[EmailStr] = Field( | ||
|
|
@@ -1934,6 +1956,12 @@ class BareAsset(CommonModel): | |
| json_schema_extra={"nskey": "prov"}, | ||
| ) | ||
|
|
||
| dataStandard: Optional[List[StandardsType]] = Field( | ||
| None, | ||
| description="Data standard(s) applicable to this asset.", | ||
| json_schema_extra={"nskey": DANDI_NSKEY}, | ||
| ) | ||
|
|
||
| schemaKey: Literal["BareAsset"] = Field( | ||
| "BareAsset", validate_default=True, json_schema_extra={"readOnly": True} | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we set
"nskey"key in thejson_schema_extradict? Ifextensionsis not defined in a known ontology, we I think we should use ours, i.e.,There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed — added
"nskey": DANDI_NSKEYto extensions in 702f464RF: address PR review - replace readOnly with nskey, fix extensions field.