Commit 535a8795 authored by Pauline Maury Laribière's avatar Pauline Maury Laribière
Browse files

adding documentation everywhere

parent 5e5af7d0
Pipeline #269596 passed with stage
in 19 seconds
# Generated by roxygen2: do not edit by hand
export(dcat_get_agent_from_id)
export(dcat_get_dataset_from_id)
export(dcat_get_dataset_from_identifier)
export(dcat_get_distribution_from_id)
export(dcat_get_distributions_from_dataset_id)
export(dcat_get_distributions_from_dataset_identifier)
export(dcat_list_all_agents)
export(dcat_list_all_datasets)
export(dcat_list_all_distributions)
export(get_codelist)
export(get_content_configuration)
export(get_data_structure)
export(get_dataset_description)
export(get_dataset_information)
export(get_identifier_content)
export(get_nomenclature_multiple_levels)
export(get_nomenclature_one_level)
export(get_nomenclature_path_nodes)
export(query_nomenclature)
......@@ -2,7 +2,20 @@
########################## i14y APIs ##########################
###############################################################
# @export
#' Get a codelist based on an identifier
#'
#' @param identifier the codelist's identifier
#' @param export_format the export's format
#' Available are CSV, XLSX, SDMX-ML or JSON.
#' @param version_format the export format's version
#' (2.0 or 2.1 when format is SDMX-ML).
#' @param annotations flag to include annotations
#'
#' @return response based on the export format
#' @export
#'
#' @examples
#' get_codelist(identifier='CL_NOGA_SECTION')
get_codelist <- function(identifier,
export_format = "SDMX-ML",
version_format = 2.1,
......@@ -17,6 +30,13 @@ get_codelist <- function(identifier,
}
#' Get the display information for the available configured content
#'
#' @return the configured content's display information
#' @export
#'
#' @examples
#' get_content_configuration()
get_content_configuration <- function() {
api <- api_class(api_type = "content_configuration")
api$get_response()
......@@ -24,6 +44,15 @@ get_content_configuration <- function() {
#' Get a nomenclature information based on its identifier
#'
#' @param identifier the nomenclature's identifier
#'
#' @return the nomenclature's information
#' @export
#'
#' @examples
#' get_identifier_content(identifier='HCL_CH_ISCO_19_PROF')
get_identifier_content <- function(identifier) {
api <- api_class(
api_type = "content_configuration_identifier",
......@@ -35,6 +64,17 @@ get_identifier_content <- function(identifier) {
#' Get the dcat dataset description
#'
#' @param identifier the dataset's identifier
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#'
#' @return dataset description
#' @export
#'
#' @examples
#' get_dataset_description(identifier='HCL_NOGA', language='de')
get_dataset_description <- function(identifier, language = "fr") {
api <- api_class(
api_type = "dcat_dataset_description",
......@@ -46,6 +86,17 @@ get_dataset_description <- function(identifier, language = "fr") {
#' Get the dcat dataset information
#'
#' @param identifier the dataset's identifier
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#'
#' @return dataset's information
#' @export
#'
#' @examples
#' get_dataset_information(identifier='HCL_NOGA', language='de')
get_dataset_information <- function(identifier, language = "en") {
api <- api_class(
api_type = "dcat_dataset_information",
......@@ -57,6 +108,17 @@ get_dataset_information <- function(identifier, language = "en") {
#' Get the data structure
#'
#' @param identifier the dataset's identifier
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#'
#' @return data structure
#' @export
#'
#' @examples
#' get_data_structure(identifier='HCL_NOGA', language='it')
get_data_structure <- function(identifier, language = "en") {
api <- api_class(
api_type = "dcat_data_structure",
......@@ -68,6 +130,19 @@ get_data_structure <- function(identifier, language = "en") {
#' Get the nodes of a path within a nomenclature
#'
#' @param identifier the nomenclature's identifier
#' @param path the path leading to the nodes
#' @param filters the filters to apply
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#'
#' @return nodes and their metadata
#' @export
#'
#' @examples
#' get_nomenclature_path_nodes(identifier='HCL_CH_ISCO_19_PROF', path='.', filters=my_filters)
get_nomenclature_path_nodes <- function(identifier,
path = ".",
filters = "",
......@@ -83,6 +158,21 @@ get_nomenclature_path_nodes <- function(identifier,
}
#' Get one level of a nomenclature
#'
#' @param identifier nomenclature's identifier
#' @param filters additionnal filters
#' @param level_number level to export
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#' @param annotations flag to include annotations
#'
#' @return dataframe with 3 columns
#' (Code, Parent and Name in the selected language)
#' @export
#'
#' @examples
#' get_nomenclature_one_level(identifier='HCL_CH_ISCO_19_PROF', filters=my_filters, level_number=2)
get_nomenclature_one_level <- function(identifier,
filters,
level_number = 1,
......@@ -100,6 +190,22 @@ get_nomenclature_one_level <- function(identifier,
}
#' Get multiple levels of a nomenclature (from `level_from` to `level_to`)
#'
#' @param identifier nomenclature's identifier
#' @param filters additionnal filters
#' @param level_from the 1st level to include
#' @param level_to the last level to include
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#' @param annotations flag to include annotations
#'
#' @return dataframe columns
#' from `level_from` to `level_to` codes
#' @export
#'
#' @examples
#' get_nomenclature_multiple_levels(identifier='HCL_CH_ISCO_19_PROF', filters=my_filters, level_from=2, level_to=5)
get_nomenclature_multiple_levels <- function(identifier,
filters,
level_from = 1,
......@@ -120,6 +226,21 @@ get_nomenclature_multiple_levels <- function(identifier,
}
#' Search query within a nomenclature
#'
#' @param identifier nomenclature's identifier
#' @param query the search query
#' @param page_number the number of the result page to return
#' @param page_size the size of each page result
#' @param filters additionnal filters
#' @param language the language of the response data
#' Available are 'fr', 'de', 'it', 'en'.
#'
#' @return the query result
#' @export
#'
#' @examples
#' query_nomenclature(identifier='HCL_CH_ISCO_19_PROF', query='SELECT *', page_number=5, page_size=2, filters=my_filters)
query_nomenclature <- function(identifier,
query,
page_number,
......@@ -142,6 +263,13 @@ query_nomenclature <- function(identifier,
###############################################################
#' List all agents
#'
#' @return all agents
#' @export
#'
#' @examples
#' dcat_list_all_agents()
dcat_list_all_agents <- function() {
api <- api_class(
api_type = "agents_list",
......@@ -151,6 +279,15 @@ dcat_list_all_agents <- function() {
}
#' Get the agent with the corresponding agent id
#'
#' @param agent_id agent's id
#'
#' @return agent with this id
#' @export
#'
#' @examples
#' dcat_get_agent_from_id(agent_id='xx')
dcat_get_agent_from_id <- function(agent_id) {
api <- api_class(
api_type = "agent_id",
......@@ -161,6 +298,13 @@ dcat_get_agent_from_id <- function(agent_id) {
}
#' List all datasets
#'
#' @return all datasets
#' @export
#'
#' @examples
#' dcat_list_all_datasets()
dcat_list_all_datasets <- function() {
api <- api_class(
api_type = "dataset_list",
......@@ -170,6 +314,15 @@ dcat_list_all_datasets <- function() {
}
#' Get all distributions for the dataset with the corresponding dataset id
#'
#' @param dataset_id dataset's id
#'
#' @return distributions for the dataset with dataset's id
#' @export
#'
#' @examples
#' dcat_get_distributions_from_dataset_id(dataset_id='xx')
dcat_get_distributions_from_dataset_id <- function(dataset_id) {
api <- api_class(
api_type = "dataset_id_distributions",
......@@ -180,6 +333,15 @@ dcat_get_distributions_from_dataset_id <- function(dataset_id) {
}
#' Get the dataset with the corresponding id
#'
#' @param dataset_id dataset's id
#'
#' @return the dataset
#' @export
#'
#' @examples
#' dcat_get_dataset_from_id(dataset_id='xx')
dcat_get_dataset_from_id <- function(dataset_id) {
api <- api_class(
api_type = "dataset_id",
......@@ -190,6 +352,15 @@ dcat_get_dataset_from_id <- function(dataset_id) {
}
#' Get the dataset with the corresponding identifier
#'
#' @param identifier dataset's identifier
#'
#' @return the dataset
#' @export
#'
#' @examples
#' dcat_get_dataset_from_identifier(identifier='xx')
dcat_get_dataset_from_identifier <- function(identifier) {
api <- api_class(
api_type = "dataset_identifier",
......@@ -200,6 +371,16 @@ dcat_get_dataset_from_identifier <- function(identifier) {
}
#' Get all distributions for the dataset with the corresponding identifier.
#'
#' @param identifier dataset's identifier
#'
#' @return all distributions for the dataset with
#' the corresponding dataset identifier
#' @export
#'
#' @examples
#' dcat_get_distributions_from_dataset_identifier(identifier='xx')
dcat_get_distributions_from_dataset_identifier <- function(identifier) {
api <- api_class(
api_type = "dataset_identifier_distributions",
......@@ -210,6 +391,13 @@ dcat_get_distributions_from_dataset_identifier <- function(identifier) {
}
#' List all distributions
#'
#' @return all distributions
#' @export
#'
#' @examples
#' dcat_list_all_distributions()
dcat_list_all_distributions <- function() {
api <- api_class(
api_type = "distributions_list",
......@@ -219,6 +407,15 @@ dcat_list_all_distributions <- function() {
}
#' Get the distribution with the corresponding id
#'
#' @param distribution_id distribution's id
#'
#' @return the distribution
#' @export
#'
#' @examples
#' dcat_get_distribution_from_id(distribution_id='xx')
dcat_get_distribution_from_id <- function(distribution_id) {
api <- api_class(
api_type = "distribution_id",
......
......@@ -13,19 +13,19 @@ Api class to make appropriate request based on parameters
\describe{
\item{\code{api_type}}{character. The name of the api to call (see url_mapping)}
\item{\code{export_format}}{character. The export's format
Available are CSV, XLSX, SDMX-ML and SDMX-JSON}
\item{\code{export_format}}{character (default = "JSON"). The export's format
Available are CSV, XLSX, SDMX-ML and JSON}
\item{\code{root_url}}{character. Root url to call (for i14y or dcat)}
\item{\code{root_url}}{character (default = "BASE_URL"). Root url to call (for i14y or dcat)}
\item{\code{parameters}}{character. Additional request parameters}
\item{\code{id}}{character. The identifier or id of the request's object}
\item{\code{language}}{character. The language of the response data.
\item{\code{language}}{character (default = "en"). The language of the response data.
Available are 'fr', 'de', 'it', 'en'}
\item{\code{version_format}}{numeric. The export format's version
\item{\code{version_format}}{numeric (default = 2.1). The export format's version
(2.0 or 2.1 when format is SDMX-ML)
(for 'codelist')}
......
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