bids-standard/bids-examples

Is eeg_face13's task-faceFO_events.json really valid?

apjanke opened this issue · 11 comments

In example eeg_face13, the top-level /task-faceFO_events.json file just contains this:

[]

That's an empty array or list, and not a JSON object. (An empty JSON object would be {}.)

The BIDS-MATLAB tool errors out when reading this example. PyBIDS seems to work with it in my testing, but I'm not very familiar with PyBIDS. And it passes validation under BIDS Validator v1.3.12.

Is this really valid for a metadata file, though? The "Key/value files (dictionaries)" section of the BIDS standard doesn't explicitly say what format the data in the JSON metadata files has to be. But since it talks about them being "key/value files (dictionaries)", that seems to imply that they should contain a JSON object at the top level, instead of an array or a scalar value, because that's the JSON type corresponding to a dictionary.

This is the only example in bids-examples that seems to have a metadata file formatted like this.

To clarify: these are all things which are valid JSON files, but I wouldn't think would count as valid BIDS metadata files:

[]
[
  "foo", 42,
  "bar", "some string"
]
"foo: 42, bar: 'some string'"
42
[
  {
    "foo": 42,
    "bar": "some string"
  }
]

the [] content is also not in line with my expectations, but given https://bids-specification.readthedocs.io/en/stable/02-common-principles.html#tabular-files I don't think it is incorrect.

The data dictionaries MUST have the same name as their corresponding tabular files but with .json extensions. If a JSON file is provided, it MAY contain one or more fields describing the columns found in the TSV file (in addition to any other metadata one wishes to include that describe the file as a whole).

The "any other metadata" would cover this and is not specific regarding formatting.

I'm not sure I read that part of the spec the same way: to me it sounds like "any other metadata..." is referring to what can be found in the "one or more fields", not the top-level/file as a whole. Maybe this part of the spec could use some clarification one way or the other.

agreed. I will file an issue at bids-specification.

Thanks!

Just saw this now. Those empty JSON files are generated as a result of an empty argument in our Bidsification process. It can easily be removed in the future.

since these JSON files with an empty list are ambiguous, can we remove them from the bids-examples?

I propose to do a PR in which these files are removed and a CHANGES file is added.

Absolutely - that'd be great, thanks!

any news on this @robertoostenveld ?

I just filed a PR to resolve this.

Thanks!