eol-globi-data-js
A javascript libray to help find out what species interact (e.g. eats, is eaten by) with. Data provided via Global Biotic Interactions (GloBI, https://globalbioticinteractions.org).
example
If you'd like to see more that the samples below, please see test/ and example/ directories.
var consoleDiv = document; // lookup some species by some string 'sea otter'var { closeMatches;};globiData; // find out what a sea otter (Enhydra lutris) eats. . .var search = sourceTaxonScientificName: 'Enhydra lutris' interactionType: 'preysOn';var { interactions;};globiData; // lookup some more info (including image urls) about the sea ottervar { var name = taxonInfocommonName + ' (<i>' + taxonInfoscientificName + '</i>)'; var infoDiv = document; infoDivinnerHTML = '<table class="image"><caption align="bottom">' + name + '</caption>' + '<tr><td><img src="' + taxonInfothumbnailURL + '"/></td></tr></table>'; consoleDiv;};globiData;
usage
Make sure to include eol-globi-data-js in your project / page.
Node Package Manager (NPM)
var globiData = ;
for example node project that uses globi-data see: http://github.com/jhpoelen/eol-globi-js .
Directly into html
include globi-data-dist.js in your web resources and include using script tag.
...
For example web project, see github repository http://github.com/eol-globi/eol-globi.github.io that is deployed using github pages here: http://eol-globi.github.io .
methods
globiData.findInteractionTypes(callback)
Returns available interaction types.
globiData.findSpeciesInteractions(searchOptions, callback)
Provides a list of interactions to callback specific to search options. Possible search options are:
-
sourceTaxonScientificName
-
targetTaxonScientificName
-
interactionType
-
lat / lng: latitude, longitude of interactions.
-
nw_lat, nw_lng, se_lat, se_lng: spatial rectangle specified by north west and south east positions:
nw(lat,lng) ------ ne
| |
| |
sw ----------------se(lat,lng)
an example of search options, where we'd like to find the prey of Hardhead Catfish (Ariopsis felis) in a specific area:
options = sourceTaxonScientificName: 'Ariopsis felis' interactionType: 'preysOn' nw_lat:3052 nw_lng:-9951 se_lat: 2052 se_lng:-8275
or example of search options, where we'd like to find which Arthropods (Arthropoda) of Hardhead Catfish (Ariopsis felis) in a specific area:
options = sourceTaxonScientificName: 'Ariopsis felis' targetTaxonScientificName: 'Arthropoda' interactionType: 'preysOn' nw_lat:3052 nw_lng:-9951 se_lat: 2052 se_lng:-8275
example of returned interactions: two interactions where Hardhead Catfish (Ariopsis felis) eats Chordates (Chordata) and Palaemonid Shrimps (Palaemonidae):
"source":"name":"Ariopsis felis" "target":"name":"Chordata" "type":"preysOn" "source":"name":"Ariopsis felis" "target":"name":"Palaemonidae" "type":"preysOn"
## globiData.findCloseTaxonMatches(searchString, callback) Find close taxonomic (organism, species names) matches to provided input string.
For instance, close taxonomic matches with search string sea ottr
are:
scientificName: 'Enhydra lutris' commonNames: name: 'Seeotter' lang: 'de' name: 'sea otter' lang: 'en' path: 'Animalia' 'Chordata' 'Mammalia' 'Carnivora' 'Mustelidae' 'Enhydra' 'Enhydra lutris' ...
globiData.findSources(callback)
Find the sources that contributed one or more studies. Result is a list of string.
// example of results
globiData.findStudyStats(search, callback)
Find statistics about individual studies that contributed interaction datasets to GloBI. Optionally, you can provide a source variable in the search object to limit studies to a specific source.
// stats for only SPIRE studiesvar search = source: 'SPIRE' var { console;}globi; // stats for all studies, notice the empty search option objectglobi;
example of information retrieved:
reference: 'Nick Fotheringham Effects of Offshore Oil Field Structures on Their Biotic Environment: Benthos and Plankton'totalInteractions: 138totalSourceTaxa: 23totalTargetTaxa: 28 reference: 'Christian RR, Luczkovich JJ (1999) Organizing and understanding a winter\'s seagrass foodweb network through effective trophic levels. Ecol Model 117:99-124'totalInteractions: 270totalSourceTaxa: 82totalTargetTaxa: 85
globiData.findStats(search, callback)
Find statistics across all datasets. Optionally you can limit the statistics to studies contributed by a specific source.
// stats for only SPIRE studiesvar search = source: 'SPIRE' var { console;}globi; // stats aggregated across all studies, notice the empty search option objectglobi;
example of resulting statistics object:
numberOfStudies: 251 totalInteractions: 431842 totalSourceTaxa: 10194 totalTargetTaxa: 19477