Commit 77659e1b authored by Pauline Maury Laribière's avatar Pauline Maury Laribière
Browse files

making stringify

parent 9208de79
Pipeline #269043 passed with stage
in 3 minutes and 7 seconds
library(hash)
###############################################################
########################## i14y APIs ##########################
###############################################################
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()
}
get_codelist(identifier='CL_NOGA_SECTION')
get_content_configuration <- function(){
api <- api_class(api_type = "content_configuration")
api$get_response()
}
get_content_configuration()
get_codelist <- function() {
get_identifier_content <- function(identifier){
api <- api_class(
api_type = "codelist",
export_format = "SDMX-ML",
parameters = "level=1&annotations=true&additionalProp2=string&language=fr",
id = "CL_NOGA_SECTION"
api_type = "content_configuration_identifier",
id = identifier
)
api$get_response()
}
get_identifier_content(identifier='HCL_CH_ISCO_19_PROF')
get_codelist()
get_dataset_description <- function(identifier, language='fr'){
api <- api_class(
api_type = "dcat_dataset_description",
id = identifier,
language = language
)
api$get_response()
}
get_dataset_description(identifier='HCL_NOGA', language='de')
get_one_level <- function() {
api_call <- api(
api_type = "nomenclature_one_level",
export_format = "CSV",
root_url = BASE_URL,
parameters = "level=1&annotations=true&additionalProp2=string&language=fr",
id = "HCL_CH_ISCO_19_PROF",
language = "fr",
get_dataset_information <- function(identifier, language='en'){
api <- api_class(
api_type = "dcat_dataset_information",
id = identifier,
language = language
)
api_call$get_url()
api_call$api_call()
api$get_response()
}
get_dataset_information(identifier='HCL_NOGA', language='de')
get_data_structure <- function(identifier, language='en'){
api <- api_class(
api_type = "dcat_data_structure",
id = identifier,
language = language
)
api$get_response()
}
get_data_structure(identifier='HCL_NOGA', language='it')
get_nomenclature_path_nodes <- function(identifier, path='.', filters='', language='en'){
api <- api_class(
api_type = "nomenclature_path_nodes",
id = identifier,
path = path,
parameters = stringify(filters),
language = language
)
api$get_response()
}
my_filters <- hash(
'prop1'= list("string"),
'prop2' = list("string", "string2")
)
get_nomenclature_path_nodes(identifier='HCL_CH_ISCO_19_PROF', path='.', filters=my_filters)
get_one_level()
......@@ -62,12 +62,12 @@ api_class <- setRefClass(
glue('ContentConfigurations'),
'content_configuration_identifier' =
glue('ContentConfigurations/{id}'),
'dcat_data_structure' =
glue('DataStructures/{id}/{language}'),
'dcat_dataset_description' =
glue('Datasets/{id}/{language}/description'),
'dcat_dataset_information' =
glue('Datasets/{id}/{language}/distributions'),
'data_structure' =
glue('DataStructures/{id}/{language}'),
'nomenclature_path_nodes' =
glue('Nomenclatures/Childnodes/{id}/{language}/{path}'),
'nomenclature_one_level' =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment