gbif / gbif-api

GBIF API
Apache License 2.0
27 stars 5 forks source link

occurrenceStatus missing in API species distribution enpoint #94

Closed damianooldoni closed 1 year ago

damianooldoni commented 1 year ago

Hi,

Can it be that since a few days occurrenceStatus is missing in API species distribution endpoint for taxa with one distribution only? For taxa with multiple distributions, occurrenceStatus is still present in information retrieved via API.

On website I can see the field occurrenceStatus in Species Distribution (https://www.gbif.org/species/140563025/verbatim)

image

However, this information is not present while retrieving distribution from API (https://api.gbif.org/v1/species/140563025/distributions):

{
"offset": 0,
"limit": 20,
"endOfRecords": true,
"results": [
{
"taxonKey": 140563025,
"locationId": "ISO_3166-2:BE-VLG",
"locality": "Flemish Region",
"country": "BE",
"temporal": "2007/2016",
"establishmentMeans": "INTRODUCED",
"source": "van Haaren T, Soors J (2009) Sinelobus stanfordi (Richardson, 1901): a new crustacean invader in Europe. Aquatic Invasions 4: 703–711, https://doi.org/10.3391/ai.2009.4.4.20"
}
]
}

This doesn't happen when multiple distributions are present. Example: website (https://www.gbif.org/species/141265335/verbatim) and API (https://api.gbif.org/v1/species/141265335/distributions).

damianooldoni commented 1 year ago

Update: now occurrenceStatus is missing from data retrieved via API when multiple distributions are present as well. Check the same example as above: website (https://www.gbif.org/species/141265335/verbatim) vs API (https://api.gbif.org/v1/species/141265335/distributions).

Any idea when this can be fixed? Thanks in advance.

mdoering commented 1 year ago

This looks indeed like a bug. There should be a controlled status field for each distribution. We have changed the vocabulary for the occurrence status to a new DistributionStatus enumeration - perhaps that is the cause of the problem. The enumeration was introduced into the API classes 3 years ago, but we only put that live into the production species API sometime in April last year. So that corresponds to your initial issue date.

mdoering commented 1 year ago

works in UAT: https://api.gbif-uat.org/v1/species/141265335/distributions will deploy this to prod now

mdoering commented 1 year ago

deployed and reinterpreted.

damianooldoni commented 9 months ago

Hi @mdoering, issue solved on prod for multiple species distributions. But occurrenceStatus is still missing for taxa with one species distribution. See https://api.gbif.org/v1/species/140563025/distributions