Skip to content

Commit

Permalink
Bugfix: change to hash link, add topConcept, add citation
Browse files Browse the repository at this point in the history
---------

  Co-authored-by: Elizabeth Wenk <[email protected]>
  • Loading branch information
dfalster committed Feb 13, 2024
1 parent 31fbd8a commit 557ebad
Show file tree
Hide file tree
Showing 32 changed files with 25,534 additions and 24,061 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: traits.build
Title: A workflow for harmonising trait data from diverse sources into a documented standard structure
Version: 1.1.0.9000
Version: 1.1.0
Maintainer: Daniel Falster <[email protected]>
Authors@R: c(
person(given = "Daniel", family = "Falster", role = c("cre", "aut"), email = "[email protected]", comment = c(ORCID = "0000-0002-9814-092X")),
Expand Down
3,139 changes: 1,581 additions & 1,558 deletions docs/ontology/build_triples.csv

Large diffs are not rendered by default.

1,901 changes: 1,045 additions & 856 deletions docs/ontology/index.html

Large diffs are not rendered by default.

1,901 changes: 1,045 additions & 856 deletions docs/ontology/release/0.1.0/index.html

Large diffs are not rendered by default.

1,270 changes: 676 additions & 594 deletions docs/ontology/release/0.1.0/traits.build.json

Large diffs are not rendered by default.

3,139 changes: 1,581 additions & 1,558 deletions docs/ontology/release/0.1.0/traits.build.nq

Large diffs are not rendered by default.

3,139 changes: 1,581 additions & 1,558 deletions docs/ontology/release/0.1.0/traits.build.nt

Large diffs are not rendered by default.

1,070 changes: 548 additions & 522 deletions docs/ontology/release/0.1.0/traits.build.ttl

Large diffs are not rendered by default.

1,270 changes: 676 additions & 594 deletions docs/ontology/traits.build.json

Large diffs are not rendered by default.

3,139 changes: 1,581 additions & 1,558 deletions docs/ontology/traits.build.nq

Large diffs are not rendered by default.

3,139 changes: 1,581 additions & 1,558 deletions docs/ontology/traits.build.nt

Large diffs are not rendered by default.

1,070 changes: 548 additions & 522 deletions docs/ontology/traits.build.ttl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pandoc: 3.1.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles: {}
last_built: 2024-02-11T22:38Z
last_built: 2024-02-13T22:36Z
urls:
reference: http://traitecoevo.github.io/traits.build/reference
article: http://traitecoevo.github.io/traits.build/articles
Expand Down
1,100 changes: 550 additions & 550 deletions docs/reference/util_df_to_list.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<loc>http://traitecoevo.github.io/traits.build/404.html</loc>
</url>
<url>
<loc>http://traitecoevo.github.io/traits.build/authors.html</loc>
<loc>http://traitecoevo.github.io/traits.build/LICENSE-text.html</loc>
</url>
<url>
<loc>http://traitecoevo.github.io/traits.build/index.html</loc>
<loc>http://traitecoevo.github.io/traits.build/authors.html</loc>
</url>
<url>
<loc>http://traitecoevo.github.io/traits.build/LICENSE-text.html</loc>
<loc>http://traitecoevo.github.io/traits.build/index.html</loc>
</url>
<url>
<loc>http://traitecoevo.github.io/traits.build/news/index.html</loc>
Expand Down
20 changes: 11 additions & 9 deletions ontology/build_traits.build_ontology.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ convert_to_triples <- function(ontology_csv, published_classes_csv) {
dplyr::filter(!is.na(Object)) %>%
dplyr::mutate(
Subject = paste0("<",Subject,">"),
Object = ifelse(stringr::str_detect(Predicate,"inScheme"),paste0("<", Object, ">"), paste0("\"", Object, "\"@en"))
Object = ifelse(stringr::str_detect(Predicate,"inScheme"),
paste0("<", Object, ">"),
paste0("\"", Object, "\"@en"))
)

reformatted_ontology <-
Expand Down Expand Up @@ -83,10 +85,10 @@ convert_to_triples <- function(ontology_csv, published_classes_csv) {
dplyr::mutate(
`<http://www.w3.org/2000/01/rdf-schema#label>` = `<http://www.w3.org/2004/02/skos/core#prefLabel>`,
`<http://www.w3.org/2002/07/owl#sameAs>` = `<http://www.w3.org/2004/02/skos/core#exactMatch>`,
`<http://www.w3.org/2004/02/skos/core#inScheme>` = "traits.build"
`<http://www.w3.org/2004/02/skos/core#inScheme>` = "<https://w3id.org/traits.build>"
) %>%
dplyr::mutate(
Subject = paste0("<https://w3id.org/traits.build/",Subject,">")
Subject = paste0("<https://w3id.org/traits.build#",Subject,">")
) %>%
tidyr::pivot_longer(cols = -Subject) %>%
dplyr::rename(
Expand All @@ -106,7 +108,7 @@ convert_to_triples <- function(ontology_csv, published_classes_csv) {
paste0("\"", Object_tmp, "\"@en"),
NA),
Object = ifelse(!stringr::str_detect(Object_tmp, "\\:") & !stringr::str_detect(Predicate, "description|label|comment") & is.na(Object),
paste0("<https://w3id.org/traits.build/",stringr::str_trim(Object_tmp),">"),
paste0("<https://w3id.org/traits.build#",stringr::str_trim(Object_tmp),">"),
Object),
Object = ifelse(stringr::str_detect(Object_tmp, "\\:") & is.na(Object),
paste0("<", published_classes_csv$Entity[match(Object_tmp, published_classes_csv$identifier2)],">"),
Expand All @@ -115,12 +117,12 @@ convert_to_triples <- function(ontology_csv, published_classes_csv) {
paste0("<", Object_tmp, ">"),
Object),
Object = ifelse(stringr::str_detect(Predicate,"inScheme"),
"<https://w3id.org/traits.build/>",
"<https://w3id.org/traits.build>",
Object),
Object = ifelse(stringr::str_detect(Predicate,"created"),
paste0("\"", Object_tmp, "\"", "^^<xsd:date>"),
Object),
Subject = ifelse(Subject == "<https://w3id.org/traits.build/traits.build>", "<https://w3id.org/traits.build>", Subject)
Subject = ifelse(Subject == "<https://w3id.org/traits.build#traits.build>", "<https://w3id.org/traits.build>", Subject)
) %>%
dplyr::select(-Object_tmp)

Expand Down Expand Up @@ -158,7 +160,7 @@ triples <- triples %>%
object_tmp = stringr::str_replace(object_tmp, "@en", ""),
object_tmp = stringr::str_replace(object_tmp, "[:punct:]$",""),
object_tmp = stringr::str_replace(object_tmp, "^[:punct:]",""),
subject_tmp = stringr::str_replace(Subject, "<https://w3id.org/traits.build/", ""),
subject_tmp = stringr::str_replace(Subject, "<https://w3id.org/traits.build#", ""),
subject_tmp = stringr::str_replace(subject_tmp, "<", ""),
subject_tmp = stringr::str_replace(subject_tmp, ">", "")
)
Expand Down Expand Up @@ -189,7 +191,7 @@ true_triples <- read_nquads(file.path(output_path, "traits.build.nq"))

# serialize to any format
rdflib::rdf_serialize(true_triples, file.path(output_path, "traits.build.ttl"),
namespace = c(traits.build = "https://w3id.org/traits.build/",
namespace = c(traits.build = "https://w3id.org/traits.build#",
dc = "http://purl.org/dc/elements/1.1/",
skos = "http://www.w3.org/2004/02/skos/core#",
dwcattributes = "http://rs.tdwg.org/dwc/terms/attributes/",
Expand Down Expand Up @@ -223,4 +225,4 @@ purrr::walk(files, ~ file.copy(file.path("ontology/output/ontology", .x), file.p
# **IMPORTANT FINAL STEP**
# After generating the files within the ontology folder,
# a copy of the files needs to be copied across to build the website using:
# pkgdown::build_site()
# pkgdown::build_site()
4 changes: 2 additions & 2 deletions ontology/create_term_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ create_term_table <- function(thisterm, triples) {

output <- tibble(name = list(), description = list())

URI <- make_link(paste0(base_url, thisterm), paste0(base_url, thisterm))
URI <- make_link(paste0("w3id.org/traits.build#", thisterm), paste0(base_url, thisterm))

output <-
add_row(output, "URI", URI)
Expand Down Expand Up @@ -410,7 +410,7 @@ create_term_table <- function(thisterm, triples) {
output <-
add_row(output,
scheme_tmp$property_link,
scheme_tmp$value_link
make_link("w3id.org/traits.build", "https://w3id.org/traits.build")
)

# datatype
Expand Down
27 changes: 14 additions & 13 deletions ontology/data/traits.build_ontology.csv
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
Class,prefLabel,altLabel,oboe-core:measurementFor,oboe-core:hasMeasurement,exactMatch,broader,computational_entity,closeMatch,relatedMatch,organizedInClass,hascontext,contextof,label,Cites,refers to,has unique identifier,is unique identifier for,has identifier,is identifier for,has annotation,is annotation of,has property,is property of,is specialisation of,is base for,has basis,oboe-core:characteristicFor,oboe-core:ofEntity,oboe-core:hasValue,dcterms:description,rdfs:comment,rdf:datatype,dcterms:created
traits.build-traits,traits table,traits,,,ets:Traitdata,,SIO:SIO_000754,,ets:MeasurementOrFact; ets:Occurrence,,,,,,,,,,,,,,,,,,,,,A table containing measurements of traits.,Includes information that must be recorded at the Measurement or Observation level.,,01 February 2024
traits.build-contexts,contexts table,contexts,,,,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,"A table containing observations of contextual characteristics associated with information in `traits`. Cross referencing between the two dataframes is possible using combinations of the variables `dataset_id`, `link_id`, and `link_vals`.",,,01 February 2024
traits.build-locations,locations table,locations,,,,,SIO:SIO_000754,,ets:Occurrence,,,,,,,,,,,,,,,,,,,,,"A table containing observations of location/site characteristics associated with information in `traits`. Cross referencing between the two dataframes is possible using combinations of the variables `dataset_id`, `location_name`.",Includes information about Location properties.,,01 February 2024
traits.build-methods,methods table,methods,,,,,SIO:SIO_000754,,ets:MeasurementOrFact,,,,,,,,,,,,,,,,,,,,,"A table containing details on methods with which data were collected, including time frame and source. Cross referencing with the `traits` table is possible using combinations of the variables `dataset_id`, `trait_name`.",,,01 February 2024
traits.build-excluded_data,excluded data table,excluded_data,,,,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,"A table of data that did not pass quality tests and so were excluded from the master dataset. The structure is identical to that presented in the `traits` table, only with an extra column called `error` indicating why the record was excluded. Common reasons are missing_unit_conversions, missing_value, and unsupported_trait_value.",,,01 February 2024
traits.build-taxonomic_updates,taxonomic updates table,taxonomic_updates,,,,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,"A table of all taxonomic changes implemented in the construction of AusTraits. Changes are determined by comparing the originally submitted taxon name against the taxonomic names listed in the taxonomic reference files, best placed in a subfolder in the `config` folder . Cross referencing with the `traits` table is possible using combinations of the variables `dataset_id` and `taxon_name`.",,,01 February 2024
traits.build-taxa,taxa table,taxa,,,ets:Taxon,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,"A table containing details on taxa associated with information in `traits`. Whenever possible, this information is sourced from curated taxon lists that include identifiers for each taxon. The information compiled in this table is released under a CC-BY3 license. Cross referencing between the two dataframes is possible using combinations of the variable `taxon_name`.",,,01 February 2024
traits.build-contributors,contributors table,contributors,,,,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,A table of people contributing to each study.,,,01 February 2024
traits.build-sources,sources table,sources,,,,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,A list containing citation details for all database sources.,,,01 February 2024
traits.build-definitions,definitions table,definitions,,,ets:Traitdata,,SIO:SIO_000754,,,,,,,,,,,,,,,,,,,,,,,A list containing trait concept descriptions used to build the database.,,,01 February 2024
traits.build-schema,schema,schema,,,,,SIO:SIO_001330,,,,,,,,,,,,,,,,,,,,,,,A copy of the schema for all tables and terms. Information included here was used to process data and generate any documentation for the study.,,,01 February 2024
traits.build-metadata,metadata table,metadata,,,,,SIO:SIO_001330,ets:Metadata,,,,,,,,,,,,,,,,,,,,,,A list containing database metadata.,,,01 February 2024
traits.build-build_info,build info,build_info,,,,,SIO:SIO_001330,,,,,,,,,,,,,,,,,,,,,,,"A description of the computing environment used to create this version of the dataset, including version number, git commit and R session_info.",,,01 February 2024
traits.build-database,traits.build database,traits.build_database,,,,,SIO:SIO_000750,,,,,,,,,,,,,,,,,,,,,,,A database of 13 relational tables build using the {traits.build} R-package for harmonizing trait data.,,,01 February 2024
traits.build-traits,traits table,traits,,,ets:Traitdata,,SIO:SIO_000754,,ets:MeasurementOrFact; ets:Occurrence,traits.build-database,,,,,,,,,,,,,,,,,,,,A table containing measurements of traits.,Includes information that must be recorded at the Measurement or Observation level.,,01 February 2024
traits.build-contexts,contexts table,contexts,,,,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,"A table containing observations of contextual characteristics associated with information in `traits`. Cross referencing between the two dataframes is possible using combinations of the variables `dataset_id`, `link_id`, and `link_vals`.",,,01 February 2024
traits.build-locations,locations table,locations,,,,,SIO:SIO_000754,,ets:Occurrence,traits.build-database,,,,,,,,,,,,,,,,,,,,"A table containing observations of location/site characteristics associated with information in `traits`. Cross referencing between the two dataframes is possible using combinations of the variables `dataset_id`, `location_name`.",Includes information about Location properties.,,01 February 2024
traits.build-methods,methods table,methods,,,,,SIO:SIO_000754,,ets:MeasurementOrFact,traits.build-database,,,,,,,,,,,,,,,,,,,,"A table containing details on methods with which data were collected, including time frame and source. Cross referencing with the `traits` table is possible using combinations of the variables `dataset_id`, `trait_name`.",,,01 February 2024
traits.build-excluded_data,excluded data table,excluded_data,,,,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,"A table of data that did not pass quality tests and so were excluded from the master dataset. The structure is identical to that presented in the `traits` table, only with an extra column called `error` indicating why the record was excluded. Common reasons are missing_unit_conversions, missing_value, and unsupported_trait_value.",,,01 February 2024
traits.build-taxonomic_updates,taxonomic updates table,taxonomic_updates,,,,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,"A table of all taxonomic changes implemented in the construction of AusTraits. Changes are determined by comparing the originally submitted taxon name against the taxonomic names listed in the taxonomic reference files, best placed in a subfolder in the `config` folder . Cross referencing with the `traits` table is possible using combinations of the variables `dataset_id` and `taxon_name`.",,,01 February 2024
traits.build-taxa,taxa table,taxa,,,ets:Taxon,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,"A table containing details on taxa associated with information in `traits`. Whenever possible, this information is sourced from curated taxon lists that include identifiers for each taxon. The information compiled in this table is released under a CC-BY3 license. Cross referencing between the two dataframes is possible using combinations of the variable `taxon_name`.",,,01 February 2024
traits.build-contributors,contributors table,contributors,,,,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,A table of people contributing to each study.,,,01 February 2024
traits.build-sources,sources table,sources,,,,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,A list containing citation details for all database sources.,,,01 February 2024
traits.build-definitions,definitions table,definitions,,,ets:Traitdata,,SIO:SIO_000754,,,traits.build-database,,,,,,,,,,,,,,,,,,,,A list containing trait concept descriptions used to build the database.,,,01 February 2024
traits.build-schema,schema,schema,,,,,SIO:SIO_001330,,,traits.build-database,,,,,,,,,,,,,,,,,,,,A copy of the schema for all tables and terms. Information included here was used to process data and generate any documentation for the study.,,,01 February 2024
traits.build-metadata,metadata table,metadata,,,,,SIO:SIO_001330,ets:Metadata,,traits.build-database,,,,,,,,,,,,,,,,,,,,A list containing database metadata.,,,01 February 2024
traits.build-build_info,build info,build_info,,,,,SIO:SIO_001330,,,traits.build-database,,,,,,,,,,,,,,,,,,,,"A description of the computing environment used to create this version of the dataset, including version number, git commit and R session_info.",,,01 February 2024
dataset,dataset,dataset,,,oboe-core:ObservationCollection,,SIO:SIO_000750,,,,,,,,,dataset_id,,,,,,,,,,,,,,13 relational tables and lists containing all data about a dataset.,,,01 February 2024
observation,observation,observation,,,oboe-core:Observation,,SIO:SIO_000754,,,,,,,,,observation_id,,,,,,,,,,,,,,An Observation is a collection of measurements made at a single point in time. In traits.build it is the subset of rows within the traits data that are made on the same entity and share the same observation_id.,"An observation is an assertion that an entity (e.g., biological organisms, geographic locations, or environmental features, among others) was observed by an observer. An observation primarily serves to group a set of measurements together into a single &quot;observation event&quot;. Observations are often made within a broader context. The context of an observation is given by other observations, implying that an observed entity (and specifically each corresponding measurement) contextualizes another observed entity (and its corresponding measurements). For example, an observation associated with a location may serve as context for an observation associated with an organism. In this case, the observed characteristic values of the location (such as humidity) are assumed constant for the corresponding measurements of the organism.",,01 February 2024
observations_from_dataset,observations from dataset,observations_from_dataset,,trait_measurement; measurement_of_location_property; measurement_of_treatment_context_property; measurement_of_plot_context_property; measurement_of_entity_context_property; measurement_of_temporal_context_property,,oboe-core:ObservationCollection,SIO:SIO_000754,,,,,,,,,dataset_id,,,,,,,,,,,,dataset,,Observation collection encompassing all observations that comprise a dataset.,,,01 February 2024
Expand Down
1 change: 1 addition & 0 deletions ontology/data/traits.build_ontology_published_classes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ http://www.w3.org/2004/02/skos/core#exactMatch,has exact match,"skos:exactMatch
http://www.w3.org/2004/02/skos/core#closeMatch,has close match,"skos:closeMatch is used to link two concepts that are sufficiently similar that they can be used interchangeably in some information retrieval applications. In order to avoid the possibility of compound errors when combining mappings across more than two concept schemes, skos:closeMatch is not declared to be a transitive property.",Simple Knowledge Organization System,skos,skos,closeMatch,,http://www.w3.org/2004/02/skos/core#
http://www.w3.org/2004/02/skos/core#relatedMatch,has related match,skos:relatedMatch is used to state an associative mapping link between two conceptual resources in different concept schemes.,Simple Knowledge Organization System,skos,skos,relatedMatch,,http://www.w3.org/2004/02/skos/core#
http://www.w3.org/2004/02/skos/core#hasTopConcept,has top concept,used to link a concept scheme to the SKOS concept(s) which are topmost in the hierarchical relations for that scheme,Simple Knowledge Organization System,skos,skos,hasTopConcept,,http://www.w3.org/2004/02/skos/core#
http://www.w3.org/2004/02/skos/core#topConceptOf,is top concept in scheme,Relates a concept to the concept scheme that it is a top level concept of. ,Simple Knowledge Organization System,skos,skos,topConceptOf,,http://www.w3.org/2004/02/skos/core#
http://www.w3.org/2004/02/skos/core#ConceptScheme,concept scheme,skos:ConceptScheme is an instance of owl:Class.,Simple Knowledge Organization System,skos,skos,ConceptScheme,,http://www.w3.org/2004/02/skos/core#
http://www.w3.org/2000/01/rdf-schema#label,label,,RDF Schema,rdfs,rdfs,label,,http://www.w3.org/2000/01/rdf-schema#
http://www.w3.org/2000/01/rdf-schema#comment,comment,,RDF Schema,rdfs,rdfs,comment,,http://www.w3.org/2000/01/rdf-schema#
Expand Down
Loading

0 comments on commit 557ebad

Please sign in to comment.