Learn R Programming

rsdmx (version 0.5-1)

SDMXRequestBuilder: Class "SDMXRequestBuilder"

Description

A basic class to handle a SDMX service request builder

Usage

SDMXRequestBuilder(regUrl, repoUrl, handler, compliant)

Arguments

regUrl
an object of class "character" giving the base Url of the SDMX service registry
repoUrl
an object of class "character" giving the base Url of the SDMX service repository
handler
an object of class "function" that will be in charge of build a web request.
compliant
an object of class "logical" indicating if the request builder is somehow compliant with a service specification

Warning

This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document (Concepts, or DataStructureDefinition)

Details

The handler function must have the following structure in term of arguments (baseUrl, agencyId, resource, resourceId, version, flowRef, key, start, end, compliant) and output (a string representing the web request to build). The rsdmx package will as much as possible try to handler generic handlers, e.g. an handler for SDMX REST web-services. For the latter example, a specific builder is provided and made part of the specific and still experimental SDMXRESTRequestBuilder.

Examples

Run this code
#an handler
 myHandler <- function(baseUrl, agencyId, resource, resourceId, version,
                       flowRef, key, start, end, compliant){
   req <- paste(baseUrl, agencyId, resource, flowRef, key, start, end, sep="/")
   return(req)
 }

 #how to create a SDMXRequestBuilder
 requestBuilder <- SDMXRequestBuilder(
   regUrl = "http://www.myorg.org/registry",
   repoUrl = "http://www.myorg.org/repository",
   handler = myHandler, compliant = FALSE)

Run the code above in your browser using DataLab