Add UI for filtering by project on Life List

On the Life List UI there is a feature to view All Unobserved Species. Currently you can only filter by a Place in the UI, and under the hood it makes a request to https://api.inaturalist.org/v1/observations/species_counts?unobserved_by_user_id=1030414 with the ?place_id set to what you chose. The API also supports a ?project_id parameter, but the UI does not expose this functionality.

The reason this is useful is that for projects like this https://www.inaturalist.org/projects/cnps-rare-plants, with over 2400 taxa, but only 1700 observed species, there is no way in the iNat UI to figure out what rare species have not been observed yet, which would be very useful for conservation purposes.

A brief glance at the code shows me the Life List page uses the PlaceAutocomplete JS component and there is already a ProjectAutocomplete component that could conceivably be used for this.

There could also be a UI-free implementation of this, which would be to simply pass through whitelisted query string arguments on the page into the species_counts query, so for example if you view https://www.inaturalist.org/lifelists/maxo?details_view=unobservedSpecies&project_id=123 it would add ?project_id=123 to your subsequent filter queries on that page

i don’t understand what you’re trying to do exactly, but maybe one of the tools by @kildor might help: https://forum.inaturalist.org/t/several-external-tools-for-inat-data-by-kildor/19906.

Thank you, I tried out the Missing Species tool you linked and it says it needs to download 834 pages to tell me which species are unobserved on the cnps-rare-plants project, which would take quite a while, so I don’t think that would work for my use case.

It would be nice to be able to do the following on iNaturalist, in a way that is easy to use and doesn’t require copy/pasting IDs:

  • View which taxa in a project I have not observed (addressed by this feature request)
  • View which taxa in a project I have observed (not specifically addressed in this request but would be nice to have and probably easy to add as well)
  • View which taxa in a project nobody has observed (not addressed here but would be awesome to have too!)

if you’re using it in the expected way, it should not take 834 pages. this took 4 pages (@ 500 taxa per page):

you can sort of do this using this: https://www.inaturalist.org/observations/compare

… but it can only do 1 page (500 taxa) per result set, meaning that you’d have to probably break down each set to some common set of taxa that falls below 500 taxa (ex. first asters, then legumes, etc.).

if it’s not observed, it won’t be in any project, unless i’m misunderstanding something.

you might be trying to just compare two lists of taxa, and you can do that using iNaturalist’s list comparison functionality, although you may need to manually create lists to compre. for example: https://www.inaturalist.org/lists/946645-pisums-Life-List/compare?show=right&with=4346705-Test-List

Thank you! I’ll play around with these links.

if it’s not observed, it won’t be in any project, unless i’m misunderstanding something.

In the case of projects I am referring to “Included Taxa” which are listed on the project edit page. So for a project with say 10 taxa, but only 5 of which have observations, there are still 10 taxa included in the project, and its important (in my opinion) for conservation purposes to be able to view taxa that have no observations

In general this is impossible to do.
If, for example, project includes “Plants”, or “Aves”, or “Odonata”, how unobserved taxa should be calculate? All subtaxons? Only exact taxa? Also, you are talking about umbrella project, so it should be checked for all subprojects.

seems to me like it should be generally possible. unless the API has a limit, it should be theoretically possible to get a list of included taxa from the project rules.

one of the main complications, as you noted would be if you have an umbrella project where the subprojects are inconsistently defined. another complication is if a project has both include an exclude taxon lists. the combination of include and exclude across many subprojects would be the most complex case to handle, i think.

i think either way should be possible. you would just have to decide how you want to compare (and in which direction). exact taxon comparison should be straightforward. subtaxon comparison should be possible by getting ancestor taxa. it’s a little more complicated, but it should be doable.

it’s interesting to me that people are setting up massive taxon lists in collection projects, especially since i assume most people are doing this manually (since i doubt most people would know how to do this through the API). seems like it would be a lot of effort to do something like that manually.

there has been a request before to allow collection project taxon lists to be defined via a taxon list: https://forum.inaturalist.org/t/filter-collection-project-using-taxon-list/6470. some discussions in that thread seem to sort of be asking for functionality that may be similar to what you’re asking for here.

i think that would be the most straightforward way to implement a comprehensive solution to the problem, although even that kind of solution probably wouldn’t handle the complicated cases where you have umbrella projects with many subprojects with varying lists, nor where a project has both include and exclude lists. that probably would only ever happen via third party willing to code a tool for that. (i don’t think it would be super hard to do, but i probably wouldn’t do it myself since it seems like it would have a very limited use case. i might be more interested in making something to sync up project rules with a given list though – assuming there is an API endpoint to get taxa from lists – or to copy project rules from one project to another project.)

now that the system is back up, i confirmed that this is possible

Yes I programmatically update projects via the API via PUT https://api.inaturalist.org/v1/projects/<id>. I have found you can set around 1000 taxa in one request before you get 500 errors, so you can put thousands into one project, but after you have around 1000 in one project, you break the edit page.

So I think I see the problem with my feature request, this request returns the project taxa with observations that I personally have no observations for. https://api.inaturalist.org/v1/observations/species_counts?unobserved_by_user_id=1030414&project_id=163590&locale=en&per_page=1

But that is different from the project taxa with or without observations that I personally have no observations for, so maybe its not as easy to add as I thought. The API endpoint I am envisioning would be something like the above but ?project_id=123&include_zero_observation_taxa=true&unobserved_by_user_id=any

I have found projects with large included taxa lists to be very powerful, and updating them via API lets me keep them in sync with third party data sources. It makes sense to add small features to projects to make them more functional rather than wait for a big rewrite of Lists.

i think you’re still mixing concepts. the taxa in project rules are totally separate from the a summarized list of taxa from a set of observations. if you’re gong to try to do that kind of comparison, you’re likely going to have to write your own tool or script to do that.

you don’t need to rewrite lists exactly. if you use lists as a repository for your taxon lists, you could theoretically use the existing list comparison functionality in the system to see differences between two sets of taxa. however, since you know how to program, it seems like you could do your own comparisons however you like without too much effort.

you can get lists of taxa from:

  • project rules (ex. https://api.inaturalist.org/v1/projects/{id}?rule_details=true)
  • observations species summary (ex. https://api.inaturalist.org/v1/observations/species_counts)
  • lists (ex. https://www.inaturalist.org/lists/{id}.json)