psychoinformatics-de / datalad-hirni

DataLad extension for (semi-)automated, reproducible processing of (medical/neuro)imaging data
http://datalad.org
Other
5 stars 8 forks source link

Adding author via webapp breaks bids-validator #188

Open manuelakuhn opened 3 years ago

manuelakuhn commented 3 years ago

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
bids-validator@1.6.2

    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
bids-validator@1.6.2

    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 commented 3 years ago

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 commented 3 years ago

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