plantbreeding / BrAPI

Repository for version control of the BrAPI specifications
https://brapi.org
MIT License
55 stars 32 forks source link

Add germplasm.available to know if a germplasm can be ordered in a genebank #599

Open cpommier opened 4 months ago

cpommier commented 4 months ago

When searching for list of germplasms, we should know if that plant material can be ordered in the genebank.

the easy approach would be to add an available field, but maybe not enough:

"germplasm":{"available": "restricted|public|dependingOnStock|..."

Maybe something more complete like :

"germplasm":{
   "distributors": [
        {
          "institute": {
            "logo": null,
            "acronym": "INRAE_UMR_ABCD",
            "address": "5 Chemin de ABCD, Paris, France",
            "webSite": "https://www.clermont.inrae.fr/umr1095",
            "organisation": "INRAE",
            "instituteCode": "FRA1234",
            "instituteName": "Cereal ABCD",
            "instituteType": "Public-sector research organization"
          },
          "accessionNumber": "6027",
          "distributionStatus": "Available with restrictions"
        }
      ],
}
cpommier commented 4 months ago

@Nicolas971 @cmichotey

cpommier commented 4 months ago

@maudmarty

Nicolas971 commented 4 months ago

It could be interesting to have distributionStatus with a list of predefined values. Maybe even a distributionDescription since sometimes collection managers can only answer orders a specific time of the year or they have other kind of limitation.

daveneti commented 4 months ago

I would not recommend adding too much to Germplasm, since it is used for more that just genebank plant material ordering. Pethaps a separate endpoint is required for this?

aliceboizet commented 4 months ago

To avoid having redundant information between distributors and collection, could we just add the available status into the collections field ? And the other information about the distributors could be retrieved with the GET collection endpoint (issue #577 ) ?
Something like that :

{
[...],
  "result": {
    "data": [
      {
        "accessionNumber": "A0000003",
        [...]
        "collections": [
             { 
                   "collectionDbId": "123", 
                   "collectionName": "Tournesol",
                   "distributionStatus": "restricted|public|dependingOnStock|..."
              }
         ],
        [...]
      }
    ]
  }
}
cpommier commented 4 months ago

@aliceboizet I am not very comfortable with that proposition. What do you think @Nicolas971 @cmichotey @raflo64 I would really stick to the availability as a property of the germplasm, not of the collection. Am I missing something ?

aliceboizet commented 4 months ago

@aliceboizet I am not very comfortable with that proposition. It could be sub optimal with the rare-basket use case. What do you think @Nicolas971 @cmichotey @Raflo64 I would really stick to the availability as a property of the germplasm, not of the collection. Am I missing something ?

I think you misunderstood my proposition. It is really close to what you proposed but instead having a new field "distributors" with the availability status in it, I proposed to put the availability status into the "collections" field (in the germplasm endpoint response). This proposition is relevant only if you confirm that you need to have several collections on one germplasm (I sent an email about that), and so we need the availability status depending on the collection.

cmichotey commented 4 months ago

I would not put the availability into collection, because it is a status of the germplasm and not the whole collection. Maybe just a typed availability property the main part of germplasm should suffice.

aliceboizet commented 4 months ago

I would not put the availability into collection, because it is a status of the germplasm and not the whole collection. Maybe just a typed availability property the main part of germplasm should suffice.

Having the availability property in the main part of germplasm sounds good to me (because I think that a germplasm would belong to only one collection). But if there can be several collections for the germplasm (as Cyril requested in #570), how do you know to which collection the availability status applies ?

cmichotey commented 4 months ago

As far as I'm concerned, an accession can only have one availability status (whether it can be ordered via a genbank or not). Status is a property of the accession, not of a collection.

The notion of collection is another problem. What do we mean by collection? If it is a physical collection, then it seems to me that an accession can belong to only one collection, and therefore have only one distribution status. If it is a way of grouping accessions and therefore creating a list, then an accession can belong to several collections. However, it will still have only one distribution status, independent of the collection chosen.

daveneti commented 4 months ago

This very much Genebank specific request. In a plant breeding database the 'available' property and any additional information about how to order Germplasm would always be false/not present. I would have a separate endpoint that can be used for getting information about ordering Germplasm, which does not need to be implemented in non-genebank databases that use Germplasm.