plantbreeding / BrAPI

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

New endpoints POST /events and POST /breedingmethods #585

Open feserm opened 1 year ago

feserm commented 1 year ago

Kind of the same question/proposal:

Endpoints could look similar to the general concept: POST /events body:

[
  {
    "additionalInfo": {},
    "eventDateRange": {
      "discreteDates": [
        "string"
      ],
      "endDate": "string",
      "startDate": "string"
    },
    "eventDescription": "string",
    "eventParameters": [
      {
        "code": "string",
        "description": "string",
        "name": "string",
        "units": "string",
        "value": "string",
        "valueDescription": "string",
        "valuesByDate": [
          "string"
        ]
      }
    ],
    "eventType": "string",
    "observationUnitDbIds": [
      "string"
    ],
    "studyDbId": "string",
    "studyName": "string"
  }
]

POST /breedingmethods body:

[
  {
    "abbreviation": "string",
    "breedingMethodName": "string",
    "description": "string"
  }
]
BrapiCoordinatorSelby commented 1 year ago

I completely agree that POST /events should exist. The initial use case for Events was sharing them from a database that already had them collected to a crop modeling solution. There hasn't yet been a use case proposed for collecting new events via BrAPI, but I think there should be.

Breeding Method is a little bit more questionable. It was assumed that Breeding Methods would be relatively static, the appropriate methods would be loaded into a system as part of a configuration or system setup. Again, there hasn't yet been a use case proposed for creating new breeding methods in one tool and pushing them to another tool via BrAPI. I don't know how realistic that is. If you have an example use case please do share it.

timparsons commented 1 year ago

🙋‍♂️ I have a use case for POST /breedingmethods:

If using a tool like brapi-sync, the target system may need to have breeding methods created in order to import germplasm. And in the case of brapi-sync, it's a middle-man moving data between the two systems, so is dependent on an endpoint for creating breeding methods existing in the BrAPI spec

feserm commented 1 year ago

The use case I had in mind was to have a data warehouse, which is initially empty and needs to be filled from scratch. It would use some kind of ETL tool to extract, transform and load a dump or snapshot of an external DB (e.g. an institutionally database). My idea was that this tool would use POST (and maybe later PUT) calls to do so. So I guess my use case is similar/the same as @timparsons's use case. Other options would be for me implementing non-standard BrAPI-like POST calls or load the breeding methods/events in a seperate initialization phase to the DWH. Both I want to try to avoid.