Platform(s), such as mobile, website, API, other: Website, mobile
URLs (aka web addresses) of any pages, if relevant: Identify module
Description of need:
Improve filtering for different annotations
Feature request details:
Add functionality to search for or url filter multiple annotations. This would be beneficial both for multiple annotations and different annotation values, preferably all at the same time. Currently there is very limited ability to search for observations with more than one annotation filter. As far as I can tell, the only use case that actually works is something like this, searching for observations with one value and without another, but they must be the same annotation: https://www.inaturalist.org/observations/identify?term_id=22&without_term_value_id=24&term_value_id=23
Some cases I’ve run into that I wasn’t able to accomplish was something like searching for observations without a life stage while filtering out those without evidence of presence set to something specific (like leafmine or egg). I also couldn’t find a way to search for observations with multiple evidence of presence annotations (like organism and molt).
Perhaps others can chime on other similar workflows that would benefit from this functionality.
Clarification:
Add the ability to search for annotations by term_value_id and without_term_value_id without requiring term_id. The term_id numbers are unique compared to the term_value_id numbers, so an “any” search could still work. Ideally these searches could be done with AND or OR, so you could search for observations with organism OR molt and then search for observations with organism AND molt. Something like term_value_id=24,28 vs term_value_id=24+28.
For the first part, it doesn’t allow for specific values to be excluded, only the whole annotation or term ID. I want to find observations with no life stage and without a specific EoP annotation (namely leafmine or egg), not without any EoP annotation.
And for the second part, I am specifically looking for observations with both EoP annotations, organism AND molt. This url finds observations with one or the other (and presumably both, but there’s no way to pick them out of the list)
please refer to the linked guide and the search filter provided (I can see you did not even click them) before telling me it does not work, as you absolutely can include/exclude specific values to your discretion. you can include/exclude annotation groups AND/OR specific annotations within group.
but yes, it seems an AND function is not really included in the search, it defaulted to OR. this is needed.
i was trying to give you this search for multiple possible evidence of presences, and found that you cannot do AND: tried to separate the search terms and that didn’t work either.
This was very helpful for other use cases though. The UI is limiting, so I didn’t realize I’d be able to successfully create filters that granular with the URL.
I still think the other functionalities would be very helpful. I can try to summarize my ask better in the original post
This one is helpful too. But still a bit limited (hopefully I’m not asking for too much).
I guess for condition 3, I was searching for either no EoP annotation or any EoP annotation besides the ones you listed.
I’ll try to describe a specific use case, maybe that will help clarify better than my words can.
I’m looking to annotate Lepidoptera observations for life stage (adult, larva, pupa, etc), but I want to exclude only observations that have been annotated with EoP=leafmine. Any other EoP annotation I want included in the search
no worries, i am very glad to help with search filtering (i think i am surprising myself with how passionate i am about it, in terms of being able to sort the huge amount (200 million +) observations! it is so important)
thank you for your very specific use case, as this helps solve things: you don’t need to include the term_id=22 at all. simply leave it out and your search WILL include those which have no annotation. it only eliminates the EoP annotations which do not interest you. this is the search filter i have designed for it: https://www.inaturalist.org/observations/identify?without_term_id=1&without_term_value_id=32&taxon_id=47157
I certainly appreciate your help. I definitely learned a few things. I’ll clarify the ask in the original post once I clarify things in my own head lol
I was playing with your last link to get the results I was looking for. I used this search:
I included the project id since that project is for leafmines and I could easily tell if the search was working. But I’m finding lots of observations in there with the leafmine annotation, despite having the &without_term_value_id=32 in the url. Did I not follow correctly?
i am experiencing the same in spite of the without_term_value_id=32, so i must have done something wrong. it looks like the guide says “Both the group parameter and value parameter should be included in the URL,” so perhaps it is not possible to include both groups (observations with an annotation that is NOT a specified value, observations without that annotation altogether)? i defer to whoever made the search filters.
That appears to be the crux of the issue. You can’t have multiple with_term_id or without_term_id in the same url, otherwise the term_value_id part wouldn’t know which term_id to look at.
in light of that, maybe the more accurate feature request is for a way to indicate a sort of NULL within the search (which i do not know if it exists), so you can call term_value_id or without_term_value_id to include/exclude those in the search.
i will be back to check on this thread later, i need to take an exam!
I added this clarification to my original post which I think covers what my ask is. I think that would cover all situations for filtering annotations, or at least all the ones I’m looking for.
Clarification:
Add the ability to search for annotations by term_value_id and without_term_value_id without requiring term_id . The term_id numbers are unique compared to the term_value_id numbers, so an “any” search could still work. Ideally these searches could be done with AND or OR, so you could search for observations with organism OR molt and then search for observations with organism AND molt. Something like term_value_id=24,28 vs term_value_id=24+28.
I created some basic Evidence of Presence collection projects. With the different project filters combined with annotation filters, I can basically accomplish everything I need to now. It would still be nice to have this supported functionality, but having these projects is a suitable workaround for me
I plan on making a journal post in that project (or perhaps I should do a tutorial forum post?) on how these projects can be used to enhance annotation-related search queries.
This is a smart idea for a workaround. Is there a reason why you aren’t including Casual observations in the project? Most people don’t interact with them much, but it seems possible that someone might want to do an annotation search on, say, cultivated plants.