-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathreferences.html
118 lines (106 loc) · 6.68 KB
/
references.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
layout: default
title: references
permalink: references
---
<div class="ui-widget">
<div id="contributors">
<p>GloBI currently includes <span id="studies">(...)</span> <a href="http://depot.globalbioticinteractions.org/snapshot/target/data/tsv/citations.tsv.gz" title="list of references/studies, their sources and statistics">references</a> obtained from <span id="sources">(...)</span> <a href="http://api.globalbioticinteractions.org/reports/sources.tsv" title="list of sources and statistics">datasets</a>. In total,
<span id="interactions">(...)</span> <a href="https://depot.globalbioticinteractions.org/snapshot/target/data/tsv/interactions.tsv.gz" title="species interaction record archive with resolved taxa, geospatial-temporal data, interaction types, and associated citations">interaction records</a> were discovered, covering <span id="distinctTaxa">(...)</span> <a href="https://depot.globalbioticinteractions.org/snapshot/target/data/taxa/taxonCache.tsv.gz" title="list of taxa/terms (and associated rank, path, or ids) that occur within GloBI">taxa</a>.
A <a href="https://depot.globalbioticinteractions.org/snapshot/target/data/taxa/taxonMap.tsv.gz" title="maps provided names/ids to existing taxonomies/terms">taxon map</a> shows how these taxa relate to other projects (e.g., <a href="http://ncbi.nlm.nih.gov/taxonomy" target="_blank">NCBI</a>, <a href="http://www.marinespecies.org" target="_blank">WoRMS</a>, <a href="https://itis.gov">ITIS</a>, and <a href="http://eol.org" target="_blank">EOL</a>).</p>
<p>If you'd like to learn more about how GloBI accesses, interprets, integrates, and indexes existing species interaction dataset, please have a look a <a href="process">Data Integration Process page</a>.</p>
</div>
<p>Below, you can search for references that contain species interaction records. Example queries: <a href="?sourceTaxon=Enhydra%20lutris&interactionType=eats">Which references document sea otters (<em>Enhydra lutris</em>) prey?</a> or <a href="?sourceTaxon=Apis&interactionType=pollinates">Who documented what honey bees (Apis) pollinate?</a></p>
<p class="question">Which references containing <input id="studySearchField" autocomplete="off" placeholder="terms / doi"/> claim that
<input id="taxonInputField" class="suggest" autocomplete="off" placeholder="some organism"/>
{% include interactionTypeSelector.html %}
<input id="targetTaxonInputField" class="suggest" autocomplete="off" placeholder="some other organism"/>?
</p>
<div id="info" class="summary"></div>
<table id="result" class="answers"></table>
</div>
<script src="js/globi-web-min.js"></script>
<script>
var $ = globiWeb.globi.jQuery;
var globiData = globiWeb.globi.globiData;
var queryString = globiWeb.queryString;
var formatNumber = globiWeb.formatNumber;
var offsetDefault = 0;
var limitDefault = 1024;
</script>
<script src="js/links.js"></script>
<script>
$(function () {
var searchForInteractions = function (offset) {
$('thead, #moreButton').remove();
if (!offset) {
$('.interaction').remove();
}
var searchParams = collectSearchParams($);
var search = searchParams.search;
search.limit = limitDefault;
search.offset = offset || offsetDefault;
search.includeObservations = true;
saveSearch(searchParams);
var callback = function (interactions) {
var resultFragment = document.createDocumentFragment();
var distinctCitations = {};
var nInteractions = 0;
var nDistinctCitations = 0;
if (interactions.length == 0) {
var row = resultFragment.appendChild(document.createElement('tr'));
row.setAttribute('class', 'interaction');
row.innerHTML = 'No references found. Bummer! Please change your search criteria or <a href="https://github.com/globalbioticinteractions/globalbioticinteractions/wiki/How-to-Contribute-Data-to-Global-Biotic-Interactions%3F" target="_blank">contribute data</a>.'
}
interactions.forEach(function (interaction) {
var citationKey = encodeURIComponent(interaction.study_citation + interaction.study_source_citation);
nInteractions += 1;
if (document.getElementById(citationKey) === null && distinctCitations[citationKey] === undefined) {
var row = resultFragment.appendChild(document.createElement('tr'));
row.setAttribute('class', 'interaction');
row.setAttribute('id', citationKey);
appendCitationTo(interaction, row, '/index.html');
distinctCitations[citationKey] = interaction;
nDistinctCitations += 1;
}
});
if (nInteractions == limitDefault) {
var button = document.querySelector('#moreButton');
if (!button) {
button = document.createElement('button');
button.setAttribute('id', 'moreButton');
button.addEventListener('click', function (event) {
searchForInteractions(search.offset + limitDefault);
});
button.textContent = 'more...';
}
resultFragment.appendChild(button);
}
var result = document.getElementById('result');
result.appendChild(resultFragment);
};
globiData.findSpeciesInteractions(search, callback);
};
addInputEvents($, globiData, searchForInteractions);
});
var loadStats = function () {
globiData.findStats({}, function (stats) {
var interDiv = document.getElementById('interactions');
interDiv.innerHTML = '<b>' + formatNumber()(stats.totalInteractions) + '</b>';
var tgtTaxa = document.getElementById('distinctTaxa');
tgtTaxa.innerHTML = '<b>' + formatNumber()(stats.totalTaxa) + '</b>';
var studies = document.getElementById('studies');
studies.innerHTML = '<b>' + formatNumber()(stats.numberOfStudies) + '</b>';
var references = document.getElementById('sources');
references.innerHTML = '<b>' + formatNumber()(stats.numberOfDistinctSources) + '</b>';
});
};
var init = function () {
initInputFields();
loadStats();
};
window.addEventListener('load', function (e) {
init();
addPopState(init);
});
</script>