-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.qmd
285 lines (214 loc) · 13.5 KB
/
index.qmd
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
---
title: The AusTraits Plant Dictionary (APD) Ontology
params:
version: 2.0.0
previous_version: 1.1.0
format:
html:
smooth-scroll: true
toc: true
toc-expand: 1
embed-resources: true
---
```{r, echo=FALSE, message=FALSE, warning=FALSE}
version <- params$version
link_version <- function(v) sprintf("<https://w3id.org/APD/release/%s/index.html>", v)
```
## Release `r version`
<dl>
<dt> **Latest version**:</dt> <dd><https://w3id.org/APD/index.html> </dd>
<dt> **This version**:</dt> <dd>`r link_version(params$version)` </dd>
<dt> **Previous version**:</dt> <dd>`r link_version(params$previous_version)` </dd>
<dt> **Authors**: </dt> <dd>[Elizabeth Wenk](https://orcid.org/0000-0001-5640-5910), [Daniel Falster](https://orcid.org/0000-0002-9814-092X), [Rachael Gallagher](https://orcid.org/0000-0002-4680-8115), [Hervé Sauquet](https://orcid.org/0000-0001-8305-3236), [Rowan Brownlee](https://orcid.org/0000-0002-1955-1262), [Carl Boettiger](https://orcid.org/0000-0002-1642-628X) </dd>
<dt>**Contributors**:</dt> <dd> [Tony Auld](https://orcid.org/0000-0002-8766-2829),
[Russell Barrett](https://orcid.org/0000-0003-0360-8321),
[Timothy Brodribb](https://orcid.org/0000-0002-4964-6107),
[Brendan Choat](https://orcid.org/0000-0002-9105-640X),
[David Coleman](https://orcid.org/0000-0002-1773-6597),
[Félix de Tombeur](https://orcid.org/0000-0002-6012-8458),
[Lily Dun](https://orcid.org/0000-0002-0712-5143),
[David Ellsworth](https://orcid.org/0000-0002-9699-2272),
[Carl Gosper](https://orcid.org/0000-0002-0962-5117),
[Lydia Guja](https://orcid.org/0000-0001-5945-438X),
[Gregory J. Jordan](https://orcid.org/0000-0002-6033-2766),
[Tom Le Breton](https://orcid.org/0000-0001-9353-0067),
[Andy Leigh](https://orcid.org/0000-0003-3568-2606),
[Patricia Lu-Irving](https://orcid.org/0000-0003-1116-9402),
[Belinda Medlyn](https://orcid.org/0000-0001-5728-9827),
[Rachael Nolan](https://orcid.org/0000-0001-9277-5142),
[Mark Ooi](https://orcid.org/0000-0002-3046-0417),
[Karen D. Sommerville](https://orcid.org/0000-0002-9843-6616),
[Ruby Stephens](https://orcid.org/0000-0002-3767-2690),
[Peter Vesk](https://orcid.org/0000-0003-2008-7062),
[Matthew White](https://orcid.org/0000-0003-2120-0071),
[Ian J. Wright](https://orcid.org/0000-0001-8338-9143),
[Sophie Yang](https://orcid.org/0000-0001-7328-345X)</dd>
<dt>Human readable tables:</dt> <dd>
<span><a href="APD_traits.csv" target="_blank"><img src="https://img.shields.io/badge/APD-traits-blue.svg" alt="Traits"></a> </span>
<span><a href="APD_categorical_values.csv" target="_blank"><img src="https://img.shields.io/badge/APD-categorical_values-blue.svg" alt="categorical_values"></a> </span>
</dd>
<dt>Serializations:</dt> <dd>
<span><a href="APD.json" target="_blank"><img src="https://img.shields.io/badge/Format-JSON_LD-blue.svg" alt="JSON-LD"></a> </span>
<span><a href="APD.nt" target="_blank"><img src="https://img.shields.io/badge/Format-N_Triples-blue.svg" alt="N-Triples"></a> </span>
<span><a href="APD.nq" target="_blank"><img src="https://img.shields.io/badge/Format-N_Quads-blue.svg" alt="N-Quads"></a> </span>
<span><a href="APD.ttl" target="_blank"><img src="https://img.shields.io/badge/Format-TTL-blue.svg" alt="TTL"></a> </span></dd>
<dt>License: </dt> <dd><a href="http://purl.org/NET/rdflicense/cc-by4.0" target="_blank"><img src="https://img.shields.io/badge/License-CC%20BY%204.0-blue.svg" alt="http://purl.org/NET/rdflicense/cc-by4.0"></a> </dd>
<!-- <dt>Visualization:</dt><dd><a href="webvowl/index.html#" target="_blank"><img src="https://img.shields.io/badge/Visualize_with-WebVowl-blue.svg" alt="Visualize with WebVowl"></a></dd> -->
<dt>Vocabulary service:</dt> <dd>
<span><a href="https://vocabs.ardc.edu.au/viewById/649" target="_blank"><img src="https://img.shields.io/badge/ARDC-RVA-blue.svg" alt="JSON-LD"></a> </span> </dd>
<dt>Source:</dt> <dd>
<span><a href="https://doi.org/10.5281/zenodo.8040789" target="_blank"><img src="https://img.shields.io/badge/DOI-10.5281/zenodo.8040789-blue.svg" alt="10.5281/zenodo.8040789"></a> </span>
<span><a href="https://github.com/traitecoevo/APD" target="_blank"><img src="https://img.shields.io/badge/Github-traitecoevo/APD-blue.svg" alt="JSON-LD"></a> </span>
</dd>
<dt>Contributing:</dt> <dd>
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/traitecoevo/APD/issues) </dd>
<dt>Cite as:</dt> <dd> Wenk EH, Sauquet H, Gallagher RV, Brownlee R, Boettiger C, Coleman D, Yang S, Auld T, Barrett RL, Brodribb T, Choat B, Dun L, Ellsworth D, Gosper C, Guja L, Jordan GJ, Breton T, Leigh A, Irving PMedlyn B, Nolan R, Ooi M, Sommerville KD, Vesk P, White M, Wright IJ & Falster DS (2023) The AusTraits Plant Dictionary. bioRxiv. DOI: [10.1101/2023.06.16.545047](http://doi.org/10.1101/2023.06.16.545047) </dd>
</dl>
<!-- Examples:
https://i-adopt.github.io/index.html
https://www.w3.org/2009/08/skos-reference/skos.html
https://terminologies.gfbio.org/terms/ets/pages/#expectedunit
gt package: https://gt.rstudio.com/
-->
```{r, include=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
library(knitr)
library(readr)
library(tidyr)
library(dplyr)
library(gt)
library(purrr)
source("R/table.R")
source("R/helpers.R")
source("R/create_APD_trait_table.R")
triples_with_labels <-
read_csv("APD_triples.csv")
base_url_traits <- "https://w3id.org/APD/traits/"
base_url_glossary <- "https://w3id.org/APD/glossary/"
if (knitr::is_html_output()) {
print_table <- print_table_html
} else if (knitr::is_latex_output()) {
print_table <- print_table_pdf
} else {
print_table <- print_table_docx
}
```
# Abstract
This document describes the schema available from the APD namespace. The APD offers detailed descriptions for more than 500 plant trait concepts. It includes trait focused on plant morphology, plant nutrient concentrations, plant physiology, plant life history, and plant fire response. The definitions will be useful to researchers from diverse disciplines, including plant functional ecology, plant taxonomy, and conservation biology. All trait concepts are supported by comprehensive metadata including trait descriptions, allowable trait values, allowable ranges, preferred units, keywords, references, and links to matches in a selection of trait databases. The traits describe here also fully support the AusTraits plant trait database, <doi.org/10.5281/zenodo.3568417>.
# Table of Contents
1. [Introduction](#introduction)
2. [Trait groups](#trait-groupings): Hierarchical trait groupings, included to enhance trait findability.
3. [Trait concepts](#trait-concepts): Traits defined within the vocabulary.
4. [Values for categorical traits](#values-for-categorical-traits): Allowed categorical trait values to support the defined trait concepts.
5. [Glossary](#glossary): Terms used as keywords that were not available in other published vocabularies.
6. [Acknowledgements](#acknowledgements)
# 1. Introduction
The APD is a compilation of the traits concepts used by AusTraits, a database of Australian plant traits. APD includes definitions for nearly 500 traits pertaining to plant functional ecology and plant morphology. The metadata for each trait concept has been reviewed by multiple people. Metadata includes a trait definition, accepted units and ranges (for numeric traits), allowable values (for categorical traits), keywords and trait groupings to enhance trait findability, references, and links to identical/similar traits in other trait databases. APD will be published in a machine-readable format (rdf representation), allowing the traits to be readily re-used by other databases. This is a human-friendly output, with embedded links to the references, other trait databases and keywords/concepts borrowed from other ontologies.
The APD is a community resource and we welcome any suggestions for edits, including additional key references for each trait or other trait databases for which we should add links.
# 2. Trait groups
The APD Trait groups express broad trait groupings, with each trait concept mapped into one or more trait groups as `narrower` concepts.
```{r, results='asis', echo=FALSE, message=FALSE, warning=FALSE}
trait_groupings <-
triples_with_labels %>%
filter(Predicate == "http://www.w3.org/2004/02/skos/core#prefLabel") %>%
filter(stringr::str_detect(Subject, "trait_group_")) %>%
select(identifier = Subject)
to_match_tmp <- triples_with_labels %>%
filter(Subject_stripped %in% trait_groupings$identifier) %>%
filter(property == "preferred label") %>%
select(Subject_stripped, value)
for (thistrait in trait_groupings$identifier) {
# creating header makes anchor using header name. Aslo create an anchor using trait_ID
term_to_display <- to_match_tmp$value[match(thistrait,to_match_tmp$Subject_stripped)]
anchor <- gsub(base_url_traits, "", thistrait, fixed = TRUE)
writeLines(sprintf('\n\n <span id="%s"> </span>\n\n## %s ', anchor, term_to_display))
out <-
create_APD_trait_hierarchy_table(thistrait, triples_with_labels)
out %>% print_table()#150, 500)
}
```
# 3. Trait concepts
The APD Trait concepts express the traits defined by the APT.
```{r, results='asis', echo=FALSE, message=FALSE, warning=FALSE}
list_of_traits <-
triples_with_labels %>%
filter(Predicate == "http://www.w3.org/2004/02/skos/core#prefLabel") %>%
filter(stringr::str_detect(Subject, "trait_[:digit:]")) %>%
select(identifier = Subject)
to_match_tmp <- triples_with_labels %>%
filter(Subject_stripped %in% list_of_traits$identifier) %>%
filter(property == "preferred label") %>%
select(Subject_stripped, value)
for (thistrait in list_of_traits[[1]]) {
# creating header makes anchor using header name. Aslo create an anchor using trait_ID
term_to_display <- to_match_tmp$value[match(thistrait,to_match_tmp$Subject_stripped)]
anchor <- gsub(base_url_traits, "", thistrait, fixed = TRUE)
writeLines(sprintf('\n\n <span id="%s"> </span>\n\n## %s ', anchor, term_to_display))
out <-
create_APD_trait_table(thistrait, triples_with_labels)
out %>% print_table()#150, 600)
}
```
# 4. Values for categorical traits
This section of the ontology expresses allowed categorical trait values for each trait concept. These terms are each defined and linked to a single trait concept to reduce ambiguity.
```{r, results='asis', echo=FALSE, message=FALSE, warning=FALSE}
categorical_allowed <-
triples_with_labels %>%
filter(!stringr::str_detect(Subject, "trait_[:digit:]")) %>%
filter(!stringr::str_detect(Subject, "trait_group")) %>%
filter(stringr::str_detect(Subject, "APD\\/traits\\/[:alpha:]")) %>%
filter(Predicate == "http://www.w3.org/2004/02/skos/core#broader") %>%
select(identifier = Subject, Object) %>%
arrange(Object)
to_match_tmp <- triples_with_labels %>%
filter(Subject_stripped %in% categorical_allowed$identifier) %>%
filter(property == "preferred label") %>%
select(Subject_stripped, value)
tmp_categorical2 <- triples_with_labels %>%
filter(Subject_stripped %in% to_match_tmp$Subject_stripped) %>%
filter(property == "has broader") %>%
select(Subject_stripped, trait_name = value) %>%
left_join(to_match_tmp) %>%
left_join(categorical_allowed %>% rename(Subject_stripped = identifier)) %>%
arrange(Object)
traits_names_tmp <- tmp_categorical2 %>%
distinct(trait_name)
for (thistrait in traits_names_tmp$trait_name) {
writeLines(paste0("\n## ", thistrait, "\n\n"))
tmp_cat_select <- tmp_categorical2 %>%
filter(trait_name == thistrait)
cat_for_trait <- as.data.frame(categorical_allowed) %>% filter(categorical_allowed$identifier %in% tmp_cat_select$Subject_stripped)
for (cat_val in cat_for_trait$identifier) {
# creating header makes anchor using header name. Aslo create an anchor using trait_ID
term_to_display <- to_match_tmp$value[match(cat_val, to_match_tmp$Subject_stripped)]
anchor <- gsub(base_url_traits, "", cat_val, fixed = TRUE)
writeLines(sprintf('\n\n <span id="%s"> </span>\n\n## %s ', anchor, term_to_display))
out <-
create_APD_categorical_values_table(anchor, triples_with_labels)
out %>% print_table()#150, 500)
}
}
```
# 5. Glossary
This section of the ontology includes terminology used within trait concept descriptions that are not defined by other resources.
```{r, results='asis', echo=FALSE, message=FALSE, warning=FALSE}
glossary_terms <-
triples_with_labels %>%
filter(Predicate == "http://www.w3.org/2004/02/skos/core#prefLabel") %>%
filter(stringr::str_detect(Subject, "glossary_")) %>%
select(identifier = Subject)
for (thistrait in glossary_terms$identifier) {
to_match_tmp <- triples_with_labels %>%
filter(Subject_stripped %in% glossary_terms$identifier) %>%
filter(property == "preferred label") %>%
select(Subject_stripped, value)
# creating header makes anchor using header name. Aslo create an anchor using trait_ID
term_to_display <- to_match_tmp$value[match(thistrait, to_match_tmp$Subject_stripped)]
anchor <- gsub(base_url_glossary, "", thistrait, fixed = TRUE)
writeLines(sprintf('\n\n <span id="%s"> </span>\n\n## %s ', anchor, term_to_display))
out <-
create_APD_trait_glossary_table(thistrait, triples_with_labels)
out %>% print_table()#150, 500)
}
```
# 6. Acknowledgements
We are grateful to S Cox, J Smillie, K Levett, M Barlow, and C Brady for useful conversations. The AusTraits project received investment (<https://doi.org/10.47486/TD044>, <https://doi.org/10.47486/DP720>) from the Australian Research Data Commons (ARDC). The ARDC is funded by the National Collaborative Research Infrastructure Strategy (NCRIS).