-
Notifications
You must be signed in to change notification settings - Fork 15
Add sameAs field to the Dandiset model`
#364
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
Changes from all commits
4a6fdce
873b39e
0aa1ac5
419313b
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 |
|---|---|---|
|
|
@@ -85,7 +85,8 @@ | |
| "[a-f0-9]{8}[-]*[a-f0-9]{4}[-]*" "[a-f0-9]{4}[-]*[a-f0-9]{4}[-]*[a-f0-9]{12}$" | ||
| ) | ||
| ASSET_UUID_PATTERN = r"^dandiasset:" + UUID_PATTERN | ||
| VERSION_PATTERN = r"\d{6}/\d+\.\d+\.\d+" | ||
| VERSION_NUM_PATTERN = r"\d+\.\d+\.\d+" | ||
| VERSION_PATTERN = rf"\d{{6}}/{VERSION_NUM_PATTERN}" | ||
| _INNER_DANDI_DOI_PATTERN = ( | ||
| rf"{DOI_PREFIX_PATTERN}/{ID_PATTERN.lower()}\.{VERSION_PATTERN}" | ||
| ) | ||
|
|
@@ -1666,7 +1667,7 @@ def contributor_musthave_contact( | |
| id: str = Field( | ||
| description="Uniform resource identifier", | ||
| pattern=( | ||
| rf"^({ID_PATTERN}|{ID_PATTERN.lower()}):\d{{6}}(/(draft|\d+\.\d+\.\d+))$" | ||
| rf"^({ID_PATTERN}|{ID_PATTERN.lower()}):\d{{6}}(/(draft|{VERSION_NUM_PATTERN}))$" | ||
| ), | ||
| json_schema_extra={"readOnly": True}, | ||
| ) | ||
|
|
@@ -1677,6 +1678,28 @@ def contributor_musthave_contact( | |
| pattern=rf"^{ID_PATTERN}:\d{{6}}$", | ||
| json_schema_extra={"readOnly": True, "nskey": "schema"}, | ||
| ) | ||
|
|
||
| sameAs: Annotated[ | ||
| Optional[ | ||
| list[ | ||
| Annotated[ | ||
| str, | ||
| StringConstraints( | ||
| pattern=( | ||
| rf"^dandi://{UNVENDORED_ID_PATTERN}/\d{{6}}" | ||
| rf"(@(draft|{VERSION_NUM_PATTERN}))?(/\S+)?$" | ||
|
Comment on lines
+1689
to
+1690
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. the only comment i have is whether this should be a DANDI specific
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. I would keep it constrained to just point to our instances, while coding tools defensively (could be anything), and indeed referring people to use related for extra resources. Although, we could potentially use sameAs to point to DataLad dandisets here... WDYT? |
||
| ) | ||
| ), | ||
| ] | ||
| ] | ||
| ], | ||
| Field( | ||
| default=None, | ||
| description="Known DANDI URLs of the Dandiset at other DANDI instances.", | ||
| json_schema_extra={"readOnly": True, "nskey": "schema"}, | ||
| ), | ||
| ] | ||
candleindark marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| name: str = Field( | ||
| title="Dandiset title", | ||
| description="A title associated with the Dandiset.", | ||
|
|
||
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.
note: I thought we had merged
already... apparently not, so later we would need to add handling of
sameAsas well there