brapi_post_search_observationunits: post /search/observationunits

View source: R/brapi_post_search_observationunits.R

brapi_post_search_observationunitsR Documentation

post /search/observationunits

Description

Submit a search request for ObservationUnits

Usage

brapi_post_search_observationunits(
  con = NULL,
  externalReferenceIDs = "",
  externalReferenceSources = "",
  germplasmDbIds = "",
  germplasmNames = "",
  includeObservations = NA,
  locationDbIds = "",
  locationNames = "",
  observationLevelRelationships = "",
  observationLevels = "",
  observationUnitDbIds = "",
  observationVariableDbIds = "",
  observationVariableNames = "",
  page = 0,
  pageSize = 1000,
  programDbIds = "",
  programNames = "",
  studyDbIds = "",
  studyNames = "",
  trialDbIds = "",
  trialNames = ""
)

Arguments

con

list; required: TRUE; BrAPI connection object

externalReferenceIDs

vector of type character; required: FALSE; List of external reference IDs. Could be a simple strings or a URIs. (use with externalReferenceSources parameter); default: "", when using multiple values supply as c("value1", "value2").

externalReferenceSources

vector of type character; required: FALSE; List of identifiers for the source system or database of an external reference (use with externalReferenceIDs parameter); default: "", when using multiple values supply as c("value1", "value2").

germplasmDbIds

vector of type character; required: FALSE; List of unique database identifiers, which uniquely identify germplasm to search for; default: "", when using multiple values supply as c( "value1", "value2").

germplasmNames

vector of type character; required: FALSE; List of human readable names to identify germplasm to search for; default: "", when using multiple values supply as c("value1", "value2").

includeObservations

logical; required: FALSE; Use this parameter to include a list of observations embedded in each ObservationUnit object. CAUTION - Use this parameter at your own risk. It may return large, unpaginated lists of observation data. Only set this value to TRUE if you are sure you need to.

locationDbIds

vector of type character; required: FALSE; The unique location identifier(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

locationNames

vector of type character; required: FALSE; A human readable location name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

observationLevelRelationships

data.frame; required: FALSE; Data.frame of observation levels to indicate the granularity level at which the measurements are taken. Each row in the data.frame defines the level code, level name (levelName), and the level order, as integer, where that level exists in the hierarchy of levels. levelOrders lower numbers are at the top of the hierarchy (i.e. field -> 0) and higher numbers are at the bottom of the hierarchy (ie plant > 6). levelCode is an identifier code for this level tag. Identify this observation unit by each level of the hierarchy, where it exists.

The Examples section shows an example of how to construct the observationLevelRelationships argument as a data.frame.

observationLevels

data.frame; required: FALSE; A data.frame of Observation levels, which indicate the granularity level at which the measurements are taken. The observationLevels argument data.frame can contain the following columns:

  • levelName character; required: FALSE; A name for this level.

  • levelOrder interger; required: FALSE; levelOrder defines, where that level exists in the hierarchy of levels. levelOrder's lower numbers are at the top of the hierarchy (i.e. field -> 1) and higher numbers are at the bottom of the hierarchy (i.e. plant -> 9).

The Examples section shows an example of how to construct the observationLevels argument as a data.frame.

observationUnitDbIds

vector of type character; required: FALSE; The unique database identifier of an observation unit; default: "", when using multiple values supply as c("value1", "value2").

observationVariableDbIds

vector of type character; required: FALSE; The database identifiers of Variables to search for; default: "" , when using multiple values supply as c("value1", "value2").

observationVariableNames

vector of type character; required: FALSE; The names of Variables to search for; default: "", when using multiple values supply as c("value1", "value2").

page

integer; required: FALSE; Used to request a specific page of data to be returned. The page indexing starts at 0 (the first page is page = 0). Default is 0.

pageSize

integer; required: FALSE; The size of the pages to be returned. Default is 1000.

programDbIds

vector of type character; required: FALSE; Unique program database identifiers to search for; default: "", when using multiple values supply as c("value1", "value2").

programNames

vector of type character; required: FALSE; A program names to search for; default: "", when using multiple values supply as c("value1", "value2").

studyDbIds

vector of type character; required: FALSE; List of unique database study identifiers to search for; default: "", when using multiple values supply as c("value1", "value2").

studyNames

vector of type character; required: FALSE; List of study names to filter search results; default: "", when using multiple values supply as c("value1", "value2").

trialDbIds

vector of type character; required: FALSE; The identifiers, which uniquely identify trials to search for; default: "", when using multiple values supply as c("value1", "value2").

trialNames

vector of type character; required: FALSE; The human readable names of trials to search for; default: "", when using multiple values supply as c("value1", "value2").

Details

Submit a search request for ObservationUnits. Function will return either the search results (Status 200 for an immediate response) or a searchResultsDbId (Status 202 for both a saved and an asynchronous search).

Value

data.frame

Author(s)

Maikel Verouden

References

BrAPI SwaggerHub

See Also

Other brapi-phenotyping: brapi_get_events(), brapi_get_images_imageDbId(), brapi_get_images(), brapi_get_methods_methodDbId(), brapi_get_methods(), brapi_get_observationlevels(), brapi_get_observations_observationDbId(), brapi_get_observations_table(), brapi_get_observations(), brapi_get_observationunits_observationUnitDbId(), brapi_get_observationunits_table(), brapi_get_observationunits(), brapi_get_ontologies(), brapi_get_scales_scaleDbId(), brapi_get_scales(), brapi_get_search_images_searchResultsDbId(), brapi_get_search_observations_searchResultsDbId(), brapi_get_search_observationunits_searchResultsDbId(), brapi_get_search_variables_searchResultsDbId(), brapi_get_traits_traitDbId(), brapi_get_traits(), brapi_get_variables_observationVariableDbId(), brapi_get_variables(), brapi_post_images(), brapi_post_methods(), brapi_post_observations(), brapi_post_observationunits(), brapi_post_scales(), brapi_post_search_images(), brapi_post_search_observations(), brapi_post_search_variables(), brapi_post_traits(), brapi_post_variables(), brapi_put_images_imageDbId_imagecontent(), brapi_put_images_imageDbId(), brapi_put_methods_methodDbId(), brapi_put_observations_observationDbId(), brapi_put_observationunits_observationUnitDbId(), brapi_put_scales_scaleDbId(), brapi_put_traits_traitDbId(), brapi_put_variables_observationVariableDbId()

Other Observation Units: brapi_get_observationlevels(), brapi_get_observationunits_observationUnitDbId(), brapi_get_observationunits_table(), brapi_get_observationunits(), brapi_get_search_observationunits_searchResultsDbId(), brapi_post_observationunits(), brapi_put_observationunits_observationUnitDbId()

Examples

## Not run: 
con <- brapi_db()$testserver
con[["token"]] <- "YYYY"
observationLevelRelationships <- data.frame(
  levelCode  = c("fieldA", "rep1", "block1"),
  levelName  = c("field", "rep", "block"),
  levelOrder = c(1, 2, 3))
observationLevels <-
  data.frame(levelName = c("field", "block", "plot"),
             levelOrder = c(0, 1, 2))

# Immediate Response Example
brapi_post_search_observationunits(con = con,
                                   germplasmDbIds = "germplasm1")

# Saved or Asynchronous Search Response Example
brapi_post_search_observationunits(
  con = con,
  externalReferenceIDs = "https://brapi.org/specification",
  externalReferenceSources = "BrAPI Doc",
  germplasmDbIds = c("germplasm1", "germplasm2"),
  includeObservations = FALSE,
  programDbIds = "program1")

## End(Not run)


mverouden/brapir-v2 documentation built on April 22, 2022, 9:24 a.m.