Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Adding author via webapp breaks bids-validator #188

Open
manuelakuhn opened this issue Mar 26, 2021 · 2 comments
Open

Adding author via webapp breaks bids-validator #188

manuelakuhn opened this issue Mar 26, 2021 · 2 comments

Comments

@manuelakuhn
Copy link

Using the webapp functionality to add an author adds a dictionary to the author list. Besides that author dictionaries are not defined in the BIDS format (Authors should be an array of strings), it results in an internal error in the container of the bids-validator.

$ datalad create -c hirni sourcedata
$ cd sourcedata
$ datalad webapp --dataset . hirni

-> Edit study metadata
-> Add author "first_name family_name"

results in:

$ git diff HEAD HEAD^
diff --git a/dataset_description.json b/dataset_description.json
index 6c636ac..139b8c3 100644
--- a/dataset_description.json
+++ b/dataset_description.json
@@ -2,16 +2,7 @@
 "Acknowledgements":
 "",
 "Authors":
-[
-{
-"email":
-"",
-"givenname":
-"family_name",
-"name":
-"first_name"
-}
-],
+[],
 "BIDSVersion":
 "1.1.1",
 "DatasetDOI":
$ datalad hirni-import-dcm --anon-subject 001 <data_dir>/sourcedata.tar.gz acq1
$ cd ..
$ datalad create -c bids bids
$ cd bids
$ datalad install --dataset "." --source ../sourcedata sourcedata --recursive
$ datalad hirni-spec2bids --anonymize sourcedata/studyspec.json sourcedata/acq1/studyspec.json
$ mkdir container
$ export SINGULARITY_PULLFOLDER="container"; singularity pull --name validator.simg docker://bids/validator
$ singularity run --no-home --containall --bind /tmp/datalad-tests/bids:/data container/validator.simg /data
[email protected]

	1: [ERR] Internal error. SOME VALIDATION STEPS MAY NOT HAVE OCCURRED (code: 0 - INTERNAL ERROR)
		.undefined
			Evidence: TypeError: author.split is not a function
    at checkAuthorField (/src/validators/bids/checkDatasetDescription.js:52:18)
    at checkDatasetDescription (/src/validators/bids/checkDatasetDescription.js:20:28)
    at /src/validators/bids/fullTest.js:135:40

	Please visit https://neurostars.org/search?q=INTERNAL ERROR for existing conversations about this issue.


        Summary:                Available Tasks:        Available Modalities:
        8 Files, 11.49MB                                T1w
        1 - Subject
        1 - Session


	If you have any questions, please post on https://neurostars.org/tags/bids.

solution for bids-validator:

--- a/dataset_description.json
+++ b/dataset_description.json
@@ -3,14 +3,7 @@
 "",
 "Authors":
 [
-{
-"email":
-"",
-"givenname":
-"",
-"name":
+"first_name family_name"
-}
 ],
 "BIDSVersion":
 "1.1.1",
$ singularity run --no-home --containall --bind /tmp/datalad-tests/bids/:/data containers/bids-validator.simg /data
[email protected]

	1: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered based on the presence of only one author field. Please ignore if all contributors are already properly listed. (code: 102 - TOO_FEW_AUTHORS)

	Please visit https://neurostars.org/search?q=TOO_FEW_AUTHORS for existing conversations about this issue.


        Summary:                Available Tasks:        Available Modalities:
        8 Files, 11.49MB                                T1w
        1 - Subject
        1 - Session


	If you have any questions, please post on https://neurostars.org/tags/bids.
@bpoldrack
Copy link

Thanks!

Need to double-check BIDS, since I'm pretty sure I produced valid records that way. May have changed since (if only by being more specific in what's allowed there).

@bpoldrack
Copy link

Note: Such a change would require to adapt the webapp as well: #189

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

No branches or pull requests

2 participants