Skip to content

Commit

Permalink
Add SSSOM official mapping slots to internal data
Browse files Browse the repository at this point in the history
  • Loading branch information
allenbaron committed Jul 12, 2024
1 parent 61bba75 commit a6f6f83
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ Suggests:
tidygraph,
waldo,
keyring,
withr
withr,
yaml
Config/testthat/edition: 3
Config/reticulate:
list(
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
24 changes: 24 additions & 0 deletions data-raw/sssom_spec.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Capture official SSSOM specification and parse for use by DO.utils
rlang::check_installed("yaml")
devtools::load_all()

sssom_version <- stringr::str_remove(
httr::HEAD("https://github.com/mapping-commons/sssom/releases/latest/")$url,
".*/"
)
sssom_yaml_path <- glueV(
"https://raw.githubusercontent.com/mapping-commons/sssom/!<<sssom_version>>!/src/sssom_schema/schema/sssom_schema.yaml"
)
.sssom_spec <- yaml::read_yaml(sssom_yaml_path)
.sssom_spec$version <- sssom_version
.sssom_spec$access_date <- Sys.Date()

.sssom_slot_types <- purrr::map_chr(.sssom_spec$slots, ~ .$range)
.sssom_mapping_slots <- .sssom_spec$classes$mapping$slots

use_data_internal(
.sssom_spec,
.sssom_slot_types,
.sssom_mapping_slots,
overwrite = TRUE
)

0 comments on commit a6f6f83

Please sign in to comment.