API endpoint species_counts returns strange preferred_common_name

Platform:
NodeJS API v1

URLs:
The API call using preferred_place_id results in strange names being used like “Earth-hog” and “Ceruleam Antelope”:
https://api.inaturalist.org/v1/observations/species_counts?project_id=17900&iconic_taxa[]=Mammalia&preferred_place_id=124527

If the place_id is used instead of the preferred_place_id then the names are better (but then it throws out the threatened species, like Blue Duiker, so using place_id isn’t a viable alternative):
https://api.inaturalist.org/v1/observations/species_counts?project_id=17900&iconic_taxa[]=Mammalia&place_id=124527

Links to the iNat pages:
https://www.inaturalist.org/taxa/74870-Philantomba-monticola
https://www.inaturalist.org/taxa/47062-Orycteropus-afer
https://www.inaturalist.org/places/cannon-rocks
https://www.inaturalist.org/projects/cannon-rocks-and-boknes-biodiversity

Description of problem:
I would expect the call that uses the preferred_place_id to return the same names as the call that uses the place_id. The place_id has the more correct names.

Maybe the preferred_place_id variant always uses the last name?
(I’m not sure how to tell on the taxon page what name is used in what region, or which is the default.)

Update:
Even if I add the place_id (for example to South Africa), it still returns strange names:
https://api.inaturalist.org/v1/observations/species_counts?project_id=17900&iconic_taxa[]=Mammalia&preferred_place_id=124527&place_id=113055

Again, doing the reverse gives the correct names, but throws away species, so it’s unusable.

The preferred_place_id parameter is only used for localizing taxon names to that place (see the documentation at https://api.inaturalist.org/v1/docs/#!/Observations/get_observations_species_counts). You will not get a different number of results if you use preferred_place_id or not, but the common names you see will be the preferred common names for that place.

The place_id parameter will filter results to observations that occur in that place. Depending on the size and type of place and the geoprivacy of the observations, some observations may not appear in search place search results so as to not expose obscured locations. See https://forum.inaturalist.org/t/why-dont-these-observations-show-up-in-this-project-official-topic/12523/16 for a similar issue in the context of collection projects with place filters.

Since you’re filtering your search by project, and the project seems to have a limited geographical range, do you need to filter by place at all? Perhaps you’d prefer simply https://api.inaturalist.org/v1/observations/species_counts?project_id=17900&iconic_taxa[]=Mammalia - Mammal observations in your project not limited by place, and with common names not localized to a place?

1 Like

Thanks for the reply.

Yes, I understand there are issues regarding obscured observations, in this case not being picked up by “small” places. But that’s a different can of worms - including the argument of whether all threatened species should be obscured or not. Personally I would like to have less species obscured by default - in many cases it doesn’t make sense. It would be very helpful if there was a way to allow collection projects to include obscured observations, for example maybe if I join the project then my obscured observations can be included in the project.

Back to this problem:

  1. Can you maybe explain or show me how to see (and change) which names are used by my place? My place (id 124527) is nested under the Eastern Cape province (id 8872), which (I assume) is part of South Africa (id 6986). So why is it showing these strange names I’ve never heard spoken in South Africa?
    The names used by the Southern Africa (id 113055) place (or when no place is specified) are much better, though I believe still incomplete.

  2. My reasons for setting the preferred_place_id (and not the place_id) is as follows:

    • As discussed earlier I can’t use place_id, for the same reason I can’t switch over to a collection project, because it throws away too many species. I was able to include these species in the old project by hand, which is a saving grace. These are threatened species, and as such arguably the most important to have included. I use the project as a sort of “field guide”, so missing any species, especially the threatened ones, is not desirable.
    • It is supposed to return the best common names, yet as you can see the exact opposite is happening. For example everybody speaks of an “Impala”, so why does iNat think in SA we use “Pallah”? I’ve never heard this word being used before.
    • Most importantly, I set the preferred_place_id in order to get back the preferred_establishment_means, which is otherwise not included in the results.

The problem is definitely also present at the South Africa (or higher) level, because this link returns odd names as well:
https://api.inaturalist.org/v1/observations/species_counts?project_id=17900&iconic_taxa[]=Mammalia&preferred_place_id=6986
Interestingly it seems even worse, with many Afrikaans names suddenly popping up as well.

i think curators have a nice screen that they can use to see how specific common names are assigned to places, but folks like you and me can use this (undocumented?) API endpoint to also see the setups:
https://www.inaturalist.org/taxon_names.json?per_page=200&taxon_id=42278
https://www.inaturalist.org/taxon_names.json?per_page=200&taxon_id=47062

basically, it looks like there’s a particular user who has added these common names as English names for S Africa. i’m just guessing, but some of these may be literal translations of the Afrikaans names to English.

if you disagree with the English names for S Africa, i think i would bring it up with a curator by maybe flagging a couple of these taxa. from there, i’m not exactly sure what the process is, but maybe the curator can confer with the creator of these names to maybe arrive at some sort of agreement on what the names should be or maybe correct some sort of procedural issue.

maybe if these look malicious or pranky, you could also bring it to the attention of staff at help@inaturalist.org (@tiwane), and they might be able to resolve this, too.

that said, i don’t think there’s a bug here. so maybe if a moderator (ex. @bouteloua) sees this, they can move this to the General category.

oh… and maybe there is something here that is related to https://forum.inaturalist.org/t/local-names-south-africa/18734?

Thanks for the links @pisum, it helps to see where the names are coming from. I guess we can close this bug.

For example, lets take Aardvark:

[
  {
"id": 2260017,
"name": "Ant Bear",
"is_valid": true,
"lexicon": "English",
"taxon_id": 47062,
"created_at": "2020-10-05T14:02:25.399+02:00",
"updated_at": "2020-10-05T14:02:25.399+02:00",
"creator_id": 1653038,
"position": 26,
"parameterized_lexicon": "english",
"place_taxon_names": [
  {
    "id": 224739,
    "place_id": 6986,
    "taxon_name_id": 2260017,
    "position": 0
  },
  {
    "id": 224738,
    "place_id": 69020,
    "taxon_name_id": 2260017,
    "position": 0
  }
]
  },
  {
"id": 2053884,
"name": "Earth-hog",
"is_valid": true,
"lexicon": "English",
"taxon_id": 47062,
"created_at": "2020-04-24T15:44:09.291+02:00",
"updated_at": "2020-04-24T15:44:09.291+02:00",
"creator_id": 1653038,
"position": 23,
"parameterized_lexicon": "english",
"place_taxon_names": [
  {
    "id": 169597,
    "place_id": 6986,
    "taxon_name_id": 2053884,
    "position": 0
  }
]
  },
  {
"id": 100710,
"name": "Aardvark",
"is_valid": true,
"lexicon": "English",
"taxon_id": 47062,
"created_at": "2010-11-26T11:36:12.000+02:00",
"updated_at": "2019-06-08T04:16:01.147+02:00",
"creator_id": 1,
"position": 0,
"parameterized_lexicon": "english",
"place_taxon_names": []
  },
  {
"id": 130889,
"name": "Antbear",
"is_valid": true,
"lexicon": "English",
"taxon_id": 47062,
"created_at": "2011-05-18T05:04:00.000+02:00",
"updated_at": "2019-06-08T04:16:01.135+02:00",
"creator_id": null,
"position": 1,
"parameterized_lexicon": "english",
"place_taxon_names": []
  },
  {
"id": 1545153,
"name": "Cape Anteater",
"is_valid": true,
"lexicon": "English",
"taxon_id": 47062,
"created_at": "2019-04-08T13:45:05.167+02:00",
"updated_at": "2019-04-08T13:45:05.167+02:00",
"creator_id": 516268,
"position": 9,
"parameterized_lexicon": "english",
"place_taxon_names": []
  },
]

Interestingly the website always shows me “Aardvark” (https://www.inaturalist.org/taxa/47062-Orycteropus-afer) and no matter whether I choose Southern Africa, South Africa or leave the country empty I see the same thing.

From the taxon_names API call above we see that Aardvark is at position 0 and not linked to a country. However South Africa (6986) has two names linked: “Ant Bear” at position 26 and “Earth-hog” at position 23. So I guess position 23 wins since it is lower. (Lets not get into why iNat and SANBI can’t seem to get the common names loaded for SA, I have no idea why it’s proven to be so difficult.)

To summarize the above:

  1. It seems the species_counts API call is doing the correct thing and returning the lowest priority name for the place. I’ll try and flag the incorrect taxa I see and hope a curator can fix it while we wait for proper common names to be loaded for all SA species (but by now I’m not holding my breath).
  2. I don’t know why the website doesn’t also show “Earth-hog”.

PS.
Just a reminder from my earlier response: I can’t use the place_id parameter to get the conservation_status field in the response because it throws away threatened species. Luckily preferred_place_id seems to do the same without throwing away the obscured observations, but the common names populated on iNat are bad.

1 Like

Thanks for flagging this - I had missed this thread on the forum. The specific problem here is that one user has been adding lots of alternative names for South African species (which is fine) but then setting South Africa as the Place for the name. This means that these alternative names become the default name for anyone who sets South Africa as their location for names. Most South African users instead use Southern Africa as their location, and names are actively curated for this location, so one way to see the correct names would be to switch locations to Southern Africa. Unfortunately places are not nested on iNat, so if a name is set for Southern Africa it does not apply to South Africa.

The current system also means that if a name in a different language is given a Place (eg an Afrikaans name) it automatically becomes the default name for that Place even if you have English as your chosen language - unless there is an English name set for that Place. I don’t know why this is thought to be a good idea.

There are a lot of these for South Africa and they will take some time to fix - I’ll try to do the birds and mammals slowly

So not really a bug, but the naming system does not work well for Places, as shown here.

1 Like