Newer
Older
###############################################################
########################## i14y APIs ##########################
###############################################################
# @export
get_codelist <- function(identifier,
export_format = "SDMX-ML",
version_format = 2.1,
annotations = FALSE) {
api <- api_class(
api_type = "codelist",
export_format = export_format,
parameters = glue("annotations={tolower(annotations)}"),
id = identifier
)
api$get_response()
}
api <- api_class(api_type = "content_configuration")
api$get_response()
}
api_type = "content_configuration_identifier",
id = identifier
get_dataset_description <- function(identifier, language = "fr") {
api <- api_class(
api_type = "dcat_dataset_description",
language = language
)
api$get_response()
}
get_dataset_information <- function(identifier, language = "en") {
api <- api_class(
api_type = "dcat_dataset_information",
get_data_structure <- function(identifier, language = "en") {
api <- api_class(
api_type = "dcat_data_structure",
language = language
)
api$get_response()
}
get_nomenclature_path_nodes <- function(identifier,
path = ".",
filters = "",
language = "en") {
api <- api_class(
api_type = "nomenclature_path_nodes",
path = path,
parameters = stringify(filters),
language = language
)
api$get_response()
}
get_nomenclature_one_level <- function(identifier,
filters,
level_number = 1,
language = "en",
annotations = FALSE) {
parameters <- glue::glue("language={language}&level={level_number}&annotations={tolower(annotations)}&{stringify(filters)}")
print(parameters)
api <- api_class(
api_type = "nomenclature_one_level",
get_nomenclature_multiple_levels <- function(identifier,
filters,
level_from = 1,
level_to = 2,
language = "en",
annotations = FALSE) {
parameters <- glue::glue("language={language}&levelFrom={level_from}&levelTo={level_to}&annotations={tolower(annotations)}&{stringify(filters)}")
api <- api_class(
api_type = "nomenclature_multiple_levels",
)
api$get_response()
###############################################################
# TODO: post processing in R
###############################################################
}
query_nomenclature <- function(identifier,
query,
page_number,
page_size,
filters,
language = "en") {
parameters <- glue::glue("query={URLencode(query)}&page={page_number}&pageSize={page_size}&language={language}&{stringify(filters)}")
api <- api_class(
api_type = "nomenclature_search",
parameters = parameters
)
api$get_response()
}
###############################################################
########################## dcat APIs ##########################
###############################################################
api <- api_class(
api_type = "agents_list",
root_url = DCAT_URL
)
api$get_response()
}
api <- api_class(
api_type = "agent_id",
root_url = DCAT_URL,
id = agent_id
)
api$get_response()
}
api <- api_class(
api_type = "dataset_list",
root_url = DCAT_URL
)
api$get_response()
}
dcat_get_distributions_from_dataset_id <- function(dataset_id) {
api <- api_class(
api_type = "dataset_id_distributions",
root_url = DCAT_URL,
id = dataset_id
)
api$get_response()
}
dcat_get_dataset_from_id <- function(dataset_id) {
api <- api_class(
api_type = "dataset_id",
root_url = DCAT_URL,
id = dataset_id
)
api$get_response()
}
dcat_get_dataset_from_identifier <- function(identifier) {
api <- api_class(
api_type = "dataset_identifier",
root_url = DCAT_URL,
id = identifier
)
api$get_response()
}
dcat_get_distributions_from_dataset_identifier <- function(identifier) {
api <- api_class(
api_type = "dataset_identifier_distributions",
root_url = DCAT_URL,
id = identifier
)
api$get_response()
}
api <- api_class(
api_type = "distributions_list",
root_url = DCAT_URL
)
api$get_response()
}
dcat_get_distribution_from_id <- function(distribution_id) {
api <- api_class(
api_type = "distribution_id",
root_url = DCAT_URL,
id = distribution_id
)
api$get_response()
}