ISA-tools / isa-api

ISA tools API
https://isa-tools.org
Other
40 stars 37 forks source link

Required Fields In Investigation XML Config #540

Open ptth222 opened 4 months ago

ptth222 commented 4 months ago

This can be considered an inconsistency, but I decided not to add more to Issue #534. It might be better to keep things smaller and easier to close.

The XML config for investigation has the following fields as required:

'Investigation Identifier',
'Investigation Title',
'Investigation Description',
'Investigation PubMed ID',
'Investigation Publication DOI',
'Investigation Publication Author List',
'Investigation Publication Title',
'Investigation Publication Status',
'Investigation Person Last Name',
'Investigation Person First Name',
'Investigation Person Mid Initials',
'Study Identifier',
'Study Title',
'Study Description',
'Study PubMed ID',
'Study Publication DOI',
'Study Publication Author List',
'Study Publication Title',
'Study Publication Status',
'Study Person Last Name',
'Study Person First Name',
'Study Person Mid Initials'

The first issue is that these are not also required in the corresponding JSON Schema.

The second issue is that I think some of these are needlessly required. Specifically, I think the following are unnecessary:

'Investigation Publication Status',
'Investigation Person Mid Initials',
'Study Publication Status',
'Study Person Mid Initials

I do have a pending PR #532 that makes the initials no longer required.

Some of the others I think could be conditionally required. For instance, the person attributes could require 1 of either first name or last name. The publication attributes could be more complicated. You could require just DOI, or just PubMed ID, or Title and Author List. The config files don't currently have these kinds of capabilities, but JSON Schema does.

I should also note that the definition of "required" between the XML configs and JSON Schema are slightly different. In the XML configs "is-required" will make sure that the value isn't an empty string, but for JSON Schema the "required" keyword requires the attributes in the "required" list to be present. To reproduce what the XML configs do in JSON Schema you need to do something like setting the "minLength" to 1 for the property.