Open BrapiCoordinatorSelby opened 6 years ago
@BrapiCoordinatorSelby Have a look at https://www.genesys-pgr.org/swagger-ui.html#/accession/listUsingPOST. Or see it in action at https://beta.genesys-pgr.org/a
We support the following types of filters:
property: string[]|number[]
for where we exactly match the property
to provided values.property: StringFilter
for String matching ops: eq
contains
startsWith
property: NumberFilter
for number matching ops: ge
le
lt
le
eq
That basically covers all our needs.
Then we support NOTNULL: string[]
as a way to indicate you want some properties to be not null. NULL: string[]
does the oposite.
We also support NOT: Filter
that negates the filtering operations. Only 1 level NOT is allowed.
Example filter in JSON to get all Oryza accessions except from PHL001
that have latitude
in Genesys would be:
{
"NOT": {
"holder.code": [ "PHL001" ]
},
"NOTNULL": [ "geo.latitute" ],
"taxonomy.genus": [ "Oryza" ]
}
Making the UI for all these options is quite a challenge.
@BrapiCoordinatorSelby
- Allows ranges/max/min on number and date fields
I think this would be useful also for other entity searches like POST /search/observationunits
for example, specifically in the context of the BrAPI Graphical Filtering tool, to be able to filter trait data server-side. Without this, the client is forced to ask for all records or go through all pages, to then be able to filter traits. Another option is to use BrAPI.js which already abstracts this and let's you retrieve all pages in a single command. But this could be a problem for servers with a large amount of data.
(EDIT: The graphical filtering tool example may not be the best one, given that the tool display a frequency of values, for which it needs the whole data loaded first)
A standard for filtering will have a lot of value for BMS, where we also have a custom (internal API) filtering approach for different entities, specifically wildcard on text fields and ranges/max/min on number and date fields.
cc @jeback1 @mcrimi @lukasmueller
This issue is for discussion of an advanced germplasm search call. this call is not yet ready to implement and will need more discussion and support by the community. we will need more use cases and community members who are willing to implement this call before adding it to the official spec.
New Germplasm Advanced Search Call Requirements