airr-community / airr-standards

AIRR Community Data Standards
https://docs.airr-community.org
Creative Commons Attribution 4.0 International
35 stars 23 forks source link

AIRR Data Model identifiers in the new draft objects not marked as identifiers #656

Closed schristley closed 1 year ago

schristley commented 1 year ago

In many of the new draft objects, the AIRR Data Model identifier fields are not tagged with the identifier: true attribute in x-airr. This attribute is needed so that valid data is returned from the ADC API.

javh commented 1 year ago

We should make a pass over the _id fields to make sure all that should be identifier: true are set as such. IIRC, required: true & nullable: false implies identifier: true for _id fields. Is there any reason not to be explicit and add the tag?

Eg, Cell.cell_id does not have an identifier tag.

bcorrie commented 1 year ago

@schristley can you elaborate on which fields you think should have this characteristic.

I see that cell_id in the Cell object does not have identifier:true which seems wrong to me. But I wouldn't say that that is the case for all _id fields. Do you have a list that are causing you issues? How is your middleware using these fields?

schristley commented 1 year ago

I think the fields to mark as identifier will be obvious as you scan through. It's those fields required to represent the relationships between AIRR objects. I tend to ask myself how would the code look if I needed to access some random field, say mhc_genotyping_method, what identifiers would I use?

schristley commented 1 year ago

We should make a pass over the _id fields to make sure all that should be identifier: true are set as such. IIRC, required: true & nullable: false implies identifier: true for _id fields. Is there any reason not to be explicit and add the tag?

I think explicitly adding the tag to each _id fields is a good idea. Note that I think many _id fields for the AIRR Data Model have nullable: true yet they should be tagged identifier: true