diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ec5e29a..92aec33 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -41,6 +41,232 @@ Our procedures for contributing bigger changes, code in particular, generally fo - We use [testthat](https://cran.r-project.org/package=testthat) for unit tests. Contributions with test cases included are easier to accept. +## Synchronizing with `hubverse-org/schemas` + +The canonical home for the hubverse schemas are at +https://github.com/hubverse-org/schemas. These schemas are copied over here +under the `inst/schemas` folder, which allows offline validation for hubs. + +**If you are developing against an in-development version of the hubverse +schemas, you must ensure that the schemas in this repository are synchronized.** + +### Synchronization script + +The script that synchronizes the schemas is in +[data-raw/schemas.R](https://github.com/hubverse-org/hubUtils/blob/main/data-raw/schemas.R) +and it can be run from within R, as a standalone script, or as a git hook. It +takes one environment variable `HUBUTILS_DEV_BRANCH`. **If the environment +variable is unset, the branch information from the `inst/schemas/update.json` +is used.** + +#### Usage: within R + +```r +source("data-raw/schemas.R") +``` + +#### Usage: from BASH + +```bash +Rscript data-raw/schemas.R +``` + +#### Usage: commit hook + +```bash +git push +``` + +See [Installing the Git Hook](#installing-the-git-hook). A Git hook is a way to +run a local script before or after you do something in Git. For example, a +pre-push hook (the one we use here) will run every time before you push to the +remote repository. + +#### Details + +By default, this script will make a single call to the GitHub API to determine +the status of the most recent commit on the branch listed in +`inst/schemas/update.json`. If the sha and branch match and the timestamp is +ahead of the the most recent commit, then you are good to go! + +If an update is needed, then your system git is used to clone the branch and +copy it over to `inst/schemas`. + +When running this as a script (not interactive), then when a schema update +happens, the tests are re-run. + + +### Synchronizing a development branch + +In order to synchronize a development branch, you should set a temporary +environment variable called `HUBUTILS_DEV_BRANCH` to the name of the branch. +This can only be done interactively in R or as a BASH script. + +#### Via R + +```r +Sys.setenv("HUBUTILS_DEV_BRANCH" = "br-v4.0.1") +source("data-raw/schemas.R") +#> ✔ removing /path/to/hubUtils/inst/schemas +#> ✔ Creating inst/schemas/. +#> ℹ Fetching the latest version of the schemas from GitHub +#> Cloning into '/path/to/temp/folder'... +#> ✔ Copying v4.0.1, v4.0.0, v3.0.1, v3.0.0, v2.0.1, v2.0.0, v1.0.0, v0.0.1, v0.0.0.9, +#> and NEWS.md to inst/schemas +#> [ ... snip ... ] +#> ✔ Done +#> ✔ Schemas up-to-date! +#> ℹ branch: "br-v4.0.1" +#> ℹ sha: "43b2c8aceb3a316b7a1929dbe8d8ead2711d4e84" +#> ℹ timestamp: "2024-12-19T16:40:16Z" +Sys.unsetenv("HUBUTILS_DEV_BRANCH") +``` + +#### Via BASH + +When run via script (both manually and via git hook), if any synchronization +happens, tests are automatically run: + +```bash +HUBUTILS_DEV_BRANCH=br-v4.0.1 Rscript data-raw/schemas.R \ +&& unsetenv HUBUTILS_DEV_BRANCH +#> ✔ removing /path/to/hubUtils/inst/schemas +#> ✔ Creating inst/schemas/. +#> ℹ Fetching the latest version of the schemas from GitHub +#> Cloning into '/path/to/temp/folder'... +#> ✔ Copying v4.0.1, v4.0.0, v3.0.1, v3.0.0, v2.0.1, v2.0.0, v1.0.0, v0.0.1, v0.0.0.9, +#> and NEWS.md to inst/schemas +#> [ ... snip ... ] +#> ✔ Done +#> ✔ Schemas up-to-date! +#> ℹ branch: "br-v4.0.1" +#> ℹ sha: "43b2c8aceb3a316b7a1929dbe8d8ead2711d4e84" +#> ℹ timestamp: "2024-12-19T16:40:16Z" +#> +#> ── ⚠ schema updated ── +#> +#> ! Re-running tests. +#> ℹ Testing hubUtils +#> ✔ | F W S OK | Context +#> ✔ | 7 | as_config +#> ✔ | 9 | as_model_out_tbl +#> ✔ | 5 | check_deprecated_schema +#> ✔ | 17 | model_id_merge +#> ✔ | 7 | read_config [6.4s] +#> ✔ | 7 | utils-get_hub +#> ✔ | 16 | utils-model_out_tbl +#> ✔ | 14 | utils-round_ids +#> ✔ | 8 | utils-round-config +#> ✔ | 39 | utils-schema-versions +#> ✔ | 14 | utils-schema [1.2s] +#> ✔ | 3 | utils-task_ids +#> ✔ | 7 | v3-schema-utils +#> +#> ══ Results ════════════════════════════ +#> Duration: 9.0 s +#> +#> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 153 ] +#> ✔ OK +``` + +### Installing the Git Hook + +It is optional, but recommended to use this script as a pre-push hook so that +the schemas are checked for updates before each commit. + +```r +usethis::use_git_hook("pre-push", readLines(usethis::proj_path("data-raw/schemas.R"))) +``` + +This will create or overwrite `.git/hooks/pre-push`. + +**If you want to uninstall the git hook, remove the `.git/hooks/pre-push` +file** + +In addition to checking that the schemas in `inst/schemas` are synchronized, [as +demonstrated above](#via-bash), this hook will also check: + + 1. the local hook is up-to-date + 2. the `inst/schemas` folder contents are all committed + + +When you install this as a git hook, you will get a message before every +successful push: + +``` +$ git push +#> +#> ── pre-push: schema synchronization ─────────────────────────────────────── +#> +#> ── pre-push: checking that the hook is up-to-date ── +#> +#> ✔ Setting active project to "/path/to/hubUtils". +#> ✔ OK +#> +#> ── pre-push: checking that schemas are up-to-date ── +#> +#> → branch: "main" +#> → sha: "0163a89cc38ba3846cd829545f6d65c1e40501a6" +#> → timestamp: "2024-12-19T16:56:13Z" +#> ✔ OK +#> +#> ── pre-push: checking for changes in inst/schemas ── +#> +#> ✔ OK +``` + +#### When the schema updates + +If the schemas are updated but not committed, this hook will prevent you from +pushing the changes until they are updated: + +``` +$ git push +#> [ ... snip ... ] +#> +#> ── ⚠ schema updated ── +#> +#> [ ... snip ... ] +#> ✔ OK +#> +#> ── pre-push: checking for changes in inst/schemas ── +#> +#> Error in `check_status()`: +#> ! New schemas must be committed before pushing. +#> Backtrace: +#> ▆ +#> 1. └─global check_status(usethis::proj_path()) +#> 2. └─cli::cli_abort(c("New schemas must be committed before pushing.")) +#> 3. └─rlang::abort(...) +#> Execution halted +#> error: failed to push some refs to 'https://github.com/hubverse-org/hubUtils.git' +``` + +#### When the script changes + +If the git hook script changes, you will be given instructions to update: + +``` +$ git push +#> +#> ── pre-push: schema synchronization ─────────────────────────────────────── +#> +#> ── pre-push: checking that the hook is up-to-date ── +#> +#> ✔ Setting active project to "/path/to/hubUtils". +#> Error in `check_hook()`: +#> ! git hook outdated +#> ℹ Use `usethis::use_git_hook("pre-push", readLines(usethis::proj_path("data-raw/schemas.R")))` +#> to update your hook. +#> Backtrace: +#> ▆ +#> 1. └─global check_hook(usethis::proj_path()) +#> 2. └─cli::cli_abort(c("git hook outdated", i = "Use {.code {cmd}} to update your hook.")) +#> 3. └─rlang::abort(...) +#> Execution halted +#> error: failed to push some refs to 'https://github.com/hubverse-org/hubUtils.git' +``` + ## Code of Conduct Please note that the hubUtils project is released with a diff --git a/NEWS.md b/NEWS.md index af2145d..d672c21 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # hubUtils (development version) +* Released schemas are now shipped with the package, so an internet connection + is no longer necessary for local validation. * Added `subset_task_id_names()` function to subset task ID names from a character vector of column names (#149). * Added functions `subset_task_id_cols()` and `subset_std_cols()` to subset a `model_out_tbl` or submission `tbl` to task ID or standard (non-task ID) columns respectively (#149). diff --git a/R/utils-schema.R b/R/utils-schema.R index 9a96641..37327c3 100644 --- a/R/utils-schema.R +++ b/R/utils-schema.R @@ -39,6 +39,10 @@ get_schema_url <- function(config = c("tasks", "admin", "model"), #' @examplesIf asNamespace("hubUtils")$not_rcmd_check() #' get_schema_valid_versions() get_schema_valid_versions <- function(branch = "main") { + if (branch == "main") { + schema_path <- system.file("schemas", package = "hubUtils") + return(list.files(schema_path, pattern = "^v")) + } branches <- gh( "GET /repos/hubverse-org/schemas/branches" ) %>% @@ -75,6 +79,21 @@ get_schema_valid_versions <- function(branch = "main") { #' schema_url <- get_schema_url(config = "tasks", version = "v0.0.0.9") #' get_schema(schema_url) get_schema <- function(schema_url) { + # If the branch is "main", then we can use the stored schemas inside the + # package. + pieces <- extract_schema_info(schema_url) + if (pieces$branch[1] == "main") { + ver <- pieces$version + cfg <- pieces$config + path <- system.file("schemas", ver, cfg, package = "hubUtils") + if (fs::file_exists(path)) { + return(jsonlite::prettify(readLines(path))) + } else { + cli::cli_alert_warning("{.file {ver}/{cfg}} not found. + This could mean your version of hubUtils is outdated. + Attempting to connect to GitHub.") + } + } response <- try(curl_fetch_memory(schema_url), silent = TRUE) if (inherits(response, "try-error")) { @@ -96,6 +115,28 @@ get_schema <- function(schema_url) { } } +#' Given a vector of URLs, this will extract the branch version and config for +#' each +#' +#' @param id a url for a given hubverse schema +#' @return a data frame with three columns: branch, version, and config +#' +#' @noRd +#' @examples +#' urls <- c( +#' "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.1/tasks-schema.json", +#' "https://raw.githubusercontent.com/hubverse-org/schemas/main/v2.0.0/admin-schema.json", +#' "https://raw.githubusercontent.com/hubverse-org/schemas/br-v4.0.0/v4.0.0/tasks-schema.json" +#' ) +#' extract_schema_info(urls) +extract_schema_info <- function(id) { + lead <- "^https[:][/][/]raw.githubusercontent.com[/]hubverse-org[/]schemas[/]" + good_stuff <- "(.+?)[/](v[0-9.]+?)[/]([a-z]+?-schema.json)$" + pattern <- paste0(lead, good_stuff) + proto <- setNames(character(3), c("branch", "version", "config")) + utils::strcapture(pattern, id, proto) +} + #' Get the latest schema version #' #' Get the latest schema version from the schema repository if "latest" requested diff --git a/data-raw/schemas.R b/data-raw/schemas.R new file mode 100644 index 0000000..b1c45b9 --- /dev/null +++ b/data-raw/schemas.R @@ -0,0 +1,228 @@ +#!/usr/bin/env Rscript +# Update the schemas with our repository +# +# This will delete our existing schemas folder, re-clone the git repository, +# and copy over the schemas and the NEWS to our inst folder. +# +# Since every release is static and the schemas do not materially change, we +# should not see any diffs in the established schemas +# +# This will update the schemas in this repository and update a tracker json file +# called inst/schemas/update.json with the following information: +# +# - branch: The branch the latest version was updated from +# - sha: The schemas repo commit hash of the latest version +# - timestamp: A timestamp of the last update (in ISO 8601 timestamp format, +# UTC time) +# +# USAGE: +# +# GIT HOOK +# ======== +# +# This script can be used as a pre-push hook and will run every time before +# you push. You can install it with: +# +# ``` +# usethis::use_git_hook("pre-push", readLines("data-raw/schemas.R")) +# ``` +# +# If you run this and the schema updates, then you will need to double-check +# your tests to make sure the updates did not affect your work. +# +# STANDALONE +# ========== +# +# This script will check for updates to be had in the branch defined in +# `inst/schemas/update.json` by default. If are no updates to be had, nothing +# will be done: +# +# ``` +# source("data-raw/schemas.R") +# #> ✔ Schemas up-to-date! +# #> ℹ branch: "main" +# #> ℹ sha: "0163a89cc38ba3846cd829545f6d65c1e40501a6" +# #> ℹ timestamp: "2024-12-19T16:26:33Z" +# ``` +# +# TO CHANGE THE BRANCH, update the environment variable called +# `HUBUTILS_DEV_BRANCH`: +# +# ``` +# Sys.setenv("HUBUTILS_DEV_BRANCH" = "br-v4.0.1") +# source("data-raw/schemas.R") +# #> ✔ removing /path/to/hubUtils/inst/schemas +# #> ✔ Creating inst/schemas/. +# #> ℹ Fetching the latest version of the schemas from GitHub +# #> Cloning into '/var/folders/9p/m996p3_55hjf1hc62552cqfr0000gr/T//Rtmp3Q4dnp/file377d +# #> 71aaebd4'... +# #> ✔ Copying v4.0.1, v4.0.0, v3.0.1, v3.0.0, v2.0.1, v2.0.0, v1.0.0, v0.0.1, v0.0.0.9, +# #> and NEWS.md to inst/schemas +# #> [ ... snip ... ] +# #> ✔ Done +# #> ✔ Schemas up-to-date! +# #> ℹ branch: "br-v4.0.1" +# #> ℹ sha: "43b2c8aceb3a316b7a1929dbe8d8ead2711d4e84" +# #> ℹ timestamp: "2024-12-19T16:40:16Z" +# ``` + +# FUNCTIONS ------------------------------------------------------------------- +script_name <- function() { + cmd <- commandArgs() + basename(sub("--file=", "", cmd[grepl("--file=", cmd, fixed = TRUE)], fixed = TRUE)) +} + +check_status <- function(repo_path) { + git_stat <- system2( + "git", + c("-C", repo_path, "status", "--short", "--porcelain"), + stdout = TRUE + ) + paths <- dirname(substring(git_stat, 4, nchar(git_stat))) + if (any(startsWith(paths, "inst/schemas"))) { + cli::cli_abort( + c( + "New schemas must be committed before pushing." + ) + ) + } +} + +not_hook <- function() interactive() || script_name() != "pre-push" +is_hook <- Negate(not_hook) + +check_hook <- function(repo_path) { + # if this is running as a git hook, then the first thing to do is to make sure + # it is up to date with the source material. If it's not, error until it is + # fixed. + if (not_hook()) { + return() + } + cli::cli_h2("{.strong pre-push}: checking that the hook is up-to-date") + hook <- fs::path(repo_path, ".git/hooks/pre-push") + if (fs::file_exists(hook)) { + schema_script <- fs::path(repo_path, "data-raw/schemas.R") + okay <- tools::md5sum(hook) == tools::md5sum(schema_script) + if (isTRUE(okay)) { + cli::cli_alert_success("OK") + } else { + cmd <- r"[usethis::use_git_hook("pre-push", readLines(usethis::proj_path("data-raw/schemas.R")))]" # nolint: object_usage_linter + cli::cli_abort( + c( + "git hook outdated", + "i" = r"[Use {.code {cmd}} to update your hook.]" + ) + ) + } + } else { + cli::cli_alert("No pre-push hook registered") + } +} + +get_branch <- function(update_cfg_path) { + if (fs::file_exists(update_cfg_path)) { + branch <- jsonlite::read_json(update_cfg_path)$branch + } else { + branch <- "main" + } + branch +} + +timestamp <- function() { + format(Sys.time(), "%Y-%m-%dT%H:%M:%SZ", tz = "UTC") +} + +get_latest_commit <- function(branch) { + res <- gh::gh("GET /repos/hubverse-org/schemas/branches/{branch}", + branch = branch + ) + res$commit +} + +check_for_update <- function(update_cfg_path, branch) { + update <- FALSE + if (is_hook()) { + cli::cli_h2("{.strong pre-push}: checking that schemas are up-to-date") + } + # If there is no config file, then we automatically update + if (!fs::file_exists(update_cfg_path)) { + update <- TRUE + cfg <- list( + branch = branch, + sha = NULL, + timestamp = "2024-07-16T00:00:00Z" + ) + } else { + cfg <- jsonlite::read_json(update_cfg_path) + } + # Fetch the latest commit, and check if either the branch has changed, or its + # outdated (based on commit date) + the_commit <- get_latest_commit(branch) + branch_change <- cfg$branch != branch + outdated <- cfg$timestamp < the_commit$commit$author$date + sha_different <- cfg$sha != the_commit$sha + + update <- update || (branch_change || outdated || sha_different) + if (update) { + cfg$branch <- branch + cfg$sha <- the_commit$sha + cfg$timestamp <- timestamp() + } + return(list(update = update, cfg = cfg)) +} + +# VARIABLES ------------------------------------------------------------------ +if (is_hook()) { + cli::cli_h1("{.strong pre-push}: schema synchronization") +} +check_hook(usethis::proj_path()) +schemas <- usethis::proj_path("inst/schemas") +cfg_path <- fs::path(schemas, "update.json") +branch <- Sys.getenv("HUBUTILS_DEV_BRANCH", unset = get_branch(cfg_path)) +new <- check_for_update(cfg_path, branch) + +# PROCESS UPDATE IF NEEDED --------------------------------------------------- +if (new$update) { + cli::cli_alert_success("removing {.file {schemas}}") + fs::dir_delete(schemas) + usethis::use_directory("inst/schemas") + + cli::cli_alert_info("Fetching the latest version of the schemas from GitHub") + tmp <- tempfile() + system2("git", c("clone", "--branch", branch, "https://github.com/hubverse-org/schemas.git", tmp)) + + versions <- as.character(fs::dir_ls(tmp, type = "dir")) + cli::cli_alert_success("Copying {.file {c(rev(fs::path_file(versions)), 'NEWS.md')}} to {.file inst/schemas}") + purrr::walk(versions, fs::dir_copy, schemas) + fs::file_copy(fs::path(tmp, "NEWS.md"), schemas) + fs::dir_tree(schemas) + fs::dir_delete(tmp) + jsonlite::write_json(new$cfg, + path = cfg_path, + pretty = TRUE, + auto_unbox = TRUE + ) + cli::cli_alert_success("Done") +} + +# REPORT STATUS -------------------------------------------------------------- +cli::cli_alert("branch: {.val {new$cfg$branch}}") +cli::cli_alert("sha: {.val {new$cfg$sha}}") +cli::cli_alert("timestamp: {.val {new$cfg$timestamp}}") +cli::cli_alert_success("OK") + +# GIT HOOK: RE-TEST ON UPDATE ------------------------------------------------ +# If this is being run as a git hook and the schemas were updated, we need +# to signal that the tests should be run again +if (!interactive() && new$update) { + cli::cli_h2("{cli::symbol$warning} {.strong schema updated}") + cli::cli_alert_info("Re-running tests") + devtools::test(usethis::proj_path()) + cli::cli_alert_success("OK") +} +# GIT HOOK: CHECK FOR UNCOMMITTED CHANGES ------------------------------------ +if (is_hook()) { + cli::cli_h2("{.strong pre-push}: checking for changes in {.path inst/schemas}") + check_status(usethis::proj_path()) + cli::cli_alert_success("OK") +} diff --git a/inst/schemas/NEWS.md b/inst/schemas/NEWS.md new file mode 100644 index 0000000..843bf81 --- /dev/null +++ b/inst/schemas/NEWS.md @@ -0,0 +1,54 @@ +# v4.0.0 + +* BREAKING CHANGE: Introduction of `is_required` boolean property at the `output_type` level to configure whether the output type is required for submissions to be considered valid (#99). +* BREAKING CHANGE: Disallowed `optional` property in `output_type_id` objects. As such, when a given output type is submitted, values for all output type IDs much be submitted (#100,#101, #102). +* BREAKING CHANGE: To improve cross-platform interoperability, expectation of missing values in point estimate `output_type_id` `required` properties now encoded with `null` instead of `["NA"]` (#109). +* Introduction of optional `derived_task_ids` properties to enable hub administrators to define derived task IDs (i.e. task IDs whose values depend on the values of other task IDs). The higher level `derived_task_ids` property sets the property globally at the hub level but can be overriden by the round level `derived_task_ids` property. The property allows for primarily validation functionality to ignore such task IDs when appropriate which can significantly improve validation efficency (#96). For more information see [`hubValidations` documentation on ignoring derived task IDs](https://hubverse-org.github.io/hubValidations/articles/validate-pr.html#ignoring-derived-task-ids-to-improve-performance). +* Added more specific schema for `target_keys` to ensure only `string` properties are allowed (#97) +* Removed the requirement for a minimum value of zero in `cdf` numeric `output_type_id`s (#113). +* Ensured that additional properties are not allowed in lower level properties (e.g. individual task IDs, `output_type` objects etc). Custom additional properties are only allowed at the `round` level, while additional task ID objects that match the expected task ID schema are allowed in the `task_ids` object (#114). + +# v3.0.1 + +* Introduction of optional `output_type_id_datatype` property to enable hub administrators to configure and communicate the `output_type_id` column data type at a hub level. This will allow hubs to override default behaviour of automatically determinining the simplest data type that can accomodate output type IDs across all output types when creating hub schema. The setting is also useful for administrators to future proof the `output_type_id` column from potential issues arising by changes in data type, introduced by new output types after submissions have begun, by setting `output_type_id_datatype` to the simplest data type from the start, i.e. character (#87). +* Removed restrictive epidemic week formatting requirements for CDF `output_type_id` values. Character output type IDs no longer need to conform to the regex pattern `^EW[0-9]{6}` (e.g. `"EW202240"`) (#80). + + + +# v3.0.0 + +* Breaking change: introduction of new `sample` output type id schema specification in `tasks.json`. The main breaking change is the removal of the `output_type_id` property in `sample`. Instead, the collection of samples is defined through a new `output_type_id_params` object (#70). +* Breaking change: The `repository_url` and `repository_host` properties in `admin.json` have been deprecated in favour of a sigle `repository` object with separate `host`, `owner` and `name` properties (#67). +* Breaking change: The optional `hub_models` property in `admin.json` has been removed as it's schema could create conflicts with the `model_abbr` and `team_abbr` schema specification in the hub administered `model-metadata-schema.json (#77). +* Additional properties are now allowed at the round item property level (#74). +* Host organisation name changed in schema `id` properties to `hubverse-org` throughout all schema versions. + +# v2.0.1 + +* Non-breaking change: introduced an optional `cloud` group to `admin-schema.json` to support cloud-enabled Hubs: + * `cloud` group includes a boolean `enabled` property to indicate whether or not the hub will store data in the cloud. + * `cloud.host` is an object with properties that describe the cloud storage provider and location. It is required when `cloud.enabled` is `true`. + +# v2.0.0 + +* Major breaking change: Output type property `type_id` renamed to `output_type_id` for consistency in with changes in model output data. +* Added `uniqueItem` checks to all `optional` and `required` arrays. +* Added a schema to `task_ids` `additionalProperty` property instead of just setting it to `true`. This schema ensures that any custom task IDs added by hub administrators at least checked for being objects and having `optional` and `required` properties that are either arrays or null. +* Added standard task IDs `forecast_date` (equivalent to `origin_date`), `target_end_date` (equivalent to `target_date`) and `target_variable` & `target_outcome` which can be used to split targets across two task IDs. + +# v1.0.0 + +* Major breaking change: `categorical` output type renamed to `pmf` for consistency in terminology. +* Target type `"categorical"` also renamed to `"nominal"`. +* Minor bug fixes and consistency improvements. +* Added NEWS.md for recording changes to schema. + + +# v0.0.1 + +* First stable version of schema for use with Hubs +* Important properties introduced: + * `schema_version` (required) to link a given congif file to a specific config file schema. + * `target_metadata` (required) objects to append metadata about targets to model tasks. + * `file_format` (required in `admin-schema.json` and optional within `tasks-schema.json` rounds) to specify accepted file formats of model output file submissions. +* Removed `model-schema.json`. Examples of these will live in `hubTemplate` repositories and defined by hub administrators. diff --git a/inst/schemas/update.json b/inst/schemas/update.json new file mode 100644 index 0000000..6e02f6f --- /dev/null +++ b/inst/schemas/update.json @@ -0,0 +1,5 @@ +{ + "branch": "main", + "sha": "0163a89cc38ba3846cd829545f6d65c1e40501a6", + "timestamp": "2024-12-19T16:56:13Z" +} diff --git a/inst/schemas/v0.0.0.9/admin-schema.json b/inst/schemas/v0.0.0.9/admin-schema.json new file mode 100644 index 0000000..ec4acba --- /dev/null +++ b/inst/schemas/v0.0.0.9/admin-schema.json @@ -0,0 +1,633 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/hubverse-org/schemas/blob/main/v0.0.0.9/admin-schema.json", + "title": "Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": "US COVID-19 Forecast Hub​" + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": "The Consortium of Infectious Disease Modeling Hubs" + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository_host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "github" + ] + }, + "repository_url": { + "description": "The url for the hub repository.", + "type": "string", + "examples": "https://github.com/reichlab/covid19-forecast-hub" + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": 44 + }, + "hub_models": { + "description": "Array of ensemble and baseline models produced by the hub", + "type": "array", + "items": { + "type": "object", + "properties": { + "team_abbr": { + "description": "Abbreviated team name of the hub", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_abbr": { + "description": "Abbreviated name of the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_type": { + "description": "The type of model: baseline or ensemble", + "type": "string", + "enum": [ + "baseline", + "ensemble" + ] + } + } + } + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": "Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w" + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model_output/` assumed", + "default": "model_output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository_url", + "timezone" + ] +} diff --git a/inst/schemas/v0.0.0.9/model-schema.json b/inst/schemas/v0.0.0.9/model-schema.json new file mode 100644 index 0000000..14c125c --- /dev/null +++ b/inst/schemas/v0.0.0.9/model-schema.json @@ -0,0 +1,192 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/hubverse-org/schemas/blob/main/v0.0.0.9/model-schema.json", + "title": "ForecastHub model metadata", + "description": "This is the schema of the model metadata file, please refer to https://github.com/epiforecasts/covid19-forecast-hub-europe/wiki/Metadata[an] for more information.", + "type": "object", + "properties": { + "schema_version": { + "type": "string", + "format": "uri" + }, + "team_name": { + "description": "The name of the team submitting the model", + "type": "string" + }, + "team_abbr": { + "description": "Abbreviated name of the team submitting the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_name": { + "description": "The name of the model", + "type": "string" + }, + "model_abbr": { + "description": "Abbreviated name of the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_version": { + "description": "Identifier of the version of the model", + "type": "string" + }, + "model_contributors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "affiliation": { + "type": "string" + }, + "orcid": { + "type": "string", + "pattern": "^\\d{4}\\-\\d{4}\\-\\d{4}\\-[\\dX]{4}$" + }, + "email": { + "type": "string", + "format": "email" + }, + "twitter": { + "type": "string" + }, + "additionalProperties": false + } + } + }, + "website_url": { + "description": "Public facing website for the model", + "type": "string", + "format": "uri" + }, + "repo_url": { + "description": "Repository containing code for the model", + "type": "string", + "format": "uri" + }, + "license": { + "description": "License for use of model output data", + "type": "string", + "enum": [ + "apache-2.0", + "cc-by-4.0", + "cc-by-nc-4.0", + "cc-by-nc-nd-4.0", + "cc-by-sa-4.0", + "gpl-3.0", + "lgpl-3.0", + "mit" + ] + }, + "include_viz": { + "description": "Indicator for whether the model should be included in the Hub’s visualization", + "type": "boolean" + }, + "include_ensemble": { + "description": "Indicator for whether the model should be included in the Hub’s ensemble", + "type": "boolean" + }, + "include_eval": { + "description": "Indicator for whether the model should be scored for inclusion in the Hub’s evaluations", + "type": "boolean" + }, + "citation": { + "type": "string" + }, + "team_funding": { + "type": "string" + }, + "model_details": { + "type": "object", + "properties": { + "data_inputs": { + "type": "string" + }, + "methods": { + "type": "string", + "maxLength": 200 + }, + "methods_long": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["data_inputs", "methods"] + }, + "ensemble_of_hub_models": { + "description": "Indicator for whether this model is an ensemble of other Hub models", + "type": "boolean" + }, + "modeling_NPI": { + "type": "string" + }, + "compliance_NPI": { + "type": "string" + }, + "contact_tracing": { + "type": "string" + }, + "testing": { + "type": "string" + }, + "vaccine_efficacy_transmission": { + "type": "string" + }, + "vaccine_efficacy_delay": { + "type": "string" + }, + "vaccine_hesitancy": { + "type": "string" + }, + "vaccine_immunity_duration": { + "type": "string" + }, + "natural_immunity_duration": { + "type": "string" + }, + "case_fatality_rate": { + "type": "string" + }, + "infection_fatality_rate": { + "type": "string" + }, + "asymptomatics": { + "type": "string" + }, + "age_groups": { + "type": "string" + }, + "importations": { + "type": "string" + }, + "confidence_interval_method": { + "type": "string" + }, + "calibration": { + "type": "string" + }, + "spatial_structure": { + "type": "string[bc]" + } + }, + "additionalProperties": false, + "required": [ + "schema_version", + "team_name", + "team_abbr", + "model_name", + "model_abbr", + "model_contributors", + "website_url", + "license", + "include_viz", + "include_ensemble", + "include_eval", + "model_details" + ] +} diff --git a/inst/schemas/v0.0.0.9/tasks-schema.json b/inst/schemas/v0.0.0.9/tasks-schema.json new file mode 100644 index 0000000..ce687b0 --- /dev/null +++ b/inst/schemas/v0.0.0.9/tasks-schema.json @@ -0,0 +1,834 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/hubverse-org/schemas/blob/main/v0.0.0.9/tasks-schema.json", + "title": "Hub model task definitions", + "type": "object", + "properties": { + "schema_version": { + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": ["round-1", "2022-11-05", "origin_date"], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": ["round-1"], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon * time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon * 7 days)", + "examples": [{ + "required": null, + "optional": ["2022-11-05", "2022-11-12", "2022-11-19"] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [{ + "required": null, + "optional": [1, 2, 3, 4] + }, + { + "required": null, + "optional": ["A-2021-03-28", "B-2021-03-28", "A-2021-04-05", "B-2021-04-05"] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": ["integer", "string"] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "items": { + "type": ["integer", "string"] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [{ + "required": "US", + "optional": ["01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "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", "44", "45", "46", "47", "48", "49", "50", "51", "53", "54", "55", "56"] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target.", + "type": "object", + "examples": [{ + "required": null, + "optional": ["weekly rate"] + }], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": ["2022-11-12", "2022-11-19", "2022-11-26"] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [{ + "required": null, + "optional": [1, 2, 3, 4] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": ["integer", "string"] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "items": { + "type": ["integer", "string"] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [{ + "required": ["0-5", "6-18", "19-24", "25-64", "65+"], + "optional": null + }], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": true + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'type' while the 'type_id' property of each output type defines the valid values of the 'type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "type_id": { + "description": "type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": ["NA"], + "optional": null + }, { + "required": null, + "optional": ["NA"] + }], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + }], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [{ + "type": "numeric", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": ["numeric", "double", "integer"] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": "integer" + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": "integer" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "type_id": { + "description": "type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": ["NA"], + "optional": null + }, { + "required": null, + "optional": ["NA"] + }], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + }], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [{ + "type": "numeric", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": ["numeric", "double", "integer"] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": "integer" + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": "integer" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [{ + "required": [0.25, 0.5, 0.75], + "optional": [0.1, 0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": ["array", "null"], + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": ["array", "null"], + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": ["numeric"], + "type": "string", + "enum": ["numeric", "double", "integer"] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [0], + "type": "number" + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": "number" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded.", + "examples": [{ + "required": [10.0, 20.0], + "optional": null + }, + { + "required": ["EW202240", "EW202241", "EW202242", "EW202243", "EW202244", "EW202245", "EW202246", "EW202247"], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": ["array", "null"], + "items": { + "oneOf": [{ + "type": "number", + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": ["array", "null"], + "items": { + "oneOf": [{ + "type": "number", + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": ["double"], + "enum": [ + "numeric", "double" + ] + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "categorical": { + "description": "Object defining a categorical output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays specifying valid category values.", + "examples": [{ + "required": null, + "optional": ["low", "moderate", "high", "extreme"] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": ["array", "null"], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories. Can be null if all categories are required and are specified in the required property.", + "type": ["array", "null"], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given level of a categorical outcome variable.", + "examples": [{ + "type": "double", + "minimum": 0, + "maximum": 1 + }], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "enum": [ + "numeric", "double" + ] + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays specifying valid sample values.", + "examples": [{ + "required": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + "optional": [11, 12, 13, 14, 15] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique sample indexes that must be present for submission to be valid. Can be null if no sample indexes are required and all valid sample indexes are specified in the optional property.", + "type": ["array", "null"], + "items": { + "type": "integer", + "minimum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique sample indexes. Can be null if all sample indexes are required and are specified in the required property.", + "type": ["array", "null"], + "items": { + "type": "integer", + "minimum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [{ + "type": "double" + }], + "enum": [ + "numeric", "double", "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution" + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [{ + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": ["2022-07-18"], + "type": "string", + "format": "date" + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ] + } + }, + "$defs": {} + }, + "required": [ + "rounds", + "schema_version" + ] +} diff --git a/inst/schemas/v0.0.1/admin-schema.json b/inst/schemas/v0.0.1/admin-schema.json new file mode 100644 index 0000000..eff15d3 --- /dev/null +++ b/inst/schemas/v0.0.1/admin-schema.json @@ -0,0 +1,652 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/admin-schema.json"], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": ["US COVID-19 Forecast Hub​"] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": ["The Consortium of Infectious Disease Modeling Hubs"] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository_host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "GitHub" + ] + }, + "repository_url": { + "description": "The url for the hub repository.", + "type": "string", + "examples": ["https://github.com/reichlab/covid19-forecast-hub"] + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [44] + }, + "hub_models": { + "description": "Array of ensemble and baseline models produced by the hub", + "type": "array", + "items": { + "type": "object", + "properties": { + "team_abbr": { + "description": "Abbreviated team name of the hub", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_abbr": { + "description": "Abbreviated name of the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_type": { + "description": "The type of model: baseline or ensemble", + "type": "string", + "enum": [ + "baseline", + "ensemble" + ] + } + } + } + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": ["Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w"] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model_output/` assumed", + "default": "model_output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository_url", + "file_format", + "timezone" + ] +} diff --git a/inst/schemas/v0.0.1/tasks-schema.json b/inst/schemas/v0.0.1/tasks-schema.json new file mode 100644 index 0000000..170c61f --- /dev/null +++ b/inst/schemas/v0.0.1/tasks-schema.json @@ -0,0 +1,1187 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/tasks-schema.json"], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [{ + "required": "US", + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target.", + "type": "object", + "examples": [{ + "required": null, + "optional": [ + "weekly rate" + ] + }], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [{ + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + }], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": true + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'type' while the 'type_id' property of each output type defines the valid values of the 'type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "type_id": { + "description": "type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [{ + "type": "numeric", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "numeric", + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": "integer" + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": "integer" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "type_id": { + "description": "type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [{ + "type": "numeric", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": [ + "numeric", + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": "integer" + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": "integer" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 0.25, + 0.5, + 0.75 + ], + "optional": [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.6, + 0.7, + 0.8, + 0.9 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "numeric" + ], + "type": "string", + "enum": [ + "numeric", + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": "number" + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": "number" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 10.0, + 20.0 + ], + "optional": null + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "oneOf": [{ + "type": "number", + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "oneOf": [{ + "type": "number", + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "enum": [ + "numeric", + "double" + ] + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "categorical": { + "description": "Object defining a categorical output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays specifying valid category values.", + "examples": [{ + "required": null, + "optional": [ + "low", + "moderate", + "high", + "extreme" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories. Can be null if all categories are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given level of a categorical outcome variable.", + "examples": [{ + "type": "double", + "minimum": 0, + "maximum": 1 + }], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "enum": [ + "numeric", + "double" + ] + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays specifying valid sample values.", + "examples": [{ + "required": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "optional": [ + 11, + 12, + 13, + 14, + 15 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique sample indexes that must be present for submission to be valid. Can be null if no sample indexes are required and all valid sample indexes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "minimum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique sample indexes. Can be null if all sample indexes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "minimum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [{ + "type": "double" + }], + "enum": [ + "numeric", + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution" + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + } + } + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 20 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [{ + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "categorical", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [{ + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ] + } + } + }, + "required": [ + "rounds", + "schema_version" + ] +} diff --git a/inst/schemas/v1.0.0/admin-schema.json b/inst/schemas/v1.0.0/admin-schema.json new file mode 100644 index 0000000..05c64c3 --- /dev/null +++ b/inst/schemas/v1.0.0/admin-schema.json @@ -0,0 +1,653 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v1.0.0/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/admin-schema.json"], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": ["US COVID-19 Forecast Hub​"] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": ["The Consortium of Infectious Disease Modeling Hubs"] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository_host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "GitHub" + ] + }, + "repository_url": { + "description": "The url for the hub repository.", + "type": "string", + "examples": ["https://github.com/reichlab/covid19-forecast-hub"] + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [44] + }, + "hub_models": { + "description": "Array of ensemble and baseline models produced by the hub", + "type": "array", + "items": { + "type": "object", + "properties": { + "team_abbr": { + "description": "Abbreviated team name of the hub", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_abbr": { + "description": "Abbreviated name of the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_type": { + "description": "The type of model: baseline or ensemble", + "type": "string", + "enum": [ + "baseline", + "ensemble" + ] + } + } + } + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": ["Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w"] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model_output/` assumed", + "default": "model_output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository_url", + "file_format", + "timezone" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v1.0.0/tasks-schema.json b/inst/schemas/v1.0.0/tasks-schema.json new file mode 100644 index 0000000..e507341 --- /dev/null +++ b/inst/schemas/v1.0.0/tasks-schema.json @@ -0,0 +1,1206 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v1.0.0/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/tasks-schema.json"], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [{ + "required": "US", + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target.", + "type": "object", + "examples": [{ + "required": null, + "optional": [ + "weekly rate" + ] + }], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [{ + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + }], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": true + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'type' while the 'type_id' property of each output type defines the valid values of the 'type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "type_id": { + "description": "type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "type_id": { + "description": "type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 0.25, + 0.5, + 0.75 + ], + "optional": [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.6, + 0.7, + 0.8, + 0.9 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "double" + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 10.0, + 20.0 + ], + "optional": null + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "pmf": { + "description": "Object defining a probability mass function for a discrete variable output type. Includes nominal, binary and ordinal variable types.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays specifying valid categories of a discrete variable.", + "examples": [{ + "required": null, + "optional": [ + "low", + "moderate", + "high", + "extreme" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories of a discrete variable that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories of a discrete variable. Can be null if all categories are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given category of a discrete outcome variable.", + "examples": [{ + "type": "double", + "minimum": 0, + "maximum": 1 + }], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "type_id": { + "description": "Object containing required and optional arrays specifying valid sample values.", + "examples": [{ + "required": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "optional": [ + 11, + 12, + 13, + 14, + 15 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique sample indexes that must be present for submission to be valid. Can be null if no sample indexes are required and all valid sample indexes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "minimum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique sample indexes. Can be null if all sample indexes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "minimum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [{ + "type": "double" + }], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution" + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "type_id", + "value" + ] + } + }, + "additionalProperties": false + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 30 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [{ + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "nominal", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "additionalProperties": false, + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [{ + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ], + "additionalProperties": false + } + } + }, + "required": [ + "rounds", + "schema_version" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v2.0.0/admin-schema.json b/inst/schemas/v2.0.0/admin-schema.json new file mode 100644 index 0000000..e104ea5 --- /dev/null +++ b/inst/schemas/v2.0.0/admin-schema.json @@ -0,0 +1,653 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v2.0.0/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/admin-schema.json"], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": ["US COVID-19 Forecast Hub​"] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": ["The Consortium of Infectious Disease Modeling Hubs"] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository_host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "GitHub" + ] + }, + "repository_url": { + "description": "The url for the hub repository.", + "type": "string", + "examples": ["https://github.com/reichlab/covid19-forecast-hub"] + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [44] + }, + "hub_models": { + "description": "Array of ensemble and baseline models produced by the hub", + "type": "array", + "items": { + "type": "object", + "properties": { + "team_abbr": { + "description": "Abbreviated team name of the hub", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_abbr": { + "description": "Abbreviated name of the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_type": { + "description": "The type of model: baseline or ensemble", + "type": "string", + "enum": [ + "baseline", + "ensemble" + ] + } + } + } + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": ["Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w"] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model_output/` assumed", + "default": "model_output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository_url", + "file_format", + "timezone" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v2.0.0/tasks-schema.json b/inst/schemas/v2.0.0/tasks-schema.json new file mode 100644 index 0000000..6a08e38 --- /dev/null +++ b/inst/schemas/v2.0.0/tasks-schema.json @@ -0,0 +1,1421 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v2.0.0/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/tasks-schema.json"], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "forecast_date": { + "description": "An object containing arrays of required and optional unique forecast dates. Forecast date usually defines the date that a model is run to produce a forecast.", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of forecast date unique identifiers that must be present for submission to be valid. Can be null if no forecast dates are required and all valid forecast dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique forecast date identifiers. Can be null if all forecast dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [{ + "required": "US", + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target. Usually represents a single task ID target key variable.", + "type": "object", + "examples": [{ + "required": null, + "optional": [ + "inc hosp", + "inc case", + "inc death" + ] + }, { + "required": ["peak week inc hosp"], + "optional": null + }], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_variable": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target variable. Usually forms part of a pair of task ID target key variables (along with target_outcome) which combine to define individual targets.", + "type": "object", + "examples": [{ + "required": null, + "optional": ["hosp", "death", "case"] + }, { + "required": ["hosp"], + "optional": ["case"] + }], + "properties": { + "required": { + "description": "Array of target variable unique identifiers that must be present for submission to be valid. Can be null if no target variables are required and all valid target variables are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target variable identifiers. Can be null if all target variables are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_outcome": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target outcome. Usually forms part of a pair of task ID target key variables (along with target_variable) which combine to define individual targets.", + "type": "object", + "examples": [{ + "required": ["inc"], + "optional": null + }, { + "required": ["inc"], + "optional": ["cum"] + }], + "properties": { + "required": { + "description": "Array of target outcome unique identifiers that must be present for submission to be valid. Can be null if no target outcomes are required and all valid target outcomes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target outcome identifiers. Can be null if all target outcomes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_end_date": { + "description": "An object containing arrays of required and optional unique target end dates. For short-term forecasts, the target_end_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_end_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target end date unique identifiers that must be present for submission to be valid. Can be null if no target end dates are required and all valid target end dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target end date identifiers. Can be null if all target end dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [{ + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + }], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique age group identifiers. Can be null if all age group are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": { + "type": "object", + "description": "An object containing arrays of required and optional unique values for a custom Task ID", + "properties": { + "required": { + "description": "Array of custom Task ID unique values that must be present for submission to be valid. Can be null if no values are required and all valid values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + }, + "optional": { + "description": "Array of valid but not required unique custom Task ID values. Can be null if all values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'output_type' while the 'output_type_id' property of each output type defines the valid values of the 'output_type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 0.25, + 0.5, + 0.75 + ], + "optional": [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.6, + 0.7, + 0.8, + 0.9 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "double" + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 10.0, + 20.0 + ], + "optional": null + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "pmf": { + "description": "Object defining a probability mass function for a discrete variable output type. Includes nominal, binary and ordinal variable types.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays specifying valid categories of a discrete variable.", + "examples": [{ + "required": null, + "optional": [ + "low", + "moderate", + "high", + "extreme" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories of a discrete variable that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories of a discrete variable. Can be null if all categories are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given category of a discrete outcome variable.", + "examples": [{ + "type": "double", + "minimum": 0, + "maximum": 1 + }], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays specifying valid sample values.", + "examples": [{ + "required": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "optional": [ + 11, + 12, + 13, + 14, + 15 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique sample indexes that must be present for submission to be valid. Can be null if no sample indexes are required and all valid sample indexes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique sample indexes. Can be null if all sample indexes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the output_type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [{ + "type": "double" + }], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution" + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + } + }, + "additionalProperties": false + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 30 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [{ + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "nominal", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "additionalProperties": false, + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [{ + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ], + "additionalProperties": false + } + } + }, + "required": [ + "rounds", + "schema_version" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v2.0.1/admin-schema.json b/inst/schemas/v2.0.1/admin-schema.json new file mode 100644 index 0000000..7afbd69 --- /dev/null +++ b/inst/schemas/v2.0.1/admin-schema.json @@ -0,0 +1,698 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v2.0.1/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/admin-schema.json"], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": ["US COVID-19 Forecast Hub​"] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": ["The Consortium of Infectious Disease Modeling Hubs"] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository_host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "GitHub" + ] + }, + "repository_url": { + "description": "The url for the hub repository.", + "type": "string", + "examples": ["https://github.com/reichlab/covid19-forecast-hub"] + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [44] + }, + "hub_models": { + "description": "Array of ensemble and baseline models produced by the hub", + "type": "array", + "items": { + "type": "object", + "properties": { + "team_abbr": { + "description": "Abbreviated team name of the hub", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_abbr": { + "description": "Abbreviated name of the model", + "type": "string", + "pattern": "^[a-zA-Z0-9_+]+$", + "maxLength": 16 + }, + "model_type": { + "description": "The type of model: baseline or ensemble", + "type": "string", + "enum": [ + "baseline", + "ensemble" + ] + } + } + } + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": ["Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w"] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model_output/` assumed", + "default": "model_output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + }, + "cloud": { + "description": "Optional settings for cloud-enabled hubs", + "type": "object", + "properties": { + "enabled": {"type": "boolean"}, + "host": { + "type": "object", + "required": ["name", "storage_service", "storage_location"], + "properties": { + "name": { + "description": "Name of the cloud storage provider.", + "type": "string", + "enum": ["aws"] + }, + "storage_service": { + "description": "Name of the cloud service used as backend storage", + "type": "string", + "enum": ["s3"] + }, + "storage_location": { + "description": "Cloud storage location, excluding prefix (for example, AWS S3 bucket name).", + "type": "string" + } + } + } + }, + "if": { + "properties": { + "enabled": {"const": true} + } + }, + "then": { + "required": ["host"] + }, + "examples": [ + { + "enabled": true, + "host": { + "name": "aws", + "storage_service": "s3", + "storage_location": "hub-s3-bucket-name" + } + } + ] + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository_url", + "file_format", + "timezone" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v2.0.1/tasks-schema.json b/inst/schemas/v2.0.1/tasks-schema.json new file mode 100644 index 0000000..4c393c0 --- /dev/null +++ b/inst/schemas/v2.0.1/tasks-schema.json @@ -0,0 +1,1421 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v2.0.1/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v0.0.1/tasks-schema.json"], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "forecast_date": { + "description": "An object containing arrays of required and optional unique forecast dates. Forecast date usually defines the date that a model is run to produce a forecast.", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of forecast date unique identifiers that must be present for submission to be valid. Can be null if no forecast dates are required and all valid forecast dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique forecast date identifiers. Can be null if all forecast dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [{ + "required": "US", + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target. Usually represents a single task ID target key variable.", + "type": "object", + "examples": [{ + "required": null, + "optional": [ + "inc hosp", + "inc case", + "inc death" + ] + }, { + "required": ["peak week inc hosp"], + "optional": null + }], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_variable": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target variable. Usually forms part of a pair of task ID target key variables (along with target_outcome) which combine to define individual targets.", + "type": "object", + "examples": [{ + "required": null, + "optional": ["hosp", "death", "case"] + }, { + "required": ["hosp"], + "optional": ["case"] + }], + "properties": { + "required": { + "description": "Array of target variable unique identifiers that must be present for submission to be valid. Can be null if no target variables are required and all valid target variables are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target variable identifiers. Can be null if all target variables are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_outcome": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target outcome. Usually forms part of a pair of task ID target key variables (along with target_variable) which combine to define individual targets.", + "type": "object", + "examples": [{ + "required": ["inc"], + "optional": null + }, { + "required": ["inc"], + "optional": ["cum"] + }], + "properties": { + "required": { + "description": "Array of target outcome unique identifiers that must be present for submission to be valid. Can be null if no target outcomes are required and all valid target outcomes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target outcome identifiers. Can be null if all target outcomes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_end_date": { + "description": "An object containing arrays of required and optional unique target end dates. For short-term forecasts, the target_end_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_end_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target end date unique identifiers that must be present for submission to be valid. Can be null if no target end dates are required and all valid target end dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target end date identifiers. Can be null if all target end dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [{ + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + }], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique age group identifiers. Can be null if all age group are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": { + "type": "object", + "description": "An object containing arrays of required and optional unique values for a custom Task ID", + "properties": { + "required": { + "description": "Array of custom Task ID unique values that must be present for submission to be valid. Can be null if no values are required and all valid values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + }, + "optional": { + "description": "Array of valid but not required unique custom Task ID values. Can be null if all values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'output_type' while the 'output_type_id' property of each output type defines the valid values of the 'output_type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 0.25, + 0.5, + 0.75 + ], + "optional": [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.6, + 0.7, + 0.8, + 0.9 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "double" + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 10.0, + 20.0 + ], + "optional": null + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "pmf": { + "description": "Object defining a probability mass function for a discrete variable output type. Includes nominal, binary and ordinal variable types.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays specifying valid categories of a discrete variable.", + "examples": [{ + "required": null, + "optional": [ + "low", + "moderate", + "high", + "extreme" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories of a discrete variable that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories of a discrete variable. Can be null if all categories are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given category of a discrete outcome variable.", + "examples": [{ + "type": "double", + "minimum": 0, + "maximum": 1 + }], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays specifying valid sample values.", + "examples": [{ + "required": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "optional": [ + 11, + 12, + 13, + 14, + 15 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique sample indexes that must be present for submission to be valid. Can be null if no sample indexes are required and all valid sample indexes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique sample indexes. Can be null if all sample indexes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the output_type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [{ + "type": "double" + }], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution" + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + } + }, + "additionalProperties": false + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 30 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [{ + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "nominal", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "additionalProperties": false, + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [{ + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ], + "additionalProperties": false + } + } + }, + "required": [ + "rounds", + "schema_version" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v3.0.0/admin-schema.json b/inst/schemas/v3.0.0/admin-schema.json new file mode 100644 index 0000000..617cca0 --- /dev/null +++ b/inst/schemas/v3.0.0/admin-schema.json @@ -0,0 +1,679 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/admin-schema.json"], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": ["US COVID-19 Forecast Hub​"] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": ["The Consortium of Infectious Disease Modeling Hubs"] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository": { + "description": "Object containing details of the hub repository.", + "examples": [{ + "host": "github", + "owner": "hubverse-org", + "name": "example-simple-forecast-hub" + }], + "type": "object", + "properties": { + "host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": ["github"] + }, + "owner": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [44] + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": ["Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w"] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model-output` assumed", + "default": "model-output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + }, + "cloud": { + "description": "Optional settings for cloud-enabled hubs", + "type": "object", + "properties": { + "enabled": {"type": "boolean"}, + "host": { + "type": "object", + "required": ["name", "storage_service", "storage_location"], + "properties": { + "name": { + "description": "Name of the cloud storage provider.", + "type": "string", + "enum": ["aws"] + }, + "storage_service": { + "description": "Name of the cloud service used as backend storage", + "type": "string", + "enum": ["s3"] + }, + "storage_location": { + "description": "Cloud storage location, excluding prefix (for example, AWS S3 bucket name).", + "type": "string" + } + } + } + }, + "if": { + "properties": { + "enabled": {"const": true} + } + }, + "then": { + "required": ["host"] + }, + "examples": [ + { + "enabled": true, + "host": { + "name": "aws", + "storage_service": "s3", + "storage_location": "hub-s3-bucket-name" + } + } + ] + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository", + "file_format", + "timezone" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v3.0.0/tasks-schema.json b/inst/schemas/v3.0.0/tasks-schema.json new file mode 100644 index 0000000..c7f1b2f --- /dev/null +++ b/inst/schemas/v3.0.0/tasks-schema.json @@ -0,0 +1,1449 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": ["https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/tasks-schema.json"], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "forecast_date": { + "description": "An object containing arrays of required and optional unique forecast dates. Forecast date usually defines the date that a model is run to produce a forecast.", + "examples": [{ + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of forecast date unique identifiers that must be present for submission to be valid. Can be null if no forecast dates are required and all valid forecast dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique forecast date identifiers. Can be null if all forecast dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [{ + "required": "US", + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target. Usually represents a single task ID target key variable.", + "type": "object", + "examples": [{ + "required": null, + "optional": [ + "inc hosp", + "inc case", + "inc death" + ] + }, { + "required": ["peak week inc hosp"], + "optional": null + }], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_variable": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target variable. Usually forms part of a pair of task ID target key variables (along with target_outcome) which combine to define individual targets.", + "type": "object", + "examples": [{ + "required": null, + "optional": ["hosp", "death", "case"] + }, { + "required": ["hosp"], + "optional": ["case"] + }], + "properties": { + "required": { + "description": "Array of target variable unique identifiers that must be present for submission to be valid. Can be null if no target variables are required and all valid target variables are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target variable identifiers. Can be null if all target variables are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_outcome": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target outcome. Usually forms part of a pair of task ID target key variables (along with target_variable) which combine to define individual targets.", + "type": "object", + "examples": [{ + "required": ["inc"], + "optional": null + }, { + "required": ["inc"], + "optional": ["cum"] + }], + "properties": { + "required": { + "description": "Array of target outcome unique identifiers that must be present for submission to be valid. Can be null if no target outcomes are required and all valid target outcomes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target outcome identifiers. Can be null if all target outcomes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_end_date": { + "description": "An object containing arrays of required and optional unique target end dates. For short-term forecasts, the target_end_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_end_date is 2022-07-15", + "examples": [{ + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of target end date unique identifiers that must be present for submission to be valid. Can be null if no target end dates are required and all valid target end dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target end date identifiers. Can be null if all target end dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [{ + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [{ + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + }], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique age group identifiers. Can be null if all age group are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": { + "type": "object", + "description": "An object containing arrays of required and optional unique values for a custom Task ID", + "properties": { + "required": { + "description": "Array of custom Task ID unique values that must be present for submission to be valid. Can be null if no values are required and all valid values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + }, + "optional": { + "description": "Array of valid but not required unique custom Task ID values. Can be null if all values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'output_type' while the 'output_type_id' property of each output type defines the valid values of the 'output_type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [{ + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [{ + "type": "double", + "minimum": 0 + }], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [{ + "required": [ + 0.25, + 0.5, + 0.75 + ], + "optional": [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.6, + 0.7, + 0.8, + 0.9 + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "double" + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded. These should be listed in order from low to high.", + "examples": [{ + "required": [ + 10.0, + 20.0 + ], + "optional": null + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [{ + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string", + "pattern": "^EW[0-9]{6}", + "minLength": 8, + "maxLength": 8 + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "pmf": { + "description": "Object defining a probability mass function for a discrete variable output type. Includes nominal, binary and ordinal variable types.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays specifying valid categories of a discrete variable. Note that for ordinal variables, the category levels should be listed in order from low to high.", + "examples": [{ + "required": null, + "optional": [ + "low", + "moderate", + "high", + "extreme" + ] + }], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories of a discrete variable that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories of a discrete variable. Can be null if all categories are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given category of a discrete outcome variable.", + "examples": [{ + "type": "double", + "minimum": 0, + "maximum": 1 + }], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "output_type_id_params": { + "description": "Object containing parameters specifying how samples were drawn.", + "examples": [{ + "output_type_id_params": { + "is_required": true, + "type": "integer", + "min_samples_per_task": 100, + "max_samples_per_task": 100 + } + }, { + "output_type_id_params": { + "is_required": false, + "type": "character", + "max_length": 6, + "min_samples_per_task": 100, + "max_samples_per_task": 500, + "compound_taskid_set" : ["origin_date", "horizon", "location", "variant"] + } + }], + "type": "object", + "properties": { + "is_required": { + "description": "Boolean. Whether inclusion of samples is required for the submission to be valid", + "type": "boolean" + }, + "type": { + "description": "Data type of sample indices.", + "type": "string", + "enum": [ + "character", + "integer" + ] + }, + "max_length": { + "description": "Required only if 'type' is 'character'. Positive integer representing the maximum number of characters in a sample index. Ignored if 'type' is 'integer'.", + "type": "integer", + "minimum": 1 + }, + "min_samples_per_task": { + "description": "The minimum number of samples per individual task.", + "type": "integer", + "minimum": 1 + }, + "max_samples_per_task": { + "description": "The maximum number of samples per individual task.", + "type": "integer", + "minimum": 1 + }, + "compound_taskid_set": { + "description": "Optional. Specifies whether validation should factor in the presence of a compound modeling task. Each item of the array must be a task id variable name. If unspecified, defaults to all task ID variables.", + "type": [ + "array" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + + } + }, + "required": [ + "is_required", + "type", + "min_samples_per_task", + "max_samples_per_task" + ], + "if": { + "properties": { + "type": { "const": "character" } + } + }, + "then": { + "required": ["max_length"] + } + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the output_type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [{ + "type": "double" + }], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution.", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution.", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id_params", + "value" + ] + } + }, + "additionalProperties": false + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 30 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [{ + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "nominal", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "additionalProperties": false, + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [{ + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [{ + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + ["arrow", "parquet"], + ["csv"] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ], + "additionalProperties": true + } + } + }, + "required": [ + "rounds", + "schema_version" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v3.0.1/admin-schema.json b/inst/schemas/v3.0.1/admin-schema.json new file mode 100644 index 0000000..5ee06e1 --- /dev/null +++ b/inst/schemas/v3.0.1/admin-schema.json @@ -0,0 +1,712 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.1/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": [ + "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/admin-schema.json" + ], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": [ + "US COVID-19 Forecast Hub​" + ] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": [ + "The Consortium of Infectious Disease Modeling Hubs" + ] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository": { + "description": "Object containing details of the hub repository.", + "examples": [ + { + "host": "github", + "owner": "hubverse-org", + "name": "example-simple-forecast-hub" + } + ], + "type": "object", + "properties": { + "host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "github" + ] + }, + "owner": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [ + 44 + ] + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": [ + "Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w" + ] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + [ + "arrow", + "parquet" + ], + [ + "csv" + ] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model-output` assumed", + "default": "model-output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + }, + "cloud": { + "description": "Optional settings for cloud-enabled hubs", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "host": { + "type": "object", + "required": [ + "name", + "storage_service", + "storage_location" + ], + "properties": { + "name": { + "description": "Name of the cloud storage provider.", + "type": "string", + "enum": [ + "aws" + ] + }, + "storage_service": { + "description": "Name of the cloud service used as backend storage", + "type": "string", + "enum": [ + "s3" + ] + }, + "storage_location": { + "description": "Cloud storage location, excluding prefix (for example, AWS S3 bucket name).", + "type": "string" + } + } + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "required": [ + "host" + ] + }, + "examples": [ + { + "enabled": true, + "host": { + "name": "aws", + "storage_service": "s3", + "storage_location": "hub-s3-bucket-name" + } + } + ] + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository", + "file_format", + "timezone" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v3.0.1/tasks-schema.json b/inst/schemas/v3.0.1/tasks-schema.json new file mode 100644 index 0000000..89878df --- /dev/null +++ b/inst/schemas/v3.0.1/tasks-schema.json @@ -0,0 +1,1539 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.1/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": [ + "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/tasks-schema.json" + ], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "forecast_date": { + "description": "An object containing arrays of required and optional unique forecast dates. Forecast date usually defines the date that a model is run to produce a forecast.", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of forecast date unique identifiers that must be present for submission to be valid. Can be null if no forecast dates are required and all valid forecast dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique forecast date identifiers. Can be null if all forecast dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [ + { + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [ + { + "required": "US", + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target. Usually represents a single task ID target key variable.", + "type": "object", + "examples": [ + { + "required": null, + "optional": [ + "inc hosp", + "inc case", + "inc death" + ] + }, + { + "required": [ + "peak week inc hosp" + ], + "optional": null + } + ], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_variable": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target variable. Usually forms part of a pair of task ID target key variables (along with target_outcome) which combine to define individual targets.", + "type": "object", + "examples": [ + { + "required": null, + "optional": [ + "hosp", + "death", + "case" + ] + }, + { + "required": [ + "hosp" + ], + "optional": [ + "case" + ] + } + ], + "properties": { + "required": { + "description": "Array of target variable unique identifiers that must be present for submission to be valid. Can be null if no target variables are required and all valid target variables are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target variable identifiers. Can be null if all target variables are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_outcome": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target outcome. Usually forms part of a pair of task ID target key variables (along with target_variable) which combine to define individual targets.", + "type": "object", + "examples": [ + { + "required": [ + "inc" + ], + "optional": null + }, + { + "required": [ + "inc" + ], + "optional": [ + "cum" + ] + } + ], + "properties": { + "required": { + "description": "Array of target outcome unique identifiers that must be present for submission to be valid. Can be null if no target outcomes are required and all valid target outcomes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target outcome identifiers. Can be null if all target outcomes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "target_end_date": { + "description": "An object containing arrays of required and optional unique target end dates. For short-term forecasts, the target_end_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_end_date is 2022-07-15", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of target end date unique identifiers that must be present for submission to be valid. Can be null if no target end dates are required and all valid target end dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target end date identifiers. Can be null if all target end dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [ + { + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [ + { + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + } + ], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique age group identifiers. Can be null if all age group are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "additionalProperties": { + "type": "object", + "description": "An object containing arrays of required and optional unique values for a custom Task ID", + "properties": { + "required": { + "description": "Array of custom Task ID unique values that must be present for submission to be valid. Can be null if no values are required and all valid values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + }, + "optional": { + "description": "Array of valid but not required unique custom Task ID values. Can be null if all values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + } + }, + "required": [ + "required", + "optional" + ] + } + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'output_type' while the 'output_type_id' property of each output type defines the valid values of the 'output_type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a mean output_type. The property is primarily used to determine whether mean is a required or optional output type through properties required and optional. If mean is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If mean is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [ + { + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [ + { + "properties": { + "required": { + "description": "When mean is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When mean is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When mean is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When mean is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [ + { + "type": "double", + "minimum": 0 + } + ], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a median output_type. The property is primarily used to determine whether median is a required or optional output type through properties required and optional. If median is a required output type, the required property must be an array containing the single string element 'NA' and the optional property must be set to null. If median is an optional output type, the optional property must be an array containing the single string element 'NA' and the required property must be set to null", + "examples": [ + { + "required": [ + "NA" + ], + "optional": null + }, + { + "required": null, + "optional": [ + "NA" + ] + } + ], + "type": "object", + "oneOf": [ + { + "properties": { + "required": { + "description": "When median is required, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + }, + "optional": { + "description": "When median is required, property set to null", + "type": "null" + } + } + }, + { + "properties": { + "required": { + "description": "When median is optional, property set to null", + "type": "null" + }, + "optional": { + "description": "When median is optional, property set to single element 'NA' array", + "type": "array", + "items": { + "const": "NA", + "maxItems": 1 + } + } + } + } + ], + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values", + "examples": [ + { + "type": "double", + "minimum": 0 + } + ], + "properties": { + "type": { + "description": "Data type of median values", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining the probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [ + { + "required": [ + 0.25, + 0.5, + 0.75 + ], + "optional": [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.6, + 0.7, + 0.8, + 0.9 + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 that must be present for submission to be valid. Can be null if no probability levels are required and all valid probability levels are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "optional": { + "description": "Array of valid but not required unique probability levels. Can be null if all probability levels are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "double" + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded. These should be listed in order from low to high.", + "examples": [ + { + "required": [ + 10, + 20 + ], + "optional": null + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ], + "optional": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid. Can be null if no target values are required and all valid target values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string" + } + ] + } + }, + "optional": { + "description": "Array of valid but not required unique target values. Can be null if all target values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": [ + "number", + "integer" + ], + "minimum": 0 + }, + { + "type": "string" + } + ] + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "pmf": { + "description": "Object defining a probability mass function for a discrete variable output type. Includes nominal, binary and ordinal variable types.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required and optional arrays specifying valid categories of a discrete variable. Note that for ordinal variables, the category levels should be listed in order from low to high.", + "examples": [ + { + "required": null, + "optional": [ + "low", + "moderate", + "high", + "extreme" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories of a discrete variable that must be present for submission to be valid. Can be null if no categories are required and all valid categories are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique categories of a discrete variable. Can be null if all categories are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ] + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given category of a discrete outcome variable.", + "examples": [ + { + "type": "double", + "minimum": 0, + "maximum": 1 + } + ], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ] + } + }, + "required": [ + "output_type_id", + "value" + ] + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "output_type_id_params": { + "description": "Object containing parameters specifying how samples were drawn.", + "examples": [ + { + "output_type_id_params": { + "is_required": true, + "type": "integer", + "min_samples_per_task": 100, + "max_samples_per_task": 100 + } + }, + { + "output_type_id_params": { + "is_required": false, + "type": "character", + "max_length": 6, + "min_samples_per_task": 100, + "max_samples_per_task": 500, + "compound_taskid_set": [ + "origin_date", + "horizon", + "location", + "variant" + ] + } + } + ], + "type": "object", + "properties": { + "is_required": { + "description": "Boolean. Whether inclusion of samples is required for the submission to be valid", + "type": "boolean" + }, + "type": { + "description": "Data type of sample indices.", + "type": "string", + "enum": [ + "character", + "integer" + ] + }, + "max_length": { + "description": "Required only if 'type' is 'character'. Positive integer representing the maximum number of characters in a sample index. Ignored if 'type' is 'integer'.", + "type": "integer", + "minimum": 1 + }, + "min_samples_per_task": { + "description": "The minimum number of samples per individual task.", + "type": "integer", + "minimum": 1 + }, + "max_samples_per_task": { + "description": "The maximum number of samples per individual task.", + "type": "integer", + "minimum": 1 + }, + "compound_taskid_set": { + "description": "Optional. Specifies whether validation should factor in the presence of a compound modeling task. Each item of the array must be a task id variable name. If unspecified, defaults to all task ID variables.", + "type": [ + "array" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "is_required", + "type", + "min_samples_per_task", + "max_samples_per_task" + ], + "if": { + "properties": { + "type": { + "const": "character" + } + } + }, + "then": { + "required": [ + "max_length" + ] + } + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the output_type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [ + { + "type": "double" + } + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution.", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution.", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "output_type_id_params", + "value" + ] + } + }, + "additionalProperties": false + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 30 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [ + { + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "nominal", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "additionalProperties": false, + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ] + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [ + { + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [ + { + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ] + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ] + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + [ + "arrow", + "parquet" + ], + [ + "csv" + ] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ], + "additionalProperties": true + } + }, + "output_type_id_datatype": { + "description": "The hub level data type of the output_type_id column. This data type must be shared across all files in the hub and be able to represent all output type ID values across all hub output types and rounds. If not provided or set to 'auto', hub defaults to autodetecting the simplest hub level data type.", + "default": "auto", + "examples": [ + "character" + ], + "type": "string", + "enum": [ + "auto", + "character", + "double", + "integer", + "logical", + "Date" + ] + } + }, + "required": [ + "rounds", + "schema_version" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v4.0.0/admin-schema.json b/inst/schemas/v4.0.0/admin-schema.json new file mode 100644 index 0000000..a06b9c8 --- /dev/null +++ b/inst/schemas/v4.0.0/admin-schema.json @@ -0,0 +1,714 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v4.0.0/admin-schema.json", + "title": "Schema for Modeling Hub administrative settings", + "description": "This JSON file provides a schema for modeling hub administrative information.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema admin-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version an 'admin.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": [ + "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/admin-schema.json" + ], + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the hub.", + "type": "string", + "examples": [ + "US COVID-19 Forecast Hub​" + ] + }, + "maintainer": { + "description": "The entity that maintains and runs the hub.", + "type": "string", + "examples": [ + "The Consortium of Infectious Disease Modeling Hubs" + ] + }, + "contact": { + "description": "The name and email of a human being who serves as a point of contact for the hub.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + } + } + }, + "repository": { + "description": "Object containing details of the hub repository.", + "examples": [ + { + "host": "github", + "owner": "hubverse-org", + "name": "example-simple-forecast-hub" + } + ], + "type": "object", + "properties": { + "host": { + "description": "The name of the web host for the hub repository", + "type": "string", + "enum": [ + "github" + ] + }, + "owner": { + "description": "The hub repository owner (user or organisation).", + "type": "string" + }, + "name": { + "description": "The name of the hub repository.", + "type": "string" + } + } + }, + "zoltar_project_id": { + "description": "The project id of the Hub in Zoltar", + "type": "integer", + "examples": [ + 44 + ] + }, + "citation": { + "description": "One or more citations for the hub.", + "type": "string", + "examples": [ + "Cramer, E.Y., Huang, Y., Wang, Y. et al. The United States COVID-19 Forecast Hub dataset. Sci Data 9, 462 (2022). https://doi.org/10.1038/s41597-022-01517-w" + ] + }, + "file_format": { + "description": "Accepted file formats of model output files.", + "examples": [ + [ + "arrow", + "parquet" + ], + [ + "csv" + ] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "timezone": { + "description": "Hub timezone in TZ database name format. Used primarily for determining exact time of submission deadlines.", + "examples": [ + "Africa/Cairo", + "America/Sao_Paulo", + "Asia/Bangkok", + "US/Eastern", + "Europe/Berlin" + ], + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port_of_Spain", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "model_output_dir": { + "description": "Relative path, with respect to the root of hub, to directory containing model output data. If property not supplied, the default path `model-output` assumed", + "default": "model-output", + "examples": [ + "forecasts", + "data/model_output" + ], + "type": "string" + }, + "cloud": { + "description": "Optional settings for cloud-enabled hubs", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "host": { + "type": "object", + "required": [ + "name", + "storage_service", + "storage_location" + ], + "properties": { + "name": { + "description": "Name of the cloud storage provider.", + "type": "string", + "enum": [ + "aws" + ] + }, + "storage_service": { + "description": "Name of the cloud service used as backend storage", + "type": "string", + "enum": [ + "s3" + ] + }, + "storage_location": { + "description": "Cloud storage location, excluding prefix (for example, AWS S3 bucket name).", + "type": "string" + } + } + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "required": [ + "host" + ] + }, + "examples": [ + { + "enabled": true, + "host": { + "name": "aws", + "storage_service": "s3", + "storage_location": "hub-s3-bucket-name" + } + } + ] + } + }, + "required": [ + "schema_version", + "name", + "maintainer", + "contact", + "repository", + "file_format", + "timezone" + ], + "additionalProperties": false +} diff --git a/inst/schemas/v4.0.0/tasks-schema.json b/inst/schemas/v4.0.0/tasks-schema.json new file mode 100644 index 0000000..e666237 --- /dev/null +++ b/inst/schemas/v4.0.0/tasks-schema.json @@ -0,0 +1,1540 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v4.0.0/tasks-schema.json", + "title": "Schema for Modeling Hub model task definitions", + "description": "This is the schema of the tasks.json configuration file that defines the tasks within a modeling hub.", + "type": "object", + "properties": { + "schema_version": { + "description": "URL to a version of the Modeling Hub schema tasks-schema.json file (see https://github.com/hubverse-org/schemas). Used to declare the schema version a 'tasks.json' file is written for and for config file validation. The URL provided should be the URL to the raw content of the schema file on GitHub.", + "examples": [ + "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.0/tasks-schema.json" + ], + "type": "string", + "format": "uri" + }, + "rounds": { + "description": "Array of modeling round properties", + "type": "array", + "items": { + "type": "object", + "description": "Individual modeling round properties", + "properties": { + "round_id_from_variable": { + "description": "Whether the round identifier is encoded by a task id variable in the data.", + "type": "boolean" + }, + "round_id": { + "description": "Round identifier. If round_id_from_variable = true, round_id should be the name of a task id variable present in all sets of modeling task specifications", + "examples": [ + "round-1", + "2022-11-05", + "origin_date" + ], + "type": "string" + }, + "round_name": { + "description": "An optional round name. This can be useful for internal referencing of rounds, for examples, when a date is used as round_id but hub maintainers and teams also refer to rounds as round-1, round-2 etc.", + "examples": [ + "round-1" + ], + "type": "string" + }, + "model_tasks": { + "type": "array", + "description": "Array defining round-specific modeling tasks. Can contain one or more groups of modeling tasks per round where each group is defined by a distinct combination of values of task id variables.", + "items": { + "type": "object", + "properties": { + "task_ids": { + "description": "Group of valid values of task id variables. A set of valid tasks corresponding to this group is formed by taking all combinations of these values.", + "type": "object", + "properties": { + "origin_date": { + "description": "An object containing arrays of required and optional unique origin dates. Origin date defines the starting point that can be used for calculating a target_date via the formula target_date = origin_date + horizon x time_units_per_horizon (e.g., with weekly data, target_date is calculated as origin_date + horizon x 7 days)", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of origin date unique identifiers that must be present for submission to be valid. Can be null if no origin dates are required and all valid origin dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique origin date identifiers. Can be null if all origin dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "forecast_date": { + "description": "An object containing arrays of required and optional unique forecast dates. Forecast date usually defines the date that a model is run to produce a forecast.", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-05", + "2022-11-12", + "2022-11-19" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of forecast date unique identifiers that must be present for submission to be valid. Can be null if no forecast dates are required and all valid forecast dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique forecast date identifiers. Can be null if all forecast dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "scenario_id": { + "description": "An object containing arrays of required and optional unique identifiers of each valid scenario.", + "examples": [ + { + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + }, + { + "required": null, + "optional": [ + "A-2021-03-28", + "B-2021-03-28", + "A-2021-04-05", + "B-2021-04-05" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of identifiers of scenarios that must be present in a valid submission. Can be null if no scenario ids are required and all valid ids are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of identifiers of valid but not required scenarios. Can be null if all scenarios are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "location": { + "description": "An object containing arrays of required and optional unique identifiers for each valid location, e.g. country codes, FIPS state or county level code etc.", + "examples": [ + { + "required": [ + "US" + ], + "optional": [ + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "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", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of location unique identifiers that must be present for submission to be valid. Can be null if no locations are required and all valid locations are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique location identifiers. Can be null if all locations are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "target": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target. Usually represents a single task ID target key variable.", + "type": "object", + "examples": [ + { + "required": null, + "optional": [ + "inc hosp", + "inc case", + "inc death" + ] + }, + { + "required": [ + "peak week inc hosp" + ], + "optional": null + } + ], + "properties": { + "required": { + "description": "Array of target unique identifiers that must be present for submission to be valid. Can be null if no targets are required and all valid targets are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target identifiers. Can be null if all targets are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "target_variable": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target variable. Usually forms part of a pair of task ID target key variables (along with target_outcome) which combine to define individual targets.", + "type": "object", + "examples": [ + { + "required": null, + "optional": [ + "hosp", + "death", + "case" + ] + }, + { + "required": [ + "hosp" + ], + "optional": [ + "case" + ] + } + ], + "properties": { + "required": { + "description": "Array of target variable unique identifiers that must be present for submission to be valid. Can be null if no target variables are required and all valid target variables are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target variable identifiers. Can be null if all target variables are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "target_outcome": { + "description": "An object containing arrays of required and optional unique identifiers for each valid target outcome. Usually forms part of a pair of task ID target key variables (along with target_variable) which combine to define individual targets.", + "type": "object", + "examples": [ + { + "required": [ + "inc" + ], + "optional": null + }, + { + "required": [ + "inc" + ], + "optional": [ + "cum" + ] + } + ], + "properties": { + "required": { + "description": "Array of target outcome unique identifiers that must be present for submission to be valid. Can be null if no target outcomes are required and all valid target outcomes are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique target outcome identifiers. Can be null if all target outcomes are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "target_date": { + "description": "An object containing arrays of required and optional unique target dates. For short-term forecasts, the target_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_date is 2022-07-15", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of target date unique identifiers that must be present for submission to be valid. Can be null if no target dates are required and all valid target dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target date identifiers. Can be null if all target dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "target_end_date": { + "description": "An object containing arrays of required and optional unique target end dates. For short-term forecasts, the target_end_date specifies the date of occurrence of the outcome of interest. For instance, if models are requested to forecast the number of hospitalizations that will occur on 2022-07-15, the target_end_date is 2022-07-15", + "examples": [ + { + "required": null, + "optional": [ + "2022-11-12", + "2022-11-19", + "2022-11-26" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of target end date unique identifiers that must be present for submission to be valid. Can be null if no target end dates are required and all valid target end dates are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + }, + "optional": { + "description": "Array of valid but not required unique target end date identifiers. Can be null if all target end dates are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "format": "date" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "horizon": { + "description": "An object containing arrays of required and optional unique horizons. Horizons define the difference between the target_date and the origin_date in time units specified by the hub (e.g., may be days, weeks, or months)", + "examples": [ + { + "required": null, + "optional": [ + 1, + 2, + 3, + 4 + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of horizon unique identifiers that must be present for submission to be valid. Can be null if no horizons are required and all valid horizons are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + }, + "optional": { + "description": "Array of valid but not required unique horizon identifiers. Can be null if all horizons are required and are specified in the required property.", + "type": [ + "null", + "array" + ], + "uniqueItems": true, + "items": { + "type": [ + "integer", + "string" + ] + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + }, + "age_group": { + "type": "object", + "description": "An object containing arrays of required and optional unique identifiers for age groups", + "examples": [ + { + "required": [ + "0-5", + "6-18", + "19-24", + "25-64", + "65+" + ], + "optional": null + } + ], + "properties": { + "required": { + "description": "Array of age group unique identifiers that must be present for submission to be valid. Can be null if no age groups are required and all valid age groups are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "optional": { + "description": "Array of valid but not required unique age group identifiers. Can be null if all age group are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + } + }, + "additionalProperties": { + "type": "object", + "description": "An object containing arrays of required and optional unique values for a custom Task ID", + "properties": { + "required": { + "description": "Array of custom Task ID unique values that must be present for submission to be valid. Can be null if no values are required and all valid values are specified in the optional property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + }, + "optional": { + "description": "Array of valid but not required unique custom Task ID values. Can be null if all values are required and are specified in the required property.", + "type": [ + "array", + "null" + ], + "uniqueItems": true + } + }, + "required": [ + "required", + "optional" + ], + "additionalProperties": false + } + }, + "output_type": { + "type": "object", + "description": "Object defining valid model output types for a given modeling task. The name of each property corresponds to valid values in column 'output_type' while the 'output_type_id' property of each output type defines the valid values of the 'output_type_id' column and the 'value' property defines the valid values of the 'value' column for a given output type.", + "properties": { + "mean": { + "type": "object", + "description": "Object defining the mean of the predictive distribution output type.", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a point estimate output_type. Must have a single property named 'required' with the value null.", + "examples": [ + { + "required": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Not relevant for point estimate output types. Must be null.", + "type": "null" + } + }, + "required": [ + "required" + ], + "additionalProperties": false + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid mean values.", + "examples": [ + { + "type": "double", + "minimum": 0 + } + ], + "properties": { + "type": { + "description": "Data type of mean values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid mean value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "is_required": { + "description": "Is output type required? When required, property should be set to 'true'. If output type is optional, set to 'false'.", + "examples": [ + { + "is_required": true + }, + { + "is_required": false + } + ], + "type": "boolean" + } + }, + "required": [ + "output_type_id", + "value", + "is_required" + ], + "additionalProperties": false + }, + "median": { + "type": "object", + "description": "Object defining the median of the predictive distribution output type", + "properties": { + "output_type_id": { + "description": "output_type_id is not meaningful for a point estimate output_type. Must have a single property named 'required' with the value null.", + "examples": [ + { + "required": null + } + ], + "type": "object", + "properties": { + "required": { + "description": "Not relevant for point estimate output types. Must be null.", + "type": "null" + } + }, + "required": [ + "required" + ], + "additionalProperties": false + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid median values.", + "examples": [ + { + "type": "double", + "minimum": 0 + } + ], + "properties": { + "type": { + "description": "Data type of median values.", + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid median value", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "the maximum inclusive valid median value", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "is_required": { + "description": "Is output type required? When required, property should be set to 'true'. If output type is optional, set to 'false'.", + "examples": [ + { + "is_required": true + }, + { + "is_required": false + } + ], + "type": "boolean" + } + }, + "required": [ + "output_type_id", + "value", + "is_required" + ], + "additionalProperties": false + }, + "quantile": { + "description": "Object defining the quantiles of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing arrays of required probability levels at which quantiles of the predictive distribution will be recorded.", + "examples": [ + { + "required": [ + 0.1, + 0.2, + 0.25, + 0.3, + 0.4, + 0.5, + 0.6, + 0.7, + 0.75, + 0.8, + 0.9 + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique probability levels between 0 and 1 inclusive that must be present for submission to be valid.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "required": [ + "required" + ], + "additionalProperties": false + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid quantiles of the predictive distribution at a given probability level.", + "properties": { + "type": { + "description": "Data type of quantile values.", + "examples": [ + "double" + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid quantile value (optional).", + "examples": [ + 0 + ], + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid quantile value (optional).", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "is_required": { + "description": "Is output type required? When required, property should be set to 'true'. If output type is optional, set to 'false'.", + "examples": [ + { + "is_required": true + }, + { + "is_required": false + } + ], + "type": "boolean" + } + }, + "required": [ + "output_type_id", + "value", + "is_required" + ], + "additionalProperties": false + }, + "cdf": { + "description": "Object defining the cumulative distribution function of the predictive distribution output type.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing required arrays defining possible values of the target variable at which values of the cumulative distribution function of the predictive distribution will be recorded. These should be listed in order from low to high.", + "examples": [ + { + "required": [ + 10, + 20 + ] + }, + { + "required": [ + "EW202240", + "EW202241", + "EW202242", + "EW202243", + "EW202244", + "EW202245", + "EW202246", + "EW202247" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique target values that must be present for submission to be valid.", + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": [ + "number", + "integer" + ] + }, + { + "type": "string" + } + ] + } + } + }, + "required": [ + "required" + ], + "additionalProperties": false + }, + "value": { + "type": "object", + "description": "Object defining the characteristics of valid values of the cumulative distribution function at a given target value.", + "properties": { + "type": { + "description": "Data type of cumulative distribution function values.", + "examples": [ + "double" + ], + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid cumulative distribution function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid cumulative distribution function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "is_required": { + "description": "Is output type required? When required, property should be set to 'true'. If output type is optional, set to 'false'.", + "examples": [ + { + "is_required": true + }, + { + "is_required": false + } + ], + "type": "boolean" + } + }, + "required": [ + "output_type_id", + "value", + "is_required" + ], + "additionalProperties": false + }, + "pmf": { + "description": "Object defining a probability mass function for a discrete variable output type. Includes nominal, binary and ordinal variable types.", + "type": "object", + "properties": { + "output_type_id": { + "description": "Object containing arrays of required values specifying valid categories of a discrete variable. Note that for ordinal variables, the category levels should be listed in order from low to high.", + "examples": [ + { + "required": [ + "low", + "moderate", + "high", + "extreme" + ] + } + ], + "type": "object", + "properties": { + "required": { + "description": "Array of unique categories of a discrete variable that must be present for submission to be valid.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "required" + ], + "additionalProperties": false + }, + "value": { + "type": "object", + "description": "Object defining valid values of the probability mass function of the predictive distribution for a given category of a discrete outcome variable.", + "examples": [ + { + "type": "double", + "minimum": 0, + "maximum": 1 + } + ], + "properties": { + "type": { + "description": "Data type of the probability mass function values.", + "const": "double" + }, + "minimum": { + "description": "The minimum inclusive valid probability mass function value. Must be 0.", + "const": 0 + }, + "maximum": { + "description": "The maximum inclusive valid probability mass function value. Must be 1.", + "const": 1 + } + }, + "required": [ + "type", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "is_required": { + "description": "Is output type required? When required, property should be set to 'true'. If output type is optional, set to 'false'.", + "examples": [ + { + "is_required": true + }, + { + "is_required": false + } + ], + "type": "boolean" + } + }, + "required": [ + "output_type_id", + "value", + "is_required" + ], + "additionalProperties": false + }, + "sample": { + "description": "Object defining a sample output type.", + "type": "object", + "properties": { + "output_type_id_params": { + "description": "Object containing parameters specifying how samples were drawn.", + "examples": [ + { + "output_type_id_params": { + "type": "integer", + "min_samples_per_task": 100, + "max_samples_per_task": 100 + } + }, + { + "output_type_id_params": { + "type": "character", + "max_length": 6, + "min_samples_per_task": 100, + "max_samples_per_task": 500, + "compound_taskid_set": [ + "origin_date", + "horizon", + "location", + "variant" + ] + } + } + ], + "type": "object", + "properties": { + "type": { + "description": "Data type of sample indices.", + "type": "string", + "enum": [ + "character", + "integer" + ] + }, + "max_length": { + "description": "Required only if 'type' is 'character'. Positive integer representing the maximum number of characters in a sample index. Ignored if 'type' is 'integer'.", + "type": "integer", + "minimum": 1 + }, + "min_samples_per_task": { + "description": "The minimum number of samples per individual task.", + "type": "integer", + "minimum": 1 + }, + "max_samples_per_task": { + "description": "The maximum number of samples per individual task.", + "type": "integer", + "minimum": 1 + }, + "compound_taskid_set": { + "description": "Optional. Specifies whether validation should factor in the presence of a compound modeling task. Each item of the array must be a task id variable name. If unspecified, defaults to all task ID variables.", + "type": [ + "array" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "type", + "min_samples_per_task", + "max_samples_per_task" + ], + "if": { + "properties": { + "type": { + "const": "character" + } + } + }, + "then": { + "required": [ + "max_length" + ] + }, + "additionalProperties": false + }, + "value": { + "type": "object", + "description": "Object defining valid values of samples from the predictive distribution for a given sample index. Depending on the Hub specification, samples with the same sample index (specified by the output_type_id) may be assumed to correspond to a joint distribution across multiple levels of the task id variables. See Hub documentation for details.", + "properties": { + "type": { + "description": "Data type of sample value from the predictive distribution.", + "examples": [ + { + "type": "double" + } + ], + "type": "string", + "enum": [ + "double", + "integer" + ] + }, + "minimum": { + "description": "The minimum inclusive valid sample value from the predictive distribution.", + "type": [ + "number", + "integer" + ] + }, + "maximum": { + "description": "The maximum inclusive valid sample value from the predictive distribution.", + "type": [ + "number", + "integer" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "is_required": { + "description": "Is output type required? When required, property should be set to 'true'. If output type is optional, set to 'false'.", + "examples": [ + { + "is_required": true + }, + { + "is_required": false + } + ], + "type": "boolean" + } + }, + "required": [ + "output_type_id_params", + "value", + "is_required" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "target_metadata": { + "description": "Array of objects containing metadata about each unique target, one object for each unique target value.", + "type": "array", + "items": { + "type": "object", + "description": "Object containg metadata about a single unique target.", + "properties": { + "target_id": { + "description": "Short description that uniquely identifies the target.", + "examples": [ + "inc hosp", + "peak week hosp" + ], + "type": "string", + "maxLength": 30 + }, + "target_name": { + "description": "A longer human readable target description that could be used, for example, as a visualisation axis label.", + "examples": [ + "Weekly incident influenza hospitalizations", + "Peak week for incident influenza hospitalizations" + ], + "type": "string", + "maxLength": 100 + }, + "target_units": { + "description": "Unit of observation of the target.", + "examples": [ + "rate per 100,000 population", + "count", + "date" + ], + "type": "string", + "maxLength": 100 + }, + "target_keys": { + "description": "Should be either null, in the case where the target is not specified as a task_id and is specified solely through the target_id target_metadata property or an object with one or more properties, the names of which match task_id variable(s) named within the same model_tasks object. Each property should have one specified value. Each value, or the combination of values if multiple keys are specified, define a single target value.", + "examples": [ + { + "target": "inc hosp" + }, + { + "target": "peak week hosp" + }, + { + "target_variable": "hosp", + "target_outcome": "inc" + }, + { + "target_variable": "case", + "target_outcome": "peak week" + }, + null + ], + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "description": { + "description": "a verbose description of the target that might include information such as the target_measure above, or definitions of a 'rate' or similar.", + "type": "string" + }, + "target_type": { + "description": "Target statistical data type", + "examples": [ + "discrete", + "ordinal" + ], + "type": "string", + "enum": [ + "continuous", + "discrete", + "date", + "binary", + "nominal", + "ordinal", + "compositional" + ] + }, + "is_step_ahead": { + "description": "Whether the target is part of a sequence of values", + "examples": [ + true, + false + ], + "type": "boolean" + }, + "time_unit": { + "description": " if is_step_ahead is true, then this is required and defines the unit of time steps. if is_step_ahead is false, then this should be left out and/or will be ignored if present.", + "examples": [ + "week" + ], + "type": "string", + "enum": [ + "day", + "week", + "month" + ] + } + }, + "required": [ + "target_id", + "target_name", + "target_units", + "target_type", + "target_keys", + "is_step_ahead" + ], + "additionalProperties": false, + "if": { + "properties": { + "is_step_ahead": { + "const": true + } + } + }, + "then": { + "required": [ + "time_unit" + ] + } + } + } + }, + "required": [ + "task_ids", + "output_type", + "target_metadata" + ], + "additionalProperties": false + } + }, + "submissions_due": { + "description": "Object defining the dates by which model forecasts must be submitted to the hub.", + "examples": [ + { + "start": "2022-06-07", + "end": "2022-07-20" + }, + { + "relative_to": "origin_date", + "start": -4, + "end": 2 + } + ], + "type": "object", + "oneOf": [ + { + "properties": { + "relative_to": { + "description": "Name of task id variable in relation to which submission start and end dates are calculated.", + "type": "string" + }, + "start": { + "description": "Difference in days between start and origin date.", + "type": "integer" + }, + "end": { + "description": "Difference in days between end and origin date.", + "type": "integer" + } + }, + "required": [ + "relative_to", + "start", + "end" + ], + "additionalProperties": false + }, + { + "properties": { + "start": { + "description": "Submission start date.", + "type": "string", + "format": "date" + }, + "end": { + "description": "Submission end date.", + "type": "string", + "format": "date" + } + }, + "required": [ + "start", + "end" + ], + "additionalProperties": false + } + ], + "required": [ + "start", + "end" + ] + }, + "last_data_date": { + "description": "The last date with recorded data in the data set used as input to a model.", + "examples": [ + "2022-07-18" + ], + "type": "string", + "format": "date" + }, + "file_format": { + "description": "Accepted file formats of model output files for the round. Overrides the file formats provided in admin.json.", + "examples": [ + [ + "arrow", + "parquet" + ], + [ + "csv" + ] + ], + "type": "array", + "items": { + "type": "string", + "enum": [ + "csv", + "parquet", + "arrow" + ] + } + }, + "derived_task_ids": { + "description": "Names of derived task IDs, i.e. task IDs whose values are derived from (and therefore dependent on) the values of other variables. Use this property to override the global setting for a specific round.", + "examples": [ + [ + "target_end_date" + ] + ], + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "round_id_from_variable", + "round_id", + "model_tasks", + "submissions_due" + ], + "additionalProperties": true + } + }, + "output_type_id_datatype": { + "description": "The hub level data type of the output_type_id column. This data type must be shared across all files in the hub and be able to represent all output type ID values across all hub output types and rounds. If not provided or set to 'auto', hub defaults to autodetecting the simplest hub level data type.", + "default": "auto", + "examples": [ + "character" + ], + "type": "string", + "enum": [ + "auto", + "character", + "double", + "integer", + "logical", + "Date" + ] + }, + "derived_task_ids": { + "description": "Names of derived task IDs, i.e. task IDs whose values are derived from (and therefore dependent on) the values of other variables.", + "examples": [ + [ + "target_end_date" + ] + ], + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "required": [ + "rounds", + "schema_version" + ], + "additionalProperties": false +} diff --git a/tests/testthat/test-utils-schema.R b/tests/testthat/test-utils-schema.R index 26a4270..450a44a 100644 --- a/tests/testthat/test-utils-schema.R +++ b/tests/testthat/test-utils-schema.R @@ -13,6 +13,17 @@ test_that("Invalid branches fail successfully", { ) }) + +test_that("outdated hubUtils will still fetch schema", { + url <- "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.3.3/tasks-schema.json" + # we should attempt to reach github with missing versions (even if they 404) + expect_error( + expect_message(get_schema(url), "your version of hubUtils is outdated"), + "404" + ) +}) + + test_that("Valid json schema versions detected successfully", { expect_equal( get_schema_valid_versions(branch = "hubUtils-test"), @@ -53,6 +64,24 @@ test_that("extract_schema_version works", { ) }) + +test_that("extract_schema_info works", { + + expected <- data.frame( + branch = c("main", "main", "br-v4.0.0", "multi/slash/path"), + version = c("v3.0.1", "v2.0.0", "v4.0.0", "v5.0.0"), + config = c("tasks-schema.json", "admin-schema.json", "tasks-schema.json", "tasks-schema.json") + ) + urls <- c( + "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.1/tasks-schema.json", + "https://raw.githubusercontent.com/hubverse-org/schemas/main/v2.0.0/admin-schema.json", + "https://raw.githubusercontent.com/hubverse-org/schemas/br-v4.0.0/v4.0.0/tasks-schema.json", + "https://raw.githubusercontent.com/hubverse-org/schemas/multi/slash/path/v5.0.0/tasks-schema.json" + ) + expect_equal(expected, extract_schema_info(urls)) +}) + + test_that("check extract_schema_version on multidigit versions", { expect_equal( extract_schema_version(