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

Validate dataset_description.json contents #2007

Closed
yarikoptic opened this issue Jun 22, 2024 · 3 comments · Fixed by #2075
Closed

Validate dataset_description.json contents #2007

yarikoptic opened this issue Jun 22, 2024 · 3 comments · Fixed by #2075
Labels

Comments

@yarikoptic
Copy link
Contributor

I am preparing example for the

and upon initial validation receiving NO error although it should be there since I entered (for extra check) a completely unknown value.

❯ bids-validator-deno --version
bids-validator v1.14.7-dev.0-68-g53fdba69

❯ grep DatasetType dataset_description.json
    "DatasetType": "prlkjasdfoject",
❯ bids-validator-deno $PWD
This dataset appears to be BIDS compatible.

          Summary:                         Available Tasks:        Available Modalities:
          1 Files, 336 B                                                                
          0 - Subjects 1 - Sessions                                                     

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

❯ bids-validator $PWD

[email protected]
	1: [ERR] Invalid JSON file. The file is not formatted according the schema. (code: 55 - JSON_SCHEMA_VALIDATION_ERROR)
		./dataset_description.json
			Evidence: .DatasetType should be equal to one of the allowed values

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

	2: [ERR] There are no subject folders (labeled "sub-*") in the root of this dataset. (code: 45 - SUBJECT_FOLDERS)

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

	1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)

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

        Summary:            Available Tasks:        Available Modalities: 
        1 File, 336B                                                      
        0 - Subjects                                                      
        1 - Session                                                       


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

effigies commented Aug 7, 2024

deno run -A src/bids-validator.ts /tmp/empty      
	[ERROR] A dataset_description.json file is required in the root of the dataset (MISSING_DATASET_DESCRIPTION)


		0 more files with the same issue

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


          Summary:                         Available Tasks:        Available Modalities:
          0 Files, 0 B                                                                  
          0 - Subjects 1 - Sessions                                                     

	If you have any questions, please post on https://neurostars.org/tags/bids.echo '{}' > /tmp/empty/dataset_description.jsondeno run -A src/bids-validator.ts /tmp/empty
	[ERROR] There are no subject directories (labeled "sub-*") in the root of this dataset.
 (SUBJECT_FOLDERS)

		./dataset_description.json
			Evidence: schema.rules.rules.checks.dataset.SubjectFolders

		1 more files with the same issue

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

	[WARNING] The BIDSVersion field of 'dataset_description.json' does not match a known release.
The BIDS Schema used for validation may be out of date.
 (UNKNOWN_BIDS_VERSION)

		./dataset_description.json
			Evidence: schema.rules.rules.checks.dataset.UnknownVersion

		1 more files with the same issue

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

	[WARNING] The recommended file /README is missing.
See Section 03 (Modality agnostic files) of the BIDS specification.
 (README_FILE_MISSING)

		./dataset_description.json
			Evidence: schema.rules.rules.checks.hints.ReadmeFileMissing

		1 more files with the same issue

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

	[WARNING] The 'Authors' field of 'dataset_description.json' should contain an array of values -
with one author per value.
This was triggered based on the presence of only one author field.
Please ignore if all contributors are already properly listed.
 (TOO_FEW_AUTHORS)

		./dataset_description.json
			Evidence: schema.rules.rules.checks.hints.TooFewAuthors

		1 more files with the same issue

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

	[ERROR] A JSON flle is missing a key listed as required. (JSON_KEY_REQUIRED)

		./dataset_description.json
			Evidence: missing Name as per schema.rules.rules.dataset_metadata.dataset_description

		1 more files with the same issue

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


          Summary:                         Available Tasks:        Available Modalities:
          1 Files, 3 B                                                                  
          0 - Subjects 1 - Sessions                                                     

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

@effigies effigies closed this as completed Aug 7, 2024
@yarikoptic
Copy link
Contributor Author

I am not sure why it was closed @effigies -- your examples do not demonstrate validator to ERROR on unknown DatasetType as I demonstrated in the original description and seems how it is done by original bids-validator.

@effigies
Copy link
Collaborator

Sorry, I missed one of the issues in this report.

@effigies effigies changed the title deno: Does not ERROR on the unknown DatasetType + does not warn that no subjects Validate dataset_description.json contents Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants