Open colleenXu opened 9 months ago
Making a quick note: this related BioThings feature filter
may be coming downstream eventually and is related but distinct from post_filter
https://github.com/biothings/biothings.api/issues/296
@newgene
This isn't urgent, but can you give an update?
post_filter
in POST /query, in the parameters and in the request bodypost_filter
in POST /query ? If not, do you have a timeline for when this will be available?A optimized example with post_filter
might look like this:
requestBody:
body: >-
{q: "{{ queryInputs }}"
scopes: subject.umls}
parameters:
fields: object.umls,predication.pmid,predication.sentence,subject.name,object.name
post_filter: >-
predicate:LOCATION_OF AND object.semantic_type_abbreviation:neop
AND _exists_:object.umls AND pmid_count:>3
size: 1000
From discussion during lab meeting today:
post_filter
is already live on all BioThings APIs (core and pending)filter
is an upcoming BioThings API feature, and should be an improvement on post_filter
(it also has differences for facets / aggregation but we haven't been using those for BTE). So do find-replace once that goes liveEDIT: adding notes from more thinking
This BioThings feature may be useful (look at multiple fields for a value, while setting other fields as well), or it may be obsolete now when we adopt the post_filter/filter feature...
Update:
filter
is deployed to pending BioThings APIs only. Update x-bte annotation to use this, so it can be tested
filter
until this testing is doneI prioritized working on this issue before my trip, because it should improve performance.
in https://github.com/NCATS-Tangerine/translator-api-registry/pull/135 and registrations are refreshed
EDIT 12/5: now tested because bug was fixed and these operations are all working as-intended
TTD: * pubchem_treats_mondo-rev * ttd_drug_id_treats_mondo-rev * uniprotkb_target_for_mondo-rev * ttd_target_id_target_for_mondo-rev Text-Mining Targeted: * drugbank-treats-mondo-rev * drugbank-treats-hp-rev * uniprotkb-contributes_to-mondo-rev * uniprotkb-contributes_to-hp-rev * drugbank-contributes_to-hp-rev * drugbank-contributes_to-mondo-rev
Notes:
requestBodyType
, which indicates more complex requestBody that could be changed to use filter
post_filter
and filter
seemed to only be deployed on those instances (lab Slack thread) filter
because Chunlei recommended it over post_filter
post_filter
and filter
seem to work even when the fields in their statements aren't in the parameters.fields (this differs from list_filter/jmespath behavior)
@newgene says that once the code freeze is over, the BioThings APIs will be updated to allow POST queries to use
post_filter
.The initial issue is here: https://github.com/biothings/biothings.api/issues/208
post_filter
can be set in the parameters or the request body. @newgene, could you give an example of each in a comment?Once it is live on BioThings APIs prod instances, we'll want to use it. It'll involve looking for BioThings x-bte annotation that uses more complicated "q" querying (maybe uses
wrap
,replPrefix
,_exists_
...some way of setting >1 field value) and seeing if post_query will work with it.