title: "How to retrieve occurrence records by exploiting the {ReLTER
} get_site_speciesOccurrences() function"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{How to retrieve occurrence records by exploiting the {ReLTER
} get_site_speciesOccurrences() function}
%\VignetteEngine{knitr::knitr}
%\usepackage[UTF-8]{inputenc}
bibliography: ./references/occurrences_into_site_refs.bib
author: "Alessandro Oggioni, Paolo Tagliolato, Martina Zilioli"
get_site_speciesOccurrences(), map_occ_gbif2elter and save_occ_eLTER_reporting_Archive() are delivered only with devwithImprovements branch __
Starting from the eLTER site id (DEIMS.iD), by ReLTER get_site_speciesOccurrences function, anyone can retrieve occurrence records from GBIF (via rgbif
R package), iNaturalist and OBIS carried out within the boundaries of the site.
ReLTER
get_site_speciesOccurrences() is?The user sets the parameters of the function and, through these choose, defines the output.
The parameters of the function are:
user sets parameter 'deimsid' to select the area of interest from which data are to be harvested (i.e., paste DEIMS.ID of the site of interest; e.g., Gulf Of Venice - GOV https://deims.org/758087d7-231f-4f07-bd7e-6922e0c283fd)
user sets parameter 'list_DS' to select the external data service to be queried (i.e., 'gbif' or 'obis' or 'inaturalist')
user sets parameter 'show_map' to get data in map format in addition to tabular format (i.e., show_map = TRUE)
user sets parameter 'limit' to select the records number (i.e., species presence record) to be extracted
The output are two type: a map and a table(s), for each external data service selected.
# DEIMS.iD of eLTER site Gulf Of Venice (GOV)
GOVid <- "https://deims.org/758087d7-231f-4f07-bd7e-6922e0c283fd"
# Compose the function with choosen parameters
resGOV <- ReLTER::get_site_speciesOccurrences(
deimsid = GOVid,
list_DS = c("gbif", "inat", "obis"),
show_map = TRUE,
limit = 20
)
# iNat table
knitr::kable(
resGOV$inat[c(1:10)],
caption = "The first 10 occurrence records of iNaturalist on the selected eLTER site."
)
Table: The first 10 occurrence records of iNaturalist on the selected eLTER site.
|quality_grade |time_observed_at |taxon_geoprivacy |annotations |uuid | id| cached_votes_total|identifications_most_agree |species_guess |identifications_most_disagree |geometry | |:-------------|:-------------------------|:----------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------|---------:|------------------:|:--------------------------|:---------------------------|:-----------------------------|:-------------------------| |research |2022-12-05T13:09:46+01:00 |open |NULL |b4f9151d-4ef1-42f4-b239-a945a64c9da7 | 143718830| 0|TRUE |Geelpootmeeuw |FALSE |POINT (12.35538 45.45332) | |research |2022-12-03T11:00:00+01:00 |open |NULL |35eb8f8d-eded-4886-bf8f-f857d43a4cbf | 143575219| 0|TRUE |Reed Bunting |FALSE |POINT (12.421 45.00636) | |research |2022-12-02T14:07:00+01:00 |open |3622840 , 3622840 , 1|2 , 9|10 , 1 , 9 , fe7c6798-cf96-44bd-a815-f4f06ea81ecb , aea6727b-bb99-4f02-90f7-5400e333662f , 0 , 0 , 2 , 10 , 3622840 , 3622840 , pachogut , pachogut , FALSE , FALSE , FALSE , FALSE , 2020-09-17T00:35:30+00:00 , 2020-09-17T00:35:30+00:00 , pachogut , pachogut , pachogut , pachogut , Pacho Gutierrez , Pacho Gutierrez , Pacho Gutierrez , Pacho Gutierrez , NA , NA , https://static.inaturalist.org/attachments/users/icons/3622840/thumb.jpg?1607710359 , https://static.inaturalist.org/attachments/users/icons/3622840/thumb.jpg?1607710359 , 6557 , 6557 , 69564 , 69564 , 0 , 0 , 76121 , 76121 , 984 , 984 , 6557 , 6557 , 1 , 1 , https://static.inaturalist.org/attachments/users/icons/3622840/medium.jpg?1607710359, https://static.inaturalist.org/attachments/users/icons/3622840/medium.jpg?1607710359 |21dd55ed-e486-4665-8b87-61c6e22d0975 | 143497071| 0|TRUE |Halcón esmerejón |FALSE |POINT (12.45236 45.55242) | |research |2022-12-02T12:08:00+01:00 |open |NULL |e0f4eadb-20fe-4885-a0ed-159c5c897b51 | 143497070| 0|TRUE |Snow Bunting |FALSE |POINT (12.43361 45.5313) | |research |2021-06-26T05:49:07+02:00 |NA |NULL |6cea04b4-112a-4bbd-b8d3-47c8261571cf | 143430198| 0|TRUE |Barrel Jelly |FALSE |POINT (12.94443 45.6193) | |needs_id |2022-12-01T12:48:31+01:00 |NA |NULL |c4429e97-5c42-487a-af65-b53e24145cbf | 143424932| 0|FALSE |Ocypus |FALSE |POINT (12.6278 45.53698) | |casual |2022-12-01T08:56:52+01:00 |NA |NULL |40ff3de0-a693-44d0-be14-e07b96f70f03 | 143417636| 0|FALSE |NA |FALSE |POINT (12.56612 45.62777) | |research |2022-11-30T03:30:00+01:00 |open |NULL |40ac65dc-2ab3-444e-9be1-59b9b3944492 | 143395728| 0|TRUE |Black Redstart |FALSE |POINT (12.33792 45.43313) | |research |2022-11-30T15:00:00+01:00 |open |NULL |a84200ef-4453-4edd-9e96-76b192e266ea | 143395578| 0|TRUE |Little Egret |FALSE |POINT (12.34821 45.43347) | |research |2022-11-23T11:51:00+01:00 |open |NULL |77f41e34-d12e-4802-9f9f-fd5b4da7970e | 143362860| 0|TRUE |Talitiainen |FALSE |POINT (12.32943 45.43213) | |research |2022-11-21T09:11:00+01:00 |open |NULL |d1238bcd-56af-474f-b9a3-78009607ee0f | 143362852| 0|TRUE |Sinitiainen |FALSE |POINT (12.3292 45.43189) | |research |2022-11-24T12:44:00+01:00 |open |NULL |0990040a-845c-4085-8824-1e818388f522 | 143362837| 0|TRUE |Hippiäinen |FALSE |POINT (12.35512 45.43012) | |research |2021-02-14T11:15:00+01:00 |open |NULL |a2d27d63-8dc5-46a2-b41f-7b7ada36d306 | 143362818| 0|TRUE |Pettirosso |FALSE |POINT (12.31026 45.30265) | |needs_id |2022-11-29T08:25:53+01:00 |open |NULL |cc8dbd75-afb3-46bd-912c-f7efb86f808a | 143356498| 0|TRUE |大蜗牛亚目 |FALSE |POINT (12.44036 45.45273) | |research |2022-11-28T14:40:02+01:00 |NA |1254991 , 1|2 , 1 , d782ba71-0186-46f1-a71a-0a4db83a26b9 , 0 , 2 , 1254991 , hiouf , FALSE , FALSE , 2018-10-04T07:20:21+00:00 , hiouf , hiouf , Guillaume Hoffmann , Guillaume Hoffmann , NA , https://static.inaturalist.org/attachments/users/icons/1254991/thumb.jpeg?1538637620 , 2491 , 13418 , 3 , 15912 , 1103 , 2491 , 1 , https://static.inaturalist.org/attachments/users/icons/1254991/medium.jpeg?1538637620 |14d179bd-7686-42e5-9bb7-64aa69c23b2f | 143356440| 0|TRUE |Gartenwanze |FALSE |POINT (12.44022 45.45275) | |needs_id |2022-11-01T16:36:00+01:00 |NA |1290751 , 1290751 , 17|19 , 22|24 , 17 , 22 , 5ffc0fb9-5929-4df4-b9f9-a1bf9a42de45 , ad1dbfa8-8188-4e70-804d-c3c8259ce637 , 0 , 0 , 19 , 24 , 1290751 , 1290751 , esant , esant , FALSE , FALSE , FALSE , FALSE , 2018-10-21T12:05:57+00:00 , 2018-10-21T12:05:57+00:00 , esant , esant , esant , esant , Emanuele Santarelli , Emanuele Santarelli , Emanuele Santarelli , Emanuele Santarelli , NA , NA , https://static.inaturalist.org/attachments/users/icons/1290751/thumb.jpg?1574013393 , https://static.inaturalist.org/attachments/users/icons/1290751/thumb.jpg?1574013393 , 11218 , 11218 , 220137 , 220137 , 1 , 1 , 231356 , 231356 , 4529 , 4529 , 11218 , 11218 , 1 , 1 , https://static.inaturalist.org/attachments/users/icons/1290751/medium.jpg?1574013393, https://static.inaturalist.org/attachments/users/icons/1290751/medium.jpg?1574013393 |9ac2485a-d027-4db7-aaea-f71b1779b08a | 143267851| 0|TRUE |Barbatia barbata |FALSE |POINT (12.88596 45.60302) | |needs_id |NA |open |NULL |7cb9b7e4-6fd8-4df1-9fd0-e2c23f3521f9 | 143222856| 0|TRUE |Sympétrums |FALSE |POINT (12.32615 45.15043) | |research |2022-11-28T11:28:57+01:00 |open |NULL |94cef324-aa98-4402-a661-2ceb8a41b2d8 | 143206317| 0|TRUE |Yellow-legged Gull |FALSE |POINT (12.33814 45.43416) | |research |2022-11-28T11:28:31+01:00 |open |NULL |8d0fa379-2b65-4015-98c7-f6bdcdb0afe4 | 143206257| 0|TRUE |Gabbiano reale mediterraneo |FALSE |POINT (12.33793 45.43425) | |needs_id |2022-11-28T15:23:57+01:00 |NA |561051 , 1|6 , 1 , 7b248baa-71a2-4884-8d9c-442e1a8db0b5 , 0 , 6 , 561051 , prunhel , FALSE , FALSE , 2017-08-04T13:58:06+00:00 , prunhel , prunhel , Céline , Céline , NA , https://static.inaturalist.org/attachments/users/icons/561051/thumb.jpeg?1548314026 , 3137 , 41215 , 0 , 44352 , 926 , 3137 , NA , https://static.inaturalist.org/attachments/users/icons/561051/medium.jpeg?1548314026 |0476a2cd-9aec-46ac-b0ba-3f6d1942ec46 | 143185178| 1|FALSE |Butterflies and Moths |FALSE |POINT (12.44025 45.45274) |
# OBIS table
knitr::kable(
resGOV$obis[c(1:10)],
caption = "The first 10 occurrence records of OBIS on the selected eLTER site."
)
Table: The first 10 occurrence records of OBIS on the selected eLTER site.
|country | date_year|scientificNameID |year |scientificName |dropped | aphiaID| subclassid| phylumid| familyid|geometry | |:-------|---------:|:-----------------------------------------|:----|:------------------------------|:-------|-------:|----------:|--------:|--------:|:-------------------------| |Italy | 2008|urn:lsid:marinespecies.org:taxname:149093 |2008 |Thalassionema nitzschioides |FALSE | 149093| 148978| 345465| 149091|POINT (12.9203 45.401) | |NA | 1934|urn:lsid:marinespecies.org:taxname:125073 |1934 |Amphiura chiajei |FALSE | 125073| 1416548| 1806| 123206|POINT (12.371 45.349) | |NA | NA|urn:lsid:marinespecies.org:taxname:140735 |NA |Ensis siliqua |FALSE | 140735| 1424948| 51| 23091|POINT (12.33 45.33) | |NA | 2011|urn:lsid:marinespecies.org:taxname:1368 |2011 |Stolonifera |FALSE | 1368| 1341| 1267| NA|POINT (12.4059 45.20375) | |NA | 2011|urn:lsid:marinespecies.org:taxname:103625 |2011 |Polycitor adriaticus |FALSE | 103625| NA| 1821| 103440|POINT (12.48941 45.23041) | |Italy | 1993|urn:lsid:marinespecies.org:taxname:19542 |1993 |Dinophyceae |FALSE | 19542| NA| 450030| NA|POINT (13.19617 45.436) | |NA | NA|urn:lsid:marinespecies.org:taxname:133899 |NA |Hymedesmia (Hymedesmia) veneta |FALSE | 133663| 607950| 558| 131655|POINT (12.36667 45.36667) | |NA | 2014|urn:lsid:marinespecies.org:taxname:135279 |2014 |Carybdea marsupialis |FALSE | 135279| NA| 1267| 135228|POINT (12.45668 45.39183) | |NA | 2008|urn:lsid:marinespecies.org:taxname:158540 |2008 |Pteroplatytrygon violacea |FALSE | 158540| 368407| 1821| 105708|POINT (12.60319 45.33256) | |NA | 1958|urn:lsid:marinespecies.org:taxname:127160 |1958 |Solea solea |FALSE | 127160| 293496| 1821| 125581|POINT (12.3774 45.3867) | |Italy | 2008|urn:lsid:marinespecies.org:taxname:157463 |2008 |Dictyocha fibula |FALSE | 157463| NA| 345465| 157257|POINT (12.9203 45.401) | |NA | 2016|urn:lsid:marinespecies.org:taxname:105923 |2016 |Squalus acanthias |FALSE | 105923| 368407| 1821| 105716|POINT (12.68719 45.08056) | |NA | 1985|urn:lsid:marinespecies.org:taxname:107552 |1985 |Crangon crangon |FALSE | 107552| 1086| 1065| 106782|POINT (12.3774 45.3867) | |Italy | 2008|urn:lsid:marinespecies.org:taxname:149619 |2008 |Cerataulina bergonii |FALSE | 961694| 148971| 345465| 149235|POINT (12.9658 44.9748) | |NA | 1988|urn:lsid:marinespecies.org:taxname:137111 |NA |Tursiops truncatus |FALSE | 137111| 380416| 1821| 136980|POINT (13.25167 45.58333) | |NA | 1934|urn:lsid:marinespecies.org:taxname:141433 |1934 |Abra alba |FALSE | 141433| 1424948| 51| 1781|POINT (12.458 45.416) | |NA | 1991|urn:lsid:marinespecies.org:taxname:141790 |1991 |Gibbula magus |FALSE | 141790| 156485| 51| 443|POINT (12.62 45.27) | |NA | 1982|urn:lsid:marinespecies.org:taxname:139488 |1982 |Scaphander lignarius |FALSE | 139488| 14712| 51| 158|POINT (13.05 45.14) | |NA | 1988|urn:lsid:marinespecies.org:taxname:137111 |NA |Tursiops truncatus |FALSE | 137111| 380416| 1821| 136980|POINT (13.035 45.13333) | |NA | 1919|urn:lsid:marinespecies.org:taxname:140481 |1919 |Mytilus galloprovincialis |FALSE | 140481| 1424948| 51| 211|POINT (12.9377 45.0629) |
The structure of species occurrence records reflects the exporting schema of the original data publisher. Fields mapping among the three data source schemas (i.e., GBIF, iNaturalist, OBIS) and the eLTER data-reporting template (@Peterseil2021) was carried out so as to design functions to structure fetched data in three simplified output data formats. These output data formats result i) harmonised to eLTER data-reporting requirements/template and ii) more readable since only essential attributes are maintained.
Using 2 other R functions, developed for solve this issue, data from external data service can be exported into eLTER data-reporting template.
Below an example for the eLTER Saldur River Catchment site, where the external data service to be queried are GBIF and iNaturalist.
saldurid <- "https://deims.org/97ff6180-e5d1-45f2-a559-8a7872eb26b1"
resSaldur <- ReLTER::get_site_speciesOccurrences(
deimsid = saldurid,
list_DS = c("gbif", "inat"),
show_map = FALSE,
limit = 20,
exclude_inat_from_gbif = TRUE
)
# GBIF
tblSaldur_gbif <- tibble::as_tibble(resSaldur$gbif)
if (nrow(tblSaldur_gbif) > 0) {
outGbif <- tblSaldur_gbif %>%
ReLTER::map_occ_gbif2elter(deimsid = saldurid)
ReLTER::save_occ_eLTER_reporting_Archive(outGbif)
}
## [1] "/var/folders/p1/110rx8q101z0wn0bwh4njrcw0000gn/T//RtmpddDOi9/biodiv_occurrence_site_97ff6180-e5d1-45f2-a559-8a7872eb26b1_gbif.zip"
# iNaturalist
tblSaldur_inat <- tibble::as_tibble(resSaldur$inat)
outInat <- tblSaldur_inat %>%
ReLTER::map_occ_inat2elter(deimsid = saldurid)
ReLTER::save_occ_eLTER_reporting_Archive(outInat)
## [1] "/var/folders/p1/110rx8q101z0wn0bwh4njrcw0000gn/T//RtmpddDOi9/biodiv_occurrence_site_97ff6180-e5d1-45f2-a559-8a7872eb26b1_inat.zip"
The eLTER useful archive created are:
biodiv_occurrence_site_97ff6180-e5d1-45f2-a559-8a7872eb26b1_gbif.zip
biodiv_occurrence_site_97ff6180-e5d1-45f2-a559-8a7872eb26b1_inat.zip
::: {#refs} :::
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.