plantbreeding / BrAPI

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

Add a new service Collection #577

Open aliceboizet opened 1 year ago

aliceboizet commented 1 year ago

In the Germplasm service, there is the parameter "collection" which enables to get germplasm belonging to a specific collection. We need to have a new service to get the list of available germplasm collections.

@cpommier proposal for Collection model :

{
"germplasmCount": 509,  
"collectionDbId": 127,  
"collectionName": "Collection blé du projet Whealbi",  
"collectionType": "Work collection"
}  

This issue is related to #558 and #570

cpommier commented 1 year ago

Discussion with @aliceboizet : Get - /germplasm:

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
        "accessionNumber": "A0000003",
        [...]
        "breedingMethodName": "Male Backcross",
        "collection": "Rice Diversity Panel 1 (RDP1)", // leave as it is for backward compatibility ?
        "collectionDbIds": [
              "urn:INRAE:collection:1234",
              "urn:INRAE:collection:12345",
]
        "commonCropName": "Maize",
        [...]
      }
    ]
  }
}

GET - /collection

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
"germplasmCount": 509,  
"collectionDbId": "urn:INRAE:collection:1234",  
"collectionName": "Collection blé du projet Whealbi",  
"collectionType": "Work collection"
}
]
}
}

Plus possibly the addition of the following fields in colleciton: "institutionName": INRAE, "institutionFAOCode": null, "institutionAcronym": null, "organization": null, "doicollection": null, "crb": { "nom_crb": "CRB Plantes Tropicales", "doicrb": null }

cpommier commented 1 year ago

Other possibility :

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
        "accessionNumber": "A0000003",
        [...]
        "breedingMethodName": "Male Backcross",
        "collection": "Rice Diversity Panel 1 (RDP1)", // leave as it is for backward compatibility ?
        "collections": [
             { "collectionDbId": "urn:INRAE:collection:1234","collectionName": "Collection blé du projet Whealbi"}
             { "collectionDbId": "urn:INRAE:collection:12345", "collectionName": "BRC core collection "}
]
        "commonCropName": "Maize",
        [...]
      }
    ]
  }
}

plus GET - /collection

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
"germplasmCount": 509,  
"collectionDbId": "urn:INRAE:collection:1234",  
"collectionName": "Collection blé du projet Whealbi",  
"collectionType": "Work collection"
}
]
}
}
BrapiCoordinatorSelby commented 1 year ago

This all looks good to me. Having collections:[] with both DbId and Name makes sense if this info is going to be presented to a user. The additional fields for the Collection object also make sense to me, except crb. What is crb?

cpommier commented 1 year ago

crb should be BRC, it stands for biological resource center aka genebank. But we need to discuss this with a few other people, the use case for these fields is not clear to me yet.

cpommier commented 1 year ago

Current proposition @aliceboizet Franciane @nicolas971

Other possibility :

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
        "accessionNumber": "A0000003",
        [...]
        "breedingMethodName": "Male Backcross",
        "collection": "Rice Diversity Panel 1 (RDP1)", // leave as it is for backward compatibility ?
        "collections": [
             { "collectionDbId": "urn:INRAE:collection:1234","collectionName": "Collection blé du projet Whealbi"}
             { "collectionDbId": "urn:INRAE:collection:12345", "collectionName": "BRC core collection "}
]
        "commonCropName": "Maize",
        [...]
      }
    ]
  }
}

plus GET - /collection

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
          "germplasmCount": 509,  
          "collectionDbId": "urn:INRAE:collection:1234",  
          "collectionPUI": "http://doi.org/10.1554/WheatColl",
          "collectionName": "Collection blé du projet Whealbi",  
          "collectionType": "Work collection",
          "instituteName": "    Plant Biology and Breeding, INRAE Montpellier",
          "instituteOrganization": "INRAE",
          "instituteCode": "FRA041", //This is the FAO wiews code, to precise in the documentation: https://www.fao.org/wiews/data/organizations/en
          "genebank": {// Biological Resource Center aka Genebanks
                  "genebankName": "CRB Plantes Tropicales",
                   "genebankPUI": null
           }

       }
    ]
  }
}
cpommier commented 1 year ago

@BrapiCoordinatorSelby it seems ok to the four of us and ready to be discussed for adoption at the next brapi hackathon.

BrapiCoordinatorSelby commented 1 year ago

yup, looks good to me.

Two comments: 1

"collection": "Rice Diversity Panel 1 (RDP1)", // leave as it is for backward compatibility ?

It will be kept and marked as deprecated for the next minor version spec update (v2.2) for backward compatibility. It will be removed permanently in the next major update (v3.0)

2

"instituteName": "Plant Biology and Breeding, INRAE Montpellier", "instituteOrganization": "INRAE",

What is the difference between instituteName and instituteOrganization? It seems like the MCPD standard model uses instituteName, instituteCode and sometimes instituteAddress to identify an institute.

Gabriel-Besombes commented 6 months ago

BrAPI Hackathon 2024 : change name of "germplasmCount" to "collectionSize" for naming consistency with lists.

cpommier commented 6 months ago

What about using /germplasmCollection rather that /colection to avoid confusion ? @aliceboizet @BrapiCoordinatorSelby

aliceboizet commented 6 months ago

@cpommier We should redefine what we mean exactly by collection and see how it is different from a germplasm list. If the collection is a physical collection, then we would have only one collection per germplasm.

cpommier commented 5 months ago

Hi @BrapiCoordinatorSelby , With Alice, Célia, Francianne, Nicolas and I we reviewed this, and we stick to the following proposition (same as above)

Is that ok with you ?

GET /germplasm
//Addition of the collections ARRAY
{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
        "accessionNumber": "A0000003",
        [...]
        "breedingMethodName": "Male Backcross",
        "collection": "Rice Diversity Panel 1 (RDP1)", // leave as it is for backward compatibility ?
        "collections": [
             { "collectionDbId": "urn:INRAE:collection:1234",
                "collectionName": "Collection blé du projet Whealbi"},
             { "collectionDbId": "urn:INRAE:collection:12345", 
                "collectionName": "BRC core collection "}
           ]
        "commonCropName": "Maize",
        [...]
      }
    ]
  }
}
POST - /search/germplasm
Replace search field
"collections"
with
"collectionNames"
"collectionDbIds"

plus GET - /collection // Get the list of possible collectionName and collectionDbId to use as filter for /serch/germplasm for fields collection and collections

{
  "@context": [
    "https://brapi.org/jsonld/context/metadata.jsonld"
  ],
  "metadata": {
   [...]
    },
    "status": [
      [...]
    ]
  },
  "result": {
    "data": [
      {
          "germplasmCount": 509,  
          "collectionDbId": "urn:INRAE:collection:1234",  
          "collectionPUI": "http://doi.org/10.1554/WheatColl",
          "collectionName": "Collection blé du projet Whealbi",  
          "collectionType": "Work collection",
          "instituteName": "    Plant Biology and Breeding, INRAE Montpellier",
          "instituteOrganization": "INRAE",
          "instituteCode": "FRA041", //This is the FAO wiews code, to precise in the documentation: https://www.fao.org/wiews/data/organizations/en
          "genebank": {// Biological Resource Center aka Genebanks
                  "genebankName": "CRB Plantes Tropicales",
                   "genebankPUI": null
           }

       }
    ]
  }
}
daveneti commented 5 months ago

Hi Cyril, looks good :) should the endpoint be plural? GET - /collections

cpommier commented 5 months ago

probably, I trust Peter to take care of the consistency check.