The Musa in situ project, led jointly by CIRAD and Bioversity, collects data on Musaceae around the world, in the wild or in the closest to natural growing conditions. The main purpose is to obtain an as precise as possible picture of the natural geographical diversity of Musaceae. Although it initially relied on an iNaturalist project, it now integrates other sources of data, particularly GBIF, which provides a REST interface.
GBIF also provides an access through a web interface which internally consumes this REST service. However, for the Musa in situ project, it was best to request these data directly from our site—ideally with a view, so that we could select which data should be imported into the local database, and so that we were able to ensure coherence with what had already been imported, or what we refrain from importing.
As it happens, a reference implementation is available for the R language, namely rgbif. This client is an abstraction allowing to interrogate the GBIF database without the need to delve into web services requests. It was ported (more or less comprehensively) to Python (pygbif) and Ruby (gbifrb). From now on, we can also count on PHP GBIF, developed as part of the Musa in situ project. Our hope is that this free (GPLv3) project may be useful to other individuals and entities who wish to interact with this central repository of biodiversity worldwide.
Installing is as simple as a
composer require restelae/php-gbif. This library requires PHP version 7.2 or later. All the necessary usage information can be found on its homepage as well as the documentation automatically generated with Doxygen.
We also wrote a module for Drupal (currently Drupal 7) which relies on this library and allows to display occurrences from GBIF with Views, only in site building, with web service calls, without interrogating the local database! Coupled with the Views Bulk Operations module, you may use it to process GBIF occurrences on your website, e.g. importing them locally with the Migrate module.
Currently, the PHP GBIF project only supports occurrences (search and retrieval) and species. We are looking for sponsors and contributors to implement the whole API, and thus greatly facilitate access to GBIF data to all projects written in PHP. Do not hesitate to get in touch in case you are interested!