Skip to content
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

Provide validation against current "schema" for image 3 #8

Open
yarikoptic opened this issue Jan 10, 2018 · 1 comment
Open

Provide validation against current "schema" for image 3 #8

yarikoptic opened this issue Jan 10, 2018 · 1 comment

Comments

@yarikoptic
Copy link
Collaborator

yarikoptic commented Jan 10, 2018

NDA does change the details for the image 3 type of submissions quite regularly: see https://ndar.nih.gov/data_structure_history.html?short_name=image03 for the "changelog". Unfortunately they nohow reflect having introduced changes within the version -- I would have expected it to become "3.1", "3.2" etc as long as it stays compatible (no new required field introduced) and jump to "4" whenever a new field become required or some field gets removed. So, in principle, prepared submission file might become "incompatible" even when it was compatible for the version "3" and there is no other version we could specify to signal the level of compatibility.
I have not looked into details of changes, i.e. if anything is incompatible already -- at least on our quick trial (without actually uploading anything) for a sample study and it was all "kosher" according to the NDA's validator.

But I wonder if the schema could be fetched from https://ndar.nih.gov/data_structure.html?short_name=image03 once in a while (e.g. in the tests? or upon bids2nda call and cached locally) and internal assumptions of bids2nda could be validated (that all required fields are "covered" and whatnot). May be there is some way to get that schema in a standardized form (json schema) and validate against internal structure?

what do you think?

references

@bpoldrack
Copy link

May be there is some way to get that schema in a standardized form (json schema) and validate against internal structure?

There is:

import requests
import pprint

pprint.pprint(requests.get("https://nda.nih.gov/api/datadictionary/datastructure/image03").json())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants