BrAPI V1.3
Overview
The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. BrAPI V1.3 was released on November 1, 2018. This version is now archived but still used in the Field Book app so this might also be implemented in CB in a future sprint using the correct EBS data model.
The following endpoints are needed for full Field Book BrAPI functionality:
Reference CB-API call: POST /crop-programs-search
Request (string) | Description | Required in Field Book app? (Y/N) | CB-DB Reference |
|---|
Request (string) | Description | Required in Field Book app? (Y/N) | CB-DB Reference |
|---|---|---|---|
commonCropName | Filter by the common crop name. Exact match. |
| tenant.crop.crop_name |
programName | Filter by program name. Exact match. |
| tenant.program.program_name |
abbreviation | Filter by program abbreviation. Exact match. |
| tenant.program.program_code |
Response Fields | Required in Field Book app? (Y/N) | Type | Description | CB-DB Reference | CB API Reference | Sample Response |
|---|
Response Fields | Required in Field Book app? (Y/N) | Type | Description | CB-DB Reference | CB API Reference | Sample Response |
|---|---|---|---|---|---|---|
abbreviation |
| string | An abbreviation which represents this program | tenant.program.program_code | cropProgramCode | {
"metadata": {
"datafiles": [],
"pagination": {
"currentPage": 0,
"pageSize": 2,
"totalCount": 2,
"totalPages": 1
},
"status": []
},
"result": {
"data": [
{
"abbreviation": "P1",
"commonCropName": "Tomatillo",
"documentationURL": "https://brapi.org",
"leadPerson": "Name Nameson",
"leadPersonDbId": "person1",
"leadPersonName": "Name Nameson",
"name": "Program 1",
"objective": "Global Population Improvement",
"programDbId": "1",
"programName": "Program 1"
},
{
"abbreviation": "P2",
"commonCropName": "Tomatillo",
"documentationURL": "https://brapi.org",
"leadPerson": "Name Nameson",
"leadPersonDbId": "person1",
"leadPersonName": "Name Nameson",
"name": "Program 2",
"objective": "XYZ",
"programDbId": "2",
"programName": "Program 2"
}
]
}
}
|
commonCropName |
| string | Common name for the crop which this program is for | tenant.crop.crop_name | cropName | |
documentationURL |
| string (uri) | A URL to the human readable documentation of this object | CB Swagger Link (dynamically retrieved depending on the instance used) | NEW | |
leadPersonDbId |
| string | The unique identifier of the program leader | no CB-DB counterpart, to be supported in the future sprint, currently stored in CS-DB and CB needs to fetch it For this sprint, return null | NA | |
leadPersonName |
| string | The name of the program leader | no CB-DB counterpart, to be supported in the future sprint | NA | |
objective |
| string | The primary objective of the program | tenant.program.description | description | |
programName* |
| string | Human readable name of the program | tenant.program.program_name | cropProgramName | |
programDbId* |
| string | The ID which uniquely identifies the program | cropProgramDbId |
Reference CB-API call: POST /experiments-search
experimentType: "Breeding Trial"Is trial the same as experiments with Breeding Trial type in general?
How do we collect data for other experiment types e.g. Gen. Nursery, ICN, and Observation?
Request (string) | Description | CB-DB Reference |
|---|
Request (string) | Description | CB-DB Reference |
|---|---|---|
commonCropName | Common name for the crop associated with this trial | tenant.crop.crop_name |
programDbId | Program filter to only return trials associated with given program id | tenant.program.program_id |
locationDbId | Filter by location | experiment.location.location_id |
active | Filter active status true/false | what does active mean? not voided? or related to experiment status? |
Response | Type | Description | CB-DB Reference | Example |
|---|
Response | Type | Description | CB-DB Reference | Example |
|---|---|---|---|---|
active | boolean | Is this trial currently active | not voided? or related to experiment status? | {
"active": false,
"additionalInfo": {
"donorName": "Donor1",
"publications": "doi:10.2345/GEZG3T23535",
"specialProject": "Project1"
},
"commonCropName": "Tomatillo",
"documentationURL": "https://brapi.org",
"endDate": "2013-07-05",
"programDbId": "1",
"programName": "Program 1",
"startDate": "2013-01-01",
"studies": [
{
"locationDbId": "1",
"locationName": "Location 1",
"studyDbId": "1001",
"studyName": "Study 1"
},
{
"locationDbId": "1",
"locationName": "Location 1",
"studyDbId": "1002",
"studyName": "Study 2"
}
],
"trialDbId": "101",
"trialName": "Peru Yield Trial 1"
},
|
additionalInfo | object | Additional arbitrary info | metadata? | |
commonCropName | string | Common name for the crop associated with this trial | tenant.crop.crop_name | |
documentationURL | string (uri) | A URL to the human-readable documentation of this object | swagger documentation link to be confirmed w/ CS team | |
endDate | string (date) | The date this trial ends | No EBS counterpart, return null | |
programDbId | string | The ID which uniquely identifies a program | experiment.experiment.program_id | |
programName | string | The human readable name of a program | tenant.program.program_name <- experiment.experiment.program_id | |
startDate | string (date) | The date this trial started | No EBS counterpart, return null | |
studies | array[object] | List of studies inside this trial | List of occurrences May cause performance issue | |
| string |
| experiment.experiment.experiment_id<-experiment.occurrence<-experiment.location_occurrence_group<-experiment.location.id | |
| string |
| experiment.experiment.experiment_id<-experiment.occurrence<-experiment.location_occurrence_group<-experiment.location.id<-experiment.location_name | |
| string |
| experiment.occurrence.occurrence_id | |
| string |
| experiment.occurrence.occurrence_name | |
trialDbId* | string | The ID which uniquely identifies a trial | ||
trialName* | string | The human readable name of a trial | experiment.experiment.experiment_name |
Reference CB-API call: POST occurrences-search
Request (string) | Description | Example | CB-DB Reference |
|---|
Request (string) | Description | Example | CB-DB Reference |
|---|---|---|---|
commonCropName | Common name for the crop associated with this trial | tenant.crop.crop_name | |
studyTypeDbId | Filter based on study type unique identifier | study type is deprecated |
|
programDbId | Program filter to only return studies associated with given program id. |
| tenant.program.program_id |
locationDbId |
|
| experiment.location.location_id |
seasonDbId |
|
| tenant.season.season_id |
trialDbId |
|
| experiment.experiment.experiment_ id |
active | Filter active status true/false |
|
|
Response | Type | Description | CB-DB Reference | Example |
|---|
Response | Type | Description | CB-DB Reference | Example |
|---|---|---|---|---|
active | string | Is this study currently active | not voided? or related to experiment status? | {
"active": "true",
"additionalInfo": {
"studyObjective": "Increase yield"
},
"commonCropName": "Tomatillo",
"documentationURL": "https://brapi.org",
"endDate": "2014-01-01",
"locationDbId": "1",
"locationName": "Location 1",
"name": "Study 1",
"programDbId": "1",
"programName": "Program 1",
"seasons": [
{
"season": "fall",
"seasonDbId": "1",
"year": "2011"
},
{
"season": "winter",
"seasonDbId": "2",
"year": "2012"
}
],
"startDate": "2013-01-01",
"studyDbId": "1001",
"studyName": "Study 1",
"studyType": "Yield study",
"studyTypeDbId": "2",
"studyTypeName": "Yield study",
"trialDbId": "101",
"trialName": "Peru Yield Trial 1"
},
|
additionalInfo | object | Additional arbitrary info | metadata? | |
commonCropName | string | Common name for the crop associated with this study | tenant.crop.crop_name | |
documentationURL | string (uri) | A URL to the human-readable documentation of this object | ||
endDate | string (date) | The date the study ends | No EBS counterpart | |
locationDbId | string | The ID which uniquely identifies a location | experiment.occurrence.occurrence_id<-experiment.location_occurrence_group<-experiment.location.id | |
locationName | string | The human readable name for a location | experiment.experiment.experiment_id<-experiment.occurrence<-experiment.location_occurrence_group<-experiment.location.id | |
programDbId | string | The ID which uniquely identifies a program within the given database server |
| |
programName | string | The humane readable name of a program |
| |
seasons | array[object] | List of seasons over which this study was performed. | use experiment.season_id | |
season | string | Name of the season. ex. 'Spring', 'Q2', 'Season A', etc. | experiment.season_name | |
seasonDbId | string | The ID which uniquely identifies a season | use experiment.season_id | |
year | string | The 4-digit year of the season. | experiment.experiment_year | |
startDate | string (date) | The date this study started | No EBS counterpart | |
studyDbId | string | The ID which uniquely identifies a study within the given database server | experiment.occurrence.occurrence_id |
|
studyName | string | The human readable name of a study | occurrence_name |
|
studyTypeDbId | string | The unique identifier of the type of study being performed. | deprecated |
|
studyTypeName | string | The name of the type of study being performed. ex. "Yield Trial", etc | deprecated |
|
trialDbId | string | The ID which uniquely identifies a trial | experiments with Breeding Trial experiment type |
|
trialName | string | The human readable name of a trial | experiments with Breeding Trial experiment type |
|
Retrieve the information of the study required for field data collection
An additionalInfo field was added to provide a controlled vocabulary for less common data fields.
Linked data
Observation Variables:
/brapi/v1/studies/{studyDbId}/observationvariablesGermplasm:
/brapi/v1/studies/{studyDbId}/germplasmObservation Units:
/brapi/v1/studies/{studyDbId}/observationunits