plantbreeding / BrAPI

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

Add germplasm-mcpd for full MCPD details #213

Closed cpommier closed 6 years ago

cpommier commented 6 years ago

We need to have the equivalent of the following JSON return type

## Germplasm Details by germplasmDbId [/brapi/v1/germplasm/{germplasmDbId}/mcpd]
OR : [/brapi/v1/germplasm-mcpd/{germplasmDbId}] (maybe less error prone)
Scope: CORE. Status: ACCEPTED. 

###### Response data types
...
### Germplasm search by germplasmDbId [GET /brapi/v1/germplasm-mcpd/{germplasmDbId}]
+ Parameters
   + germplasmDbId (required, string, `10.564/qeh654/tty:2015`) ... The internal id of the germplasm
+ Response 200 (application/json)

        {
  "metadata": {
    "datafiles": [
      "string"
    ],
    "pagination": {
      "currentPage": 0,
      "pageSize": 0,
      "totalCount": 0,
      "totalPages": 0
    },
    "status": [
      {
        "code": "string",
        "name": "string"
      }
    ]
  },
  "result": {
    "data": [
     {
    "accessionNumber": "string",
    "acquisitionDate": "string",
    "biologicalStatusOfAccessionCode": "string",
    "breeder": {
      "accessionCreationDate": 0,
      "accessionNumber": "string",
      "collectors": "string",
      "deregistrationYear": 0,
      "distributionStatus": "string",
      "germplasmPUI": "string",
      "institute": {
        "acronym": "string",
        "address": "string",
        "instituteCode": "string",
        "instituteName": "string",
        "instituteType": "string",
        "logo": "string",
        "organisation": "string",
        "webSite": "string"
      },
      "materialType": "string",
      "registrationYear": 0
    },
    "children": [
      {
        "crossingPlan": "string",
        "crossingYear": "string",
        "familyCode": "string",
        "firstParentName": "string",
        "firstParentPUI": "string",
        "firstParentType": "string",
        "secondParentName": "string",
        "secondParentPUI": "string",
        "secondParentType": "string",
        "sibblings": [
          {
            "name": "string",
            "pui": "string",
            "value": "string"
          }
        ]
      }
    ],
    "collectingSite": {
      "latitude": 0,
      "longitude": 0,
      "siteId": 0,
      "siteName": "string",
      "siteType": "string"
    },
    "collection": [
      {
        "germplasmCount": 0,
        "germplasmRef": {
          "name": "string",
          "pui": "string",
          "value": "string"
        },
        "id": 0,
        "name": "string",
        "type": "string"
      }
    ],
    "collector": {
      "accessionCreationDate": 0,
      "accessionNumber": "string",
      "collectors": "string",
      "deregistrationYear": 0,
      "distributionStatus": "string",
      "germplasmPUI": "string",
      "institute": {
        "acronym": "string",
        "address": "string",
        "instituteCode": "string",
        "instituteName": "string",
        "instituteType": "string",
        "logo": "string",
        "organisation": "string",
        "webSite": "string"
      },
      "materialType": "string",
      "registrationYear": 0
    },
    "comment": "string",
    "commonCropName": "string",
    "countryOfOriginCode": "string",
    "defaultDisplayName": "string",
    "descriptors": [
      {
        "name": "string",
        "pui": "string",
        "value": "string"
      }
    ],
    "distributors": [
      {
        "accessionCreationDate": 0,
        "accessionNumber": "string",
        "collectors": "string",
        "deregistrationYear": 0,
        "distributionStatus": "string",
        "germplasmPUI": "string",
        "institute": {
          "acronym": "string",
          "address": "string",
          "instituteCode": "string",
          "instituteName": "string",
          "instituteType": "string",
          "logo": "string",
          "organisation": "string",
          "webSite": "string"
        },
        "materialType": "string",
        "registrationYear": 0
      }
    ],
    "donors": [
      {
        "donorAccessionNumber": "string",
        "donorGermplasmPUI": "string",
        "donorInstituteCode": "string"
      }
    ],
    "evaluationSites": [
      {
        "latitude": 0,
        "longitude": 0,
        "siteId": 0,
        "siteName": "string",
        "siteType": "string"
      }
    ],
    "genealogy": {
      "crossingPlan": "string",
      "crossingYear": "string",
      "familyCode": "string",
      "firstParentName": "string",
      "firstParentPUI": "string",
      "firstParentType": "string",
      "secondParentName": "string",
      "secondParentPUI": "string",
      "secondParentType": "string",
      "sibblings": [
        {
          "name": "string",
          "pui": "string",
          "value": "string"
        }
      ]
    },
    "geneticNature": "string",
    "genus": "string",
    "genusSpecies": "string",
    "genusSpeciesSubtaxa": "string",
    "germplasmDbId": "string",
    "germplasmName": "string",
    "germplasmPUI": "string",
    "groupId": 0,
    "holdingGenbank": {
      "acronym": "string",
      "address": "string",
      "instituteCode": "string",
      "instituteName": "string",
      "instituteType": "string",
      "logo": "string",
      "organisation": "string",
      "webSite": "string"
    },
    "holdingInstitute": {
      "acronym": "string",
      "address": "string",
      "instituteCode": "string",
      "instituteName": "string",
      "instituteType": "string",
      "logo": "string",
      "organisation": "string",
      "webSite": "string"
    },
    "instituteCode": "string",
    "instituteName": "string",
    "originSite": {
      "latitude": 0,
      "longitude": 0,
      "siteId": 0,
      "siteName": "string",
      "siteType": "string"
    },
    "panel": [
      {
        "germplasmCount": 0,
        "germplasmRef": {
          "name": "string",
          "pui": "string",
          "value": "string"
        },
        "id": 0,
        "name": "string",
        "type": "string"
      }
    ],
    "pedigree": "string",
    "photo": {
      "copyright": "string",
      "description": "string",
      "fileName": "string",
      "photoName": "string",
      "thumbnailFileName": "string"
    },
    "population": [
      {
        "germplasmCount": 0,
        "germplasmRef": {
          "name": "string",
          "pui": "string",
          "value": "string"
        },
        "id": 0,
        "name": "string",
        "type": "string"
      }
    ],
    "presenceStatus": "string",
    "seedSource": "string",
    "source": "string",
    "species": "string",
    "speciesAuthority": "string",
    "subtaxa": "string",
    "subtaxaAuthority": "string",
    "synonyms": [
      "string"
    ],
    "taxonCommonNames": [
      "string"
    ],
    "taxonIds": [
      {
        "sourceName": "string",
        "taxonId": "string"
      }
    ],
    "taxonSynonyms": [
      "string"
    ],
    "typeOfGermplasmStorageCode": "string",
    "url": "string"
  }
    ]
  }
}
cpommier commented 6 years ago

I obviously forgot to click on submit during the hackathon, sorry.

guignonv commented 6 years ago

Do you mean that some fields should be added to the actual Germplasm Details By Germplasm DbId call or do you need a new dedicated call? And in the last case, why did we already merged MCDP fields to the "Germplasm Details By Germplasm DbId" call then?

But if it's just adding field then, maybe you should explicitly list which ones are currently missing and what their definition should be.

patrick-koenig commented 6 years ago

First of all, I would like to say: We from IPK Gatersleben strongly support this new advanced germplasm detail endpoint because it better fits demands of genebank information systems. :smiley: :+1:

As I remember Cyril correctly it is meant as an additional new API-call with extended data compared to the already existing less detailed /germplasm/{id} call.

But what was not decided yet is the URL for this new call. There were two variants suggested:

or:

Personally, I prefer the first variant with the "MCPD-switch" added to the existing /germplasm/{id} call, because this is in general more consistent to the already existing pedigree- and markerprofiles-subcalls of /germplasm/{id}.

BrapiCoordinatorSelby commented 6 years ago

The object that @cpommier posted has WAY more detail than is defined by the MCPD, and I think it is missing some MCPD fields.

I'm going to make the /germplasm/{id}/mcpd call follow the MCPD 2.1 specification as defined here: https://www.bioversityinternational.org/fileadmin/user_upload/online_library/publications/pdfs/FAOBIOVERSITY_MULTI-CROP_PASSPORT_DESCRIPTORS_V.2.1_2015_2020.pdf

If needed, I could also make another call (maybe like /germplasm/{id}/details) which looks more like Cyril's example. To do this I might need some help creating a helpful description for each field. Also I think there are a few duplicate fields which need to be removed or justified. (for example "genusSpecies" vs "species")

Let me know your thoughts as soon as possible so I can get changes into v1.3.

langeipk commented 6 years ago

In my opinion, BrAPI should use standards 1:1 Thius, we can announce, that BrAPI GERMPLASM resource is MCPD compatible. Additional attributes may implemented as separate call in the germplasm resource. e.g. getCustomAttributesForDBID

BrapiCoordinatorSelby commented 6 years ago

I grouped a few fields together into logical sub objects and I made every multi-value field into an array instead of a semicolon separated string. Other than those small changes, '/germplasm/{dbid}/mcpd' should be 1 to 1 compliant with MCPD v2.1.

I'm closing this issue because the original stated problem is resolved. @cpommier if you'd like to talk about adding a new call which supports all your data fields, or adding specific fields to the existing germplasm call. please make a new issue or send me an email.

cpommier commented 6 years ago

Hi, ok, we'll create an issue for a germplasm-full call or something like that.

thanks for finishing this.

cpommier commented 6 years ago

test @cpommier