gbif / vocabulary

A simple registry of controlled vocabularies used for terms found in GBIF mediated data.
Apache License 2.0
5 stars 1 forks source link

Explore the possibility to be able to query the latest release versions #123

Closed marcos-lg closed 1 year ago

marcos-lg commented 1 year ago

As mentioned in this issue there can be inconsistencies when there are changes in vocabularies that are being used in production.

This issue is to explore ways to be able to query the latest release of a vocabulary so the portal can use it.

Right now, the API allows to retrieve the latest version but the data is read from the release file and can't be queried: http://api.gbif.org/v1/vocabularies/LifeStage/releases/latest/export

One way of doing this is by creating some extra tables(or pg materialized views) to store the latest version of the vocabularies. Not all the data has to be stored, only the necessay parts for the portal which is mainly concept names and labels. Then these tables(or whatever we use) has to be refreshed every time a vocabulary is released.

marcos-lg commented 1 year ago

Deployed to PROD.

I've created the materialized views for the already-released vocabularies manually. They might have some unreleased changes but anyway it's the same data as it is being query now when using the API so there's no difference in using the current data or the latest release.

Example: https://api.gbif.org/v1/vocabularies/LifeStage/concepts/latestRelease