-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SSSOM official mapping slots to internal data
- Loading branch information
1 parent
61bba75
commit a6f6f83
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |