biothings / biothings_explorer

TRAPI service for BioThings Explorer
https://api.bte.ncats.io
Apache License 2.0
8 stars 9 forks source link

Update BioThings x-bte annotation to use `filter` #726

Open colleenXu opened 9 months ago

colleenXu commented 9 months ago

@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.

colleenXu commented 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

colleenXu commented 9 months ago

@newgene

This isn't urgent, but can you give an update?

newgene commented 8 months ago

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 https://raw.githubusercontent.com/NCATS-Tangerine/translator-api-registry/master/semmeddb/smartapi.yaml

colleenXu commented 8 months ago

From discussion during lab meeting today:

EDIT: adding notes from more thinking

colleenXu commented 8 months ago

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...

colleenXu commented 8 months ago

Update:

colleenXu commented 8 months ago

I prioritized working on this issue before my trip, because it should improve performance.

Already done

in https://github.com/NCATS-Tangerine/translator-api-registry/pull/135 and registrations are refreshed

Not tested

EDIT 12/5: now tested because bug was fixed and these operations are all working as-intended

click to expand

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

Not done yet


Notes:

colleenXu commented 7 months ago

Update: the bug blocking testing was addressed, and the "Not tested" operations above were tested and working as-intended.