Open BrapiCoordinatorSelby opened 1 year ago
There is a one-to-one relationship between cross and germplasm. If a cross is successful then a germplasm is created, so a Cross would zero or one germplasm. A Germplasm is created by a cross in the case of both generative and derivative breeding methods there are cases when a cross is not known or recorded. These include often self-crossing, open pollination, mutation etc. So a germplasm would have a zero or one crosses.
To the JSON schema model
To the Open API model
@BrapiCoordinatorSelby two possibly useful endpoint changes might be:
parent1
and parent2
(by germplasmDbId would likely be most useful),I don't know how a client would know which germplasmDbId to send for "parent1" vs. "parent2", so 2. would probably be more useful (though more work to implement).
And for the search endpoint, I'm not sure if it could provide a way to get crosses with both all and any parent germplasmDbIds. Basically I could see potential use cases for an AND or OR type search. The search request body could contain two arrays of parent germplasmDbIds, one for "parent1" and one for "parent2", this would allow AND and OR type requests, but the implementation would probably need to check "parent1" and "parent2" against both fields since they don't seem to have a distinct meaning (like male/female). Also, are there use cases for crosses with more than 2 parents of record? That would further complicate things.
This is what the GET endpoint currently returns for the parents according to SwaggerHub.
"parent1": {
"germplasmDbId": "d34b10c3",
"germplasmName": "TME_419",
"observationUnitDbId": "2e1926a7",
"observationUnitName": "my_Plot_9001",
"parentType": "MALE"
},
"parent2": {
"germplasmDbId": "d34b10c3",
"germplasmName": "TME_419",
"observationUnitDbId": "2e1926a7",
"observationUnitName": "my_Plot_9001",
"parentType": "MALE"
},
I agree that both AND and OR searches would be useful. Convention is that Female is usually parent1 (see breedbase BrAPI implementation, Purdy notation, etc) but a check would probably be warranted. Yes, there are use cases where the user would want to track a set of possible (male) parents.
@daveneti from Slack
@BrapiCoordinatorSelby from Slack