-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add asset "layout" metadata field, validate asset paths #157
Comments
is there something that prevents detecting layout based on either local/remote dandiset.yaml + dataset_description.json ? if |
Iirc we don't have association from asset to dandiset |
@yarikoptic - we do (see s3 bucket) and can expose it via api. at least at this point, assets still have a one to one correspondence with dandiset, but one to many with dandiset/version. so if assets are listed per dandiset, they have explicit association. |
I am asking since all such validations should be done within |
i think the difference i am making is that in dandischema such a function could take type of layout as input, but that doesn't need to be in the asset model. |
Per brief monday discussion -- we might want/need to make validation of assets interface to be exposed to the notion of dandiset across the entire surface of the archive interfaces/implementation. But I would like to remind that dandi-schema is ATM the core logic for validation, so it might need to start here somehow and decide on how to expose/use it at dandi-cli/dandi-archive levels. Might relate to dandi/dandi-archive#1477 (by @bendichter ) where solution might be to establish regexes for URLs at dandi-schema level so they could be used/validated by both dandi-cli and dandi-archive UIs |
yes. my only thinking is that we might need later some other aspect of knowing dandiset metadata or identity (e.g. to do validation in conjnction with with other assets), and then would need to change it again. |
why don't we start with copying the regex's over and adding a validation function to the asset model for the asset path. |
in a follow up to dandi/dandi-cli#1205 (comment) of @satra
yes, that was done in dandi/dandi-cli#1173 but it does not mean that it should stay here, at least as the "implementation logic".
In the past we removed
dandi-cli
from dependencies ofdandi-archive
IIRC to break the "dependency loop" sincedandi-cli
depends on API implementation of the archive. Hence we keep code worth reusing in both -cli and -archive elsewhere (dandi-schema, zarr_checksum) etc.So may be we should move the validate_organized_path into dandischema? But again -- then for an asset it would matter on either it is a BIDS asset or some other (DANDI layout) asset.
looking at a sample asset from 000026 which is BIDS -- we do not provide such metadata
so to validate the path we should first start annotating assets with "layout" (optional, default to DANDI, could be BIDS). Then validate either using our DANDI layout regex, or BIDS (using bidsschematools like done in dandi-cli) purely on the path (ref also #74 ).
The text was updated successfully, but these errors were encountered: