-
Notifications
You must be signed in to change notification settings - Fork 2
Filter query parameters broken for several annotations #45
Comments
Annotation (and namespace) search doesn't do partial matches unless you use wildcards. This implies that the search parameter is a pass-through for the underlying FTS mechanism (SQLite FTS4). Here are some example requests: EFO Example GET http://next.belframework.org/api/annotations/efo/values?filter={%22category%22:%22fts%22,%22name%22:%22search%22,%22value%22:%22*cell%20line*%22} Uberon GET http://next.belframework.org/api/annotations/uberon/values?filter={%22category%22:%22fts%22,%22name%22:%22search%22,%22value%22:%22*lung*%22} Currently species annotations are not searchable. A fix for this is forthcoming. |
It appears to do partial matches now w/out wildcards. Can I leave them out? |
The wildcards are required. You might be matching on the whole token value. For example searching on http://next.belframework.org/api/annotations/values?filter={"category":"fts","name":"search","value":"tissue"}
http://next.belframework.org/api/annotations/values?filter={"category":"fts","name":"search","value":"tiss*"} |
How is this request/response possible? request: next.belframework.org/api/annotations/values?size=1&filter={"category":"fts","name":"search","value":"9"} response: {
"annotation_values": [
{
"identifier": "0001045",
"name": "11-5.2.1.9 cell",
"type": "AnnotationConcept"
}
]
} Here's the actual GET line:
|
The result is possible because 9 is a separate token within it. The SQLite FTS4 table treats The token characters are defined as |
You may want to consider taking more reponsibility from the client and exposing simple search capabilities for now. This will get us to good enough. We can go for robustness at a later point and take on the added complexity then. If you decide to go the robust route now, there are at least three points that need addressing:
Some amplifying information on (3) as well - if we search examplessearch by token...CreveldUsing filter: {"category":"fts","name":"search","value":"Creveld"} response: {
"identifier": "12714",
"name": "Ellis-Van Creveld syndrome",
"type": "BiologicalProcessConcept"
} ...Ellis-VanOr filter: {"category":"fts","name":"search","value":"Ellis-Van"} response: {
"identifier": "12714",
"name": "Ellis-Van Creveld syndrome",
"type": "BiologicalProcessConcept"
} ...syndromeOkay, now we're getting somewhere. How about filter: {"category":"fts","name":"search","value":"syndrome"} response: {
"identifier": "0050120",
"name": "hemophagocytic lymphohistiocytosis",
"type": "BiologicalProcessConcept"
} Okay, hemophagocytic lymphohistiocytosis is a type of syndrome, but how do I know that from the search result? ...lateralThis one makes sense: filter: {"category":"fts","name":"search","value":"lateral"} response: {
"identifier": "0008021",
"name": "anterior lateral line ganglion neuron",
"type": "CellAnnotationConcept"
} ...latera*So does this (note the trailing filter: {"category":"fts","name":"search","value":"latera*"} response: {
"identifier": "0008021",
"name": "anterior lateral line ganglion neuron",
"type": "CellAnnotationConcept"
} ...*ateralThis doesn't (leading filter: {"category":"fts","name":"search","value":"*ateral"} response:
...ateraOr this (leading and trailing filter: {"category":"fts","name":"search","value":"*atera*"} response:
multiple wildcardsMultiple wildcards support is nice: filter: {"category":"fts","name":"search","value":"posterior lateral * ganglion *"} response: {
"identifier": "1000245",
"name": "posterior lateral line ganglion neuron",
"type": "CellAnnotationConcept"
} weird resultsTry filter: {"category":"fts","name":"search","value":"ell"} response: {
"identifier": "2002105",
"name": "electrosensory lateral line lobe",
"type": "AnatomyAnnotationConcept"
} Not sure why I'm getting this. I suspect |
Thanks for the write-up with examples. Very thorough and provides a nice set to test with. The major problems seem to be:
To address (1) I will have to index suffixes of identifiers, names, titles, and synonyms. For example the term For (2) I will be able to provide which field(s) match and where (position range), but this will take longer. |
Closing. Split work among a few tickets. |
Using the following APIs:
/api /annotations /{annotation} /values
/api/annotations/values
I always get no results (404) when searching the following annotations:
I labeled this as a bug though I may not be covering enough search terms in uberon and efo. I would have expected a result searching for
9606
in taxon.The text was updated successfully, but these errors were encountered: