Title: | Tools for Reading SDMX Data and Metadata |
---|---|
Description: | Set of classes and methods to read data and metadata documents exchanged through the Statistical Data and Metadata Exchange (SDMX) framework, currently focusing on the SDMX XML standard format (SDMX-ML). |
Authors: | Emmanuel Blondel [aut, cre] |
Maintainer: | Emmanuel Blondel <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.6-4 |
Built: | 2024-08-26 08:44:43 UTC |
Source: | https://github.com/opensdmx/rsdmx |
function that allows configuring a new SDMXServiceProvider as part of the list of providers known by rsdmx, hence by readSDMX
addSDMXServiceProvider(provider)
addSDMXServiceProvider(provider)
provider |
an object of class "SDMXServiceProvider" |
Emmanuel Blondel, [email protected]
getSDMXServiceProviders findSDMXServiceProvider readSDMX
#create a provider myBuilder <- SDMXREST20RequestBuilder(regUrl = "http://www.myorg.org/registry", repoUrl = "http://www.myorg.org/repository", compliant = TRUE) myProvider <- SDMXServiceProvider( agencyId = "MYORG", name = "My Organization", builder = myBuilder ) #add it addSDMXServiceProvider(myProvider) #check out the list of existing provider (only list the agency Ids) sapply(slot(getSDMXServiceProviders(), "providers"), function(x){slot(x, "agencyId")})
#create a provider myBuilder <- SDMXREST20RequestBuilder(regUrl = "http://www.myorg.org/registry", repoUrl = "http://www.myorg.org/repository", compliant = TRUE) myProvider <- SDMXServiceProvider( agencyId = "MYORG", name = "My Organization", builder = myBuilder ) #add it addSDMXServiceProvider(myProvider) #check out the list of existing provider (only list the agency Ids) sapply(slot(getSDMXServiceProviders(), "providers"), function(x){slot(x, "agencyId")})
function used to find a specific namespace within the available namespaces of an SDMX-ML object
findNamespace(namespaces, messageType)
findNamespace(namespaces, messageType)
namespaces |
object of class |
messageType |
object of class |
an object of class "character" giving the namespace uri if found in the available namespaces
findNamespace
is a function used internally as utility function in
SDMX-ML object parsers.
Emmanuel Blondel, [email protected]
function that allows searching by provider id in the list of known SDMXServiceProvider. This function can be used for interrogating the list of default providers known by rsdmx, and is used internally by readSDMX
findSDMXServiceProvider(agencyId)
findSDMXServiceProvider(agencyId)
agencyId |
an object of class "character" representing a provider identifier |
an object of class "SDMXServiceProvider" (or NULL if no matching)
Emmanuel Blondel, [email protected]
getSDMXServiceProviders addSDMXServiceProvider readSDMX
#find OECD provider oecd.provider <- findSDMXServiceProvider("OECD")
#find OECD provider oecd.provider <- findSDMXServiceProvider("OECD")
Access the namespaces of the SDMX-ML object
getNamespaces(obj) ## S4 method for signature 'SDMX' getNamespaces(obj)
getNamespaces(obj) ## S4 method for signature 'SDMX' getNamespaces(obj)
obj |
An object deriving from class "SDMX" |
an object of class data.frame
giving the id and uri for each
of the namespaces handled in the SDMX-ML document.
getNamespaces(SDMX)
: Access the namespaces of the SDMX-ML object
Emmanuel Blondel, [email protected]
function used to extract the SDMX-ML message from a registry interface query
getRegistryInterfaceResult(xmlObj)
getRegistryInterfaceResult(xmlObj)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
an object of class "XMLInternalDocument derived from XML package
getRegistryInterfaceResult
is a function used internally by readSDMX
Emmanuel Blondel, [email protected]
function used to get the list of SDMXServiceProvider known by rsdmx (hence known by readSDMX to query data or metadata in an easier way). This function can be easily used to interrogate the list of known providers, and eventually consider adding one at runtime with addSDMXServiceProvider
getSDMXServiceProviders()
getSDMXServiceProviders()
an object of class "list" (of SDMXServiceProvider)
Emmanuel Blondel, [email protected]
addSDMXServiceProvider findSDMXServiceProvider readSDMX
function used to extract the SDMX-ML message from a SOAP request response
getSoapRequestResult(xmlObj)
getSoapRequestResult(xmlObj)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
an object of class "XMLInternalDocument derived from XML package
getSoapRequestResult
is a function used internally by readSDMX
Emmanuel Blondel, [email protected]
Access the subtype of SDMXStructureType object
getStructureType(obj)
getStructureType(obj)
obj |
An object deriving from class "SDMXStructureType" |
an object of class "character"
An object deriving from class "SDMXStructureType"
Emmanuel Blondel, [email protected]
function used to detect if the XML document corresponds to a registry interface query
isRegistryInterfaceEnvelope(xmlObj, nativeRoot)
isRegistryInterfaceEnvelope(xmlObj, nativeRoot)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
nativeRoot |
object of class "logical" indicating if it is the native document |
an object of class "logical"
isRegistryInterfaceEnvelope
is a function used internally by readSDMX
Emmanuel Blondel, [email protected]
function used to detect if the XML document corresponds to a SOAP request response
isSoapRequestEnvelope(xmlObj, namespaces)
isSoapRequestEnvelope(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "logical"
isSoapRequestEnvelope
is a function used internally by readSDMX
Emmanuel Blondel, [email protected]
function used to get the namespaces handled by an SDMX-ML object
namespaces.SDMX(xmlObj)
namespaces.SDMX(xmlObj)
xmlObj |
an object of class "XMLInternalDocument" |
an object of class "data.frame" giving the namespace(s) id and uri
namespaces.SDMX
is a function used internally to get the
namespaces of the SDMX-ML object through getNamespaces. This last function
is used an utility re-used in the different SDMX document parsers.
Emmanuel Blondel, [email protected]
readSDMX
is the main function to use to read SDMX data
readSDMX(file = NULL, isURL = TRUE, isRData = FALSE, provider = NULL, providerId = NULL, providerKey = NULL, agencyId = NULL, resource = NULL, resourceId = NULL, version = NULL, flowRef = NULL, key = NULL, key.mode = "R", start = NULL, end = NULL, dsd = FALSE, headers = list(), validate = FALSE, verbose = !is.null(logger), logger = "INFO", ...)
readSDMX(file = NULL, isURL = TRUE, isRData = FALSE, provider = NULL, providerId = NULL, providerKey = NULL, agencyId = NULL, resource = NULL, resourceId = NULL, version = NULL, flowRef = NULL, key = NULL, key.mode = "R", start = NULL, end = NULL, dsd = FALSE, headers = list(), validate = FALSE, verbose = !is.null(logger), logger = "INFO", ...)
file |
path to SDMX-ML document that needs to be parsed |
isURL |
a value of class "logical" either the path is an url, and data
has to be downloaded from a SDMXweb-repository. Default value is TRUE.
Ignored in case |
isRData |
a value of class "logical" either the path is local RData file
handling an object of class "SDMX", previously saved with |
provider |
an object of class "SDMXServiceProvider". If specified,
|
providerId |
an object of class "character" representing a provider id.
It has to be match a default provider as listed in |
providerKey |
an object of class "character" giving a key to authenticate for the given provider endpoint. Some providers may require an authentication or subscription key to perform SDMX requests. |
agencyId |
an object of class "character representing an agency id, for which data should be requested (from a particular service provider) |
resource |
an object of class "character" giving the SDMX service request resource to query e.g. "data". Recognized if a valid provider or provide id has been specified as argument. |
resourceId |
an object of class "character" giving a SDMX service resource Id, e.g. the id of a data structure |
version |
an object of class "character" giving a SDMX resource version, e.g. the version of a dataflow. |
flowRef |
an object of class "character" giving the SDMX flow ref id. Recognized if valid provider or provide id has been specified as argument. |
key |
an object of class "character" or "list" giving the SDMX data key/filter
to apply. Recognized if a valid provider or provide id has been specified as argument.
If |
key.mode |
an object of class "character" indicating if the |
start |
an object of class "integer" or "character" giving the SDMX start time to apply. Recognized if a valid provider or provide id has been specified as argument. |
end |
an object of class "integer" or "character" giving the SDMX end time to apply. Recognized if a valid provider or provide id has been specified as argument. |
dsd |
an Object of class "logical" if an attempt to inherit the DSD should be performed.
Active only if |
headers |
an object of class "list" that contains any additional headers for the request. |
validate |
an object of class "logical" indicating if a validation check has to be performed on the SDMX-ML document to check its SDMX compliance when reading it. Default is FALSE. |
verbose |
an Object of class "logical" that indicates if rsdmx logs should
appear to user. Default is set to |
logger |
reports if a logger has to be used to print log messages. Default is |
... |
(any other parameter to pass to httr::GET request) |
an object of class "SDMX"
Emmanuel Blondel, [email protected]
# SDMX datasets #-------------- ## Not run: # Not run # (local dataset examples) #with SDMX 2.0 tmp <- system.file("extdata","Example_Eurostat_2.0.xml", package="rsdmx") sdmx <- readSDMX(tmp, isURL = FALSE) stats <- as.data.frame(sdmx) head(stats) #with SDMX 2.1 tmpnew <- system.file("extdata","Example_Eurostat_2.1.xml", package="rsdmx") sdmx <- readSDMX(tmpnew, isURL = FALSE) stats <- as.data.frame(sdmx) head(stats) ## End(**Not run**) ## End(Not run) ## Not run: # Not run by 'R CMD check' # (reliable remote datasource but with possible occasional unavailability) #examples using embedded providers sdmx <- readSDMX(providerId = "OECD", resource = "data", flowRef = "MIG", key = list("TOT", NULL, NULL), start = 2011, end = 2011) stats <- as.data.frame(sdmx) head(stats) #examples using 'file' argument #using url (Eurostat REST SDMX 2.1) url <- paste("http://ec.europa.eu/eurostat/SDMX/diss-web/rest/data/", "cdh_e_fos/all/?startperiod=2000&endPeriod=2010", sep = "") sdmx <- readSDMX(url) stats <- as.data.frame(sdmx) head(stats) ## End(**Not run**) ## End(Not run) # SDMX DataStructureDefinition (DSD) #----------------------------------- ## Not run: # Not run by 'R CMD check' # (reliable remote datasource but with possible occasional unavailability) #using embedded providers dsd <- readSDMX(providerId = "OECD", resource = "datastructure", resourceId = "WATER_ABSTRACT") #get codelists from DSD cls <- slot(dsd, "codelists") codelists <- sapply(slot(cls,"codelists"), slot, "id") #get list of codelists #get a codelist codelist <- as.data.frame(cls, codelistId = "CL_WATER_ABSTRACT_SOURCE") #get concepts from DSD concepts <- as.data.frame(slot(dsd, "concepts")) ## End(**Not run**) ## End(Not run)
# SDMX datasets #-------------- ## Not run: # Not run # (local dataset examples) #with SDMX 2.0 tmp <- system.file("extdata","Example_Eurostat_2.0.xml", package="rsdmx") sdmx <- readSDMX(tmp, isURL = FALSE) stats <- as.data.frame(sdmx) head(stats) #with SDMX 2.1 tmpnew <- system.file("extdata","Example_Eurostat_2.1.xml", package="rsdmx") sdmx <- readSDMX(tmpnew, isURL = FALSE) stats <- as.data.frame(sdmx) head(stats) ## End(**Not run**) ## End(Not run) ## Not run: # Not run by 'R CMD check' # (reliable remote datasource but with possible occasional unavailability) #examples using embedded providers sdmx <- readSDMX(providerId = "OECD", resource = "data", flowRef = "MIG", key = list("TOT", NULL, NULL), start = 2011, end = 2011) stats <- as.data.frame(sdmx) head(stats) #examples using 'file' argument #using url (Eurostat REST SDMX 2.1) url <- paste("http://ec.europa.eu/eurostat/SDMX/diss-web/rest/data/", "cdh_e_fos/all/?startperiod=2000&endPeriod=2010", sep = "") sdmx <- readSDMX(url) stats <- as.data.frame(sdmx) head(stats) ## End(**Not run**) ## End(Not run) # SDMX DataStructureDefinition (DSD) #----------------------------------- ## Not run: # Not run by 'R CMD check' # (reliable remote datasource but with possible occasional unavailability) #using embedded providers dsd <- readSDMX(providerId = "OECD", resource = "datastructure", resourceId = "WATER_ABSTRACT") #get codelists from DSD cls <- slot(dsd, "codelists") codelists <- sapply(slot(cls,"codelists"), slot, "id") #get list of codelists #get a codelist codelist <- as.data.frame(cls, codelistId = "CL_WATER_ABSTRACT_SOURCE") #get concepts from DSD concepts <- as.data.frame(slot(dsd, "concepts")) ## End(**Not run**) ## End(Not run)
RSDMX is a package to parse/read SDMX documents in R. It provides: - a set of classes and methods to read data and metadata documents exchanged through theStatistical Data and Metadata Exchange (SDMX) framework. The package currently focuses on the SDMX XML standard format (SDMX-ML). - an web-service interface to well-known SDMX data providers
Emmanuel Blondel [email protected]
rsdmxLogger
R6Class
object.
Object of R6Class
for modelling a simple logger
INFO(text)
Logger to report information. Used internally
WARN(text)
Logger to report warnings. Used internally
ERROR(text)
Logger to report errors. Used internally
Logger class used internally by rsdmx
saveSDMX
is the function to save R SDMX object
saveSDMX(sdmxObj, file)
saveSDMX(sdmxObj, file)
sdmxObj |
an object of class |
file |
a connection or the name of the file where the R object is saved to |
Emmanuel Blondel, [email protected]
sdmx <- system.file("extdata","Example_Eurostat_2.0.xml", package="rsdmx") saveSDMX(sdmx, "sdmx.rda")
sdmx <- system.file("extdata","Example_Eurostat_2.0.xml", package="rsdmx") saveSDMX(sdmx, "sdmx.rda")
An abstract class from which SDMX classes are derived
SDMX(xmlObj, namespaces)
SDMX(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMX"
xmlObj
Object of class "XMLInternalDocument" derived from XML package
schema
Object of class "SDMXSchema", handles the version of SDMX-ML format
header
Object of class "SDMXHeader", handles the SDMX-ML document header
footer
Object of class "SDMXFooter", handles the SDMX-ML document footer
This class is not useful in itself, but all SDMX classes in this package derive from it.
Currently, the approach drafted in rsdmx package was to rely on XML package, read the xml object and store it as part of the SDMX R object. Another approach being investigated is to use XML handlers throughthe Simple API for XML (SAX) that could avoid to load the full XML tree in the SDMX R object (xmlObj). Indeed, SDMX data could be huge and causes issues of memory if the complete XML tree is loaded in the R user session.
@author Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Concept
SDMXAgency(xmlObj, namespaces)
SDMXAgency(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXAgency"
Emmanuel Blondel, [email protected]
A basic abstract class to handle a SDMXAgencyScheme
SDMXAgencyScheme(xmlObj, namespaces)
SDMXAgencyScheme(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXAgencyScheme"
id
Object of class "character" giving the ID of the concept scheme (required)
agencyID
Object of class "character" giving the AgencyID
version
Object of class "character" giving the version
uri
Object of class "character" giving the concept uri
urn
Object of class "character" giving the concept urn
isExternalReference
Object of class "logical" indicating if the concept scheme is an external reference
isFinal
Object of class "logical" indicating if the concept scheme is final
validFrom
Object of class "character" indicating the start validity period
validTo
Object of class "character" indicating the end validity period
Name
Object of class "list" giving the agency scheme name (by language) - required
Description
Object of class "list" giving the agency scheme description (by language)
agencies
object of class "list" giving the list of SDMXAgency
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Attribute
SDMXAttribute(xmlObj, namespaces)
SDMXAttribute(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXAttribute"
conceptRef
Object of class "character" giving the attribute conceptRef (required)
conceptVersion
Object of class "character" giving the attribute concept version
conceptAgency
Object of class "character" giving the attribute concept agency
conceptSchemeRef
Object of class "character" giving the attribute conceptScheme ref
conceptSchemeAgency
Object of class "character" giving the attribute conceptScheme agency
codelist
Object of class "character" giving the codelist ref name
codelistVersion
Object of class "character" giving the codelist ref version
codelistAgency
Object of class "character" giving the codelist ref agency
attachmentLevel
Object of class "character" giving the attachment level (e.g. DataSet)
assignmentStatus
Object of class "character" giving the assignment status (e.g. Mandatory)
isTimeFormat
Object of class "logical"
crossSectionalAttachDataset
Object of class "logical"
crossSectionalAttachGroup
Object of class "logical"
crossSectionalAttachSection
Object of class "logical"
crossSectionalAttachObservation
Object of class "logical"
isEntityAttribute
Object of class "logical" indicating if the Attribute is an entity Attribute. Default value is FALSE
isNonObservationTimeAttribute
Object of class "logical" indicating if the Attribute is a non-observation Attribute. Default value is FALSE
isCountAttribute
Object of class "logical" indicating if the Attribute is a count Attribute. Default value is FALSE
isFrequencyAttribute
Object of class "logical" indicating if the Attribute is a frequency Attribute. Default value is FALSE
isIdentityAttribute
Object of class "logical" indicating if the Attribute is an identity Attribute. Default value is FALSE
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document (DataStructures, or DataStructureDefinitions)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Code
SDMXCode(xmlObj, namespaces)
SDMXCode(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXCode"
id
Object of class "character" giving the ID of the code (required). In SDMX 2.0 documents, this slot will handle the 'value' attribute
urn
Object of class "character" giving the code urn
parentCode
Object of class "character" giving the parent code
label
Object of class "list" giving the code label (by language). In SDMX 2.0, it takes the code 'Description' element vs. 'Name' element in SDMX 2.1. This property deprecated and kept now for backward compatibility.
name
Object of class "list" giving the code name (by language).
description
Object of class "list" giving the code description (by language).
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document (Codelists, or DataStructureDefinition)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Codelist
SDMXCodelist(xmlObj, namespaces)
SDMXCodelist(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXCodelist"
id
Object of class "character" giving the ID of the codelist (required)
agencyID
Object of class "character" giving the AgencyID
version
Object of class "character" giving the version
uri
Object of class "character" giving the codelist uri
urn
Object of class "character" giving the codelist urn
isExternalReference
Object of class "logical" indicating if the codelist is an external reference
isFinal
Object of class "logical" indicating if the codelist is final
validFrom
Object of class "character" indicating the start validity period
validTo
Object of class "character" indicating the end validity period
Name
Object of class "list" giving the codelist (by language) - required
Description
Object of class "list" giving the codelist description (by language)
Code
Object of class "list" giving the list of "SDMXCode" objects included in the codelist (see SDMXCode)
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document (Codelists, or DataStructureDefinition)
Emmanuel Blondel, [email protected]
A basic class to handle SDMX Codelists
SDMXCodelists(xmlObj, namespaces)
SDMXCodelists(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXCodelists"
codelists
Object of class "list" giving the list of "SDMXCodelist"
This class is not useful in itself, but SDMXDataStructureDefinition objects will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML compact data set
SDMXCompactData(xmlObj, namespaces)
SDMXCompactData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXCompactData"
Emmanuel Blondel, [email protected]
A basic class to handle SDMX Components
SDMXComponents(xmlObj, namespaces)
SDMXComponents(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXComponents"
Dimensions
Object of class "list" giving the list of dimensions (see SDMXDimension)
TimeDimension
Object of class "SDMXTimeDimension"
PrimaryMeasure
Object of class "SDMXPrimaryMeasure"
Attributes
Object of class "list" giving the list of attributes (see SDMXAttribute)
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document (DataStructures, or DataStructureDefinitions)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Concept
SDMXConcept(xmlObj, namespaces)
SDMXConcept(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXConcept"
id
Object of class "character" giving the ID of the concept (required)
agencyID
Object of class "character" giving the AgencyID
version
Object of class "character" giving the concept version
uri
Object of class "character" giving the concept uri
urn
Object of class "character" giving the concept urn
isExternalReference
Object of class "logical" indicating if the concept is an external reference
coreRepresentation
Object of class "character" giving the core representation
coreRepresentationAgency
Object of class "character" giving the core representation agency
parent
Object of class "character" giving the concept parent
parentAgency
Object of class "character" giving the parentAgency
Name
Object of class "list" giving the concept name (by language) - required
Description
Object of class "list" giving the concept description (by language)
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)
Emmanuel Blondel, [email protected]
A basic class to handle SDMX Concepts
SDMXConcepts(xmlObj, namespaces)
SDMXConcepts(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXConcepts"
concepts
Object of class "list" giving the list of "SDMXConcept". This slot is available to ensure backward compatibility with SDMX 1.0 in SDMX 2.0 or 2.1 documents
conceptSchemes
Object of class "list" giving the list of "SDMXConceptScheme", which will encapsulate the list of "SDMXConcept" (defined from SDMX 2.0)
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Concept scheme
SDMXConceptScheme(xmlObj, namespaces)
SDMXConceptScheme(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXConceptScheme"
id
Object of class "character" giving the ID of the concept scheme (required)
agencyID
Object of class "character" giving the AgencyID
version
Object of class "character" giving the version
uri
Object of class "character" giving the concept uri
urn
Object of class "character" giving the concept urn
isExternalReference
Object of class "logical" indicating if the concept scheme is an external reference
isFinal
Object of class "logical" indicating if the concept scheme is final
validFrom
Object of class "character" indicating the start validity period
validTo
Object of class "character" indicating the end validity period
Name
Object of class "list" giving the concept scheme name (by language) - required
Description
Object of class "list" giving the concept scheme description (by language)
Concept
Object of class "list" giving the list of "SDMXConcept" objects (see SDMXConcept)
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML cross sectional data set
SDMXCrossSectionalData(xmlObj, namespaces)
SDMXCrossSectionalData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXCrossSectionalData"
Emmanuel Blondel, [email protected]
An abstract class from which SDMX Data classes are derived
SDMXData(xmlObj, namespaces)
SDMXData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXData"
dsdRef
Object of class "character" giving the DSD Reference
dsd
Object of class "SDMXDataStructureDefinition"
This class is not useful in itself, but all SDMX Data classes in this package derive from it.
@author Emmanuel Blondel, [email protected]
A basic class to handle a SDMX DataFlow
SDMXDataFlow(xmlObj, namespaces)
SDMXDataFlow(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXDataFlow"
id
Object of class "character" giving the ID (required)
agencyID
Object of class "character" giving the AgencyID
version
Object of class "character" giving the version
uri
Object of class "character" giving the uri
urn
Object of class "character" giving the urn
isExternalReference
Object of class "logical" indicating if the dataflow is an external reference
isFinal
Object of class "logical" indicating if the dataflow is final
validFrom
Object of class "character" indicating the start validity period
validTo
Object of class "character" indicating the end validity period
Name
Object of class "list" giving the dataflow (by available language) - required
Description
Object of class "list" giving the dataflow description (by available language)
dsdRef
Object of class "character" giving the reference datastructure Id
dsd
Object of class "SDMXDataStructureDefinition"
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX DataFlows
SDMXDataFlows(xmlObj, namespaces)
SDMXDataFlows(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXDataFlows"
dataflows
Object of class "list" giving the list of DataFlows (datasets), (see SDMXDataFlow)
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX DataStructure (or KeyFamily)
SDMXDataStructure(xmlObj, namespaces)
SDMXDataStructure(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXDataStructure"
id
Object of class "character" giving the ID (required)
agencyID
Object of class "character" giving the AgencyID
version
Object of class "character" giving the version
uri
Object of class "character" giving the uri
urn
Object of class "character" giving the urn
isExternalReference
Object of class "logical" indicating if the datastructure / keyfamily is an external reference
isFinal
Object of class "logical" indicating if the datastructure / keyfamily is final
validFrom
Object of class "character" indicating the start validity period
validTo
Object of class "character" indicating the end validity period
Name
Object of class "list" giving the codelist (by language) - required
Description
Object of class "list" giving the codelist description (by language)
Components
Object of class "SDMXComponents" (see SDMXComponents)
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX DataStructureDefinition (DSD)
SDMXDataStructureDefinition(xmlObj, namespaces)
SDMXDataStructureDefinition(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXDataStructureDefinition"
organisationSchemes
Object of class "SDMXOrganisationSchemes" giving the list of agencies (see SDMXAgencyScheme and SDMXAgency)
concepts
Object of class "SDMXConcepts" giving the list of concepts or conceptSchemes (see SDMXConcepts)
codelists
Object of class "SDMXCodelists" giving the list of codelists (see SDMXCodelists)
datastructures
Object of class "SDMXDataStructures" giving the list of datastructures /key families (see SDMXDataStructures)
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX DataStructures (or KeyFamilies)
SDMXDataStructures(xmlObj, namespaces)
SDMXDataStructures(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXDataStructures"
datastructures
Object of class "list" giving the list of DataStructures, (see SDMXDataStructure)
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)
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Dimension
SDMXDimension(xmlObj, namespaces)
SDMXDimension(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXDimension"
conceptRef
Object of class "character" giving the dimension conceptRef (required)
conceptVersion
Object of class "character" giving the dimension concept version
conceptAgency
Object of class "character" giving the dimension concept agency
conceptSchemeRef
Object of class "character" giving the dimension conceptScheme ref
conceptSchemeAgency
Object of class "character" giving the dimension conceptScheme agency
codelist
Object of class "character" giving the codelist ref name
codelistVersion
Object of class "character" giving the codelist ref version
codelistAgency
Object of class "character" giving the codelist ref agency
isMeasureDimension
Object of class "logical" indicating if the dimension is a measure dimension. Default value is FALSE
isFrequencyDimension
Object of class "logical" indicating if the dimension is a frequency dimension. Default value is FALSE
isEntityDimension
Object of class "logical" indicating if the dimension is an entity dimension. Default value is FALSE
isCountDimension
Object of class "logical" indicating if the dimension is a count dimension. Default value is FALSE
isNonObservationTimeDimension
Object of class "logical" indicating if the dimension is a non-observation dimension. Default value is FALSE
isIdentityDimension
Object of class "logical" indicating if the dimension is an identity dimension. Default value is FALSE
crossSectionalAttachDataset
Object of class "logical"
crossSectionalAttachGroup
Object of class "logical"
crossSectionalAttachSection
Object of class "logical"
crossSectionalAttachObservation
Object of class "logical"
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)
Emmanuel Blondel, [email protected]
A experimental class to handle a SDMX DotStat (*.Stat) service request builder
SDMXDotStatRequestBuilder(regUrl, repoUrl, accessKey = NULL, unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE, headers = list())
SDMXDotStatRequestBuilder(regUrl, repoUrl, accessKey = NULL, unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE, headers = list())
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 |
accessKey |
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key (token) has to be provided to perform requests |
unsupportedResources |
an object of class "list" giving eventual unsupported REST resources. Default is an empty list object |
skipProviderId |
an object of class "logical" indicating that the provider agencyId should be skipped. Used to control lack of strong SDMX REST compliance from data providers. For now, it applies only for the "data" resource. |
forceProviderId |
an object of class "logical" indicating if the provider
agencyId has to be added at the end of the request. Default value is
|
headers |
an object of class "list" that contains any additional headers for the request. |
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
accessKey
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests
compliant
an object of class "logical" indicating if the request builder is somehow compliant with a service specification
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Internal class
dataflow' resource (path="GetKeyFamily/resourceID") datastructure' resource (path="GetDataStructure/resourceID/agencyID") data' resource (path="GetData/flowRef/key/agencyId")
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML Generic data set
SDMXGenericData(xmlObj, namespaces)
SDMXGenericData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXGenericData"
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle the header of a SDMX-ML document
SDMXHeader(xmlObj, namespaces)
SDMXHeader(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXHeader"
ID
Object of class "character" giving the ID of the SDMX-ML document
Test
Object of class "logical" indicating if the SDMX-ML document is disseminated for test purpose
Truncated
Object of class "logical" indicating if the SDMX-ML document is truncated
Name
Object of class "character" giving the name of SDMX-ML document
Sender
Object of class "list" giving the id of the sender and eventually its in name, possibly in multi-languages
Receiver
Object of class "list" giving the id of the receiver and eventually its in name, possibly in multi-languages
Prepared
Object of class "POSIXlt" giving the preparation date of the SDMX-ML document
Extracted
Object of class "POSIXlt" giving the extraction date of the SDMX-ML document
ReportingBegin
Object of class "POSIXlt" giving the reporting begin date for the data retrieved in the SDMX-ML document
ReportingEnd
Object of class "POSIXlt" giving the reporting end date for the data retrieved in the SDMX-ML document
Source
Object of class "character" giving the source of the SDMX-ML document
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document
Some SDMXHeader properties are not yet supported and thus not available as "slots". These are "KeyFamilyRef", "KeyFamilyAgency", "DataSetAgency", "DataSetID", "DataSetAction".
Emmanuel Blondel, [email protected]
A basic abstract class to handle a SDMXItemScheme
This class is not useful in itself, but all SDMX non-abstract "scheme" classes should implement it. Added for the sake of complying with the SDMX information structure model
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML MessageGroup data set
SDMXMessageGroup(xmlObj, namespaces)
SDMXMessageGroup(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXMessageGroup"
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX Concept
SDMXOrganisation(xmlObj, namespaces)
SDMXOrganisation(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXOrganisation"
id
Object of class "character" giving the ID of the concept (required)
uri
Object of class "character" giving the concept uri
urn
Object of class "character" giving the concept urn
Name
Object of class "list" giving the organisation name (by language) - required
Description
Object of class "list" giving the organisation description (by language)
This class is not useful in itself, but other classes such as SDMXAgency will implement it.
Emmanuel Blondel, [email protected]
A basic abstract class to handle a SDMXOrganisationScheme
This class is implemented in both SDMX 2.0 and 2.1. In the latter, it is extended by other specific classes such as AgencyScheme, DataConsumerScheme, DataProviderScheme and OrganisationUnitScheme. rsdmx covers the support in SDMX 2.1
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX OrganisationSchemes
SDMXOrganisationSchemes(xmlObj, namespaces)
SDMXOrganisationSchemes(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "OrganisationSchemes"
organisationSchemes
Object of class "list" giving the list of SDMXAgencyScheme
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX PrimaryMeasure
SDMXPrimaryMeasure(xmlObj, namespaces)
SDMXPrimaryMeasure(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXPrimaryMeasure"
conceptRef
Object of class "character" giving the dimension conceptRef (required)
conceptVersion
Object of class "character" giving the dimension concept version
conceptAgency
Object of class "character" giving the dimension concept agency
conceptSchemeRef
Object of class "character" giving the dimension conceptScheme ref
conceptSchemeAgency
Object of class "character" giving the dimension conceptScheme agency
codelist
Object of class "character" giving the codelist ref name
codelistVersion
Object of class "character" giving the codelist ref version
codelistAgency
Object of class "character" giving the codelist ref agency
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX service request builder
SDMXRequestBuilder(regUrl, repoUrl, accessKey = NULL, formatter, handler, compliant, unsupportedResources = list(), headers = list())
SDMXRequestBuilder(regUrl, repoUrl, accessKey = NULL, formatter, handler, compliant, unsupportedResources = list(), headers = list())
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 |
accessKey |
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests |
formatter |
an object of class "list" giving a formatting function (for each resource) that takes an object of class "SDMXRequestParams" as single argument. Such parameter allows to customize eventual params (e.g. specific data provider rules) |
handler |
an object of class "list" 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 |
unsupportedResources |
an object of class "list" giving one or more resources not supported by the Request builder for a given provider |
headers |
an object of class "list" that contains any additional headers for the request. |
The handler
function will list the resource methods. Each method will accept a
single object of class SDMXRequestParams
as argument. This object will
give the different request params as slots (baseUrl, agencyId, resource, resourceId,
version, flowRef, key, start, end, compliant) to build the output (a string representing
the web request to build).
The rsdmx package will as much as possible try to handler generic handlers. At now, the available embedded builders are: SDMXREST20RequestBuilder (connector for SDMX 2.0 web-services), SDMXREST21RequestBuilder (connector for SDMX 2.1 web-services), SDMXDotStatRequestBuilder (connector for SDMX .Stat web-services implementations)
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
accessKey
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests
formatter
an object of class "list" giving a formatting function (for each resource) that takes an object of class "SDMXRequestParams" as single argument. Such parameter allows to customize eventual params (e.g. specific data provider rules)
handler
an object of class "list" 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
unsupportedResources
an object of class "character" giving one or more resources not supported by the Request builder for a given provider
headers
an object of class "list" that contains any additional headers for the request.
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)
Emmanuel Blondel, [email protected]
#default formatter myFormatter = list( dataflow = function(obj){ #format some obj slots here return(obj) }, datastructure = function(obj){ #format some obj slots here return(obj) }, data = function(obj){ #format some obj slots here return(obj) } ) #an handler #where each element of the list is a function taking as argument an object #of class "SDMXRequestParams" myHandler <- list( "dataflow" = function(obj){return(obj@regUrl)}, "datastructure" = function(obj){return(obj@regUrl)}, "data" = function(obj){return(obj@repoUrl)} ) #how to create a SDMXRequestBuilder requestBuilder <- SDMXRequestBuilder( regUrl = "http://www.myorg.org/registry", repoUrl = "http://www.myorg.org/repository", accessKey = NULL, formatter = myFormatter, handler = myHandler, compliant = FALSE)
#default formatter myFormatter = list( dataflow = function(obj){ #format some obj slots here return(obj) }, datastructure = function(obj){ #format some obj slots here return(obj) }, data = function(obj){ #format some obj slots here return(obj) } ) #an handler #where each element of the list is a function taking as argument an object #of class "SDMXRequestParams" myHandler <- list( "dataflow" = function(obj){return(obj@regUrl)}, "datastructure" = function(obj){return(obj@regUrl)}, "data" = function(obj){return(obj@repoUrl)} ) #how to create a SDMXRequestBuilder requestBuilder <- SDMXRequestBuilder( regUrl = "http://www.myorg.org/registry", repoUrl = "http://www.myorg.org/repository", accessKey = NULL, formatter = myFormatter, handler = myHandler, compliant = FALSE)
A class to handle a SDMX service request params
SDMXRequestParams(regUrl, repoUrl, accessKey, providerId, agencyId, resource, resourceId, version, flowRef, key, start, end, compliant)
SDMXRequestParams(regUrl, repoUrl, accessKey, providerId, agencyId, resource, resourceId, version, flowRef, key, start, end, compliant)
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 |
accessKey |
an oject of class "character" giving the eventual authentication or subscription user key (or token) to provide in order to perform the SDMX request. This key may be mandatory for some service providers. |
providerId |
an object of class "character" giving the provider agency id |
agencyId |
an object of class "character" giving an agency id |
resource |
an object of class "character" giving the type of resource to be queried |
resourceId |
an object of class "character" giving the resource to be queried |
version |
an object of class "character" giving the resource version |
flowRef |
an object of class "character" giving the flowRef to be queried |
key |
an object of class "character" giving the key (SDMX url formatted) to be used for the query |
start |
an object of class "character" giving the start time |
end |
an object of class "character" giving the end time |
compliant |
an object of class "logical" indicating if the web-service is compliant with the SDMX REST web-service specifications |
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
accessKey
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests
providerId
an object of class "character" giving the provider agency Id
agencyId
an object of class "character" giving an agency Id
resource
an object of class "character" giving the type of resource to be queried
resourceId
an object of class "character" giving the resource to be queried
version
an object of class "character" giving the resource version
flowRef
an object of class "character" giving the flowRef to be queried
key
an object of class "character" giving the key (SDMX url formatted) to be used for the query
start
an object of class "character" giving the start time
end
an object of class "character" giving the end time
compliant
an object of class "logical" indicating if the web-service is compliant with the SDMX REST web-service specifications
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
#how to create a SDMXRequestParams object params <- SDMXRequestParams( regUrl = "", repoUrl ="", accessKey = NULL, providerId = "", agencyId ="", resource = "data", resourceId = "", version = "", flowRef = "", key = NULL, start = NULL, end = NULL, compliant = FALSE )
#how to create a SDMXRequestParams object params <- SDMXRequestParams( regUrl = "", repoUrl ="", accessKey = NULL, providerId = "", agencyId ="", resource = "data", resourceId = "", version = "", flowRef = "", key = NULL, start = NULL, end = NULL, compliant = FALSE )
A experimental class to handle a SDMX 2.0 service request builder
SDMXREST20RequestBuilder(regUrl, repoUrl, accessKey = NULL, compliant, unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE, headers = list())
SDMXREST20RequestBuilder(regUrl, repoUrl, accessKey = NULL, compliant, unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE, headers = list())
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 |
accessKey |
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests |
compliant |
an object of class "logical" indicating if the web-service is compliant with the SDMX REST web-service specifications |
unsupportedResources |
an object of class "list" giving eventual unsupported REST resources. Default is an empty list object |
skipProviderId |
an object of class "logical" indicating that the provider agencyIdshould be skipped. Used to control lack of strong SDMX REST compliance from data providers. For now, it applies only for the "data" resource. |
forceProviderId |
an object of class "logical" indicating if the provider
agencyId has to be added at the end of the request. Default value is
|
headers |
an object of class "list" that contains any additional headers for the request. |
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
accessKey
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests
compliant
an object of class "logical" indicating if the web-service is compliant with the SDMX REST web-service specifications
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
#how to create a SDMXREST20RequestBuilder requestBuilder <- SDMXREST20RequestBuilder( regUrl = "http://www.myorg/registry", repoUrl = "http://www.myorg/repository", compliant = FALSE)
#how to create a SDMXREST20RequestBuilder requestBuilder <- SDMXREST20RequestBuilder( regUrl = "http://www.myorg/registry", repoUrl = "http://www.myorg/repository", compliant = FALSE)
A experimental class to handle a SDMX 2.1 service request builder
SDMXREST21RequestBuilder(regUrl, repoUrl, accessKey = NULL, compliant, unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE, headers = list())
SDMXREST21RequestBuilder(regUrl, repoUrl, accessKey = NULL, compliant, unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE, headers = list())
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 |
accessKey |
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests |
compliant |
an object of class "logical" indicating if the web-service is compliant with the SDMX REST web-service specifications |
unsupportedResources |
an object of class "list" giving eventual unsupported REST resources. Default is an empty list object |
skipProviderId |
an object of class "logical" indicating that the provider agencyIdshould be skipped. Used to control lack of strong SDMX REST compliance from data providers. For now, it applies only for the "data" resource. |
forceProviderId |
an object of class "logical" indicating if the provider
agencyId has to be added at the end of the request. Default value is
|
headers |
an object of class "list" that contains any additional headers for the request. |
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
accessKey
an object of class "character" indicating the name of request parameter for which an authentication or subscription user key/token has to be provided to perform requests
compliant
an object of class "logical" indicating if the web-service is compliant with the SDMX REST web-service specifications
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
#how to create a SDMXREST21RequestBuilder requestBuilder <- SDMXREST21RequestBuilder( regUrl = "http://www.myorg/registry", repoUrl = "http://www.myorg/repository", compliant = TRUE)
#how to create a SDMXREST21RequestBuilder requestBuilder <- SDMXREST21RequestBuilder( regUrl = "http://www.myorg/registry", repoUrl = "http://www.myorg/repository", compliant = TRUE)
A basic class to handle the version of the SDMX-ML Schema
SDMXSchema(xmlObj, namespaces)
SDMXSchema(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXSchema"
version
Object of class "character" giving the SDMX-ML schema version
this class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX service provider
SDMXServiceProvider(agencyId, name, scale, country, builder)
SDMXServiceProvider(agencyId, name, scale, country, builder)
agencyId |
an object of class "character" giving the a provider identifier |
name |
an object of class "character" giving the name of the provider |
scale |
an object of class "character" giving the scale of the datasource, either "international" or "national". Default value is "international". |
country |
an object of class "character" giving the ISO 3-alpha code of
the country (if scale is "national"). Default value is |
builder |
an object of class "SDMXRequestBuilder" that will performs the web request building for this specific provider |
an object of class "SDMXServiceProvider"
agencyId
an object of class "character" giving the a provider identifier
name
an object of class "character" giving the name of the provider
scale
an object of class "character" giving the scale of the datasource, either "international" or "national"
country
an object of class "character" giving the ISO 3-alpha code of the country (if scale is "national")
builder
an object of class "SDMXRequestBuilder" that will performs the web request building
Emmanuel Blondel, [email protected]
#let's create a SDMXRESTRequestBuilder #(assuming that "My Organization" implements SDMX REST web-services) myBuilder <- SDMXREST20RequestBuilder(regUrl = "http://www.myorg.org/registry", repoUrl = "http://www.myorg.org/repository", compliant = TRUE) #create a SDMXServiceProvider provider <- SDMXServiceProvider(agencyId = "MYORG", name = "My Organization", builder = myBuilder)
#let's create a SDMXRESTRequestBuilder #(assuming that "My Organization" implements SDMX REST web-services) myBuilder <- SDMXREST20RequestBuilder(regUrl = "http://www.myorg.org/registry", repoUrl = "http://www.myorg.org/repository", compliant = TRUE) #create a SDMXServiceProvider provider <- SDMXServiceProvider(agencyId = "MYORG", name = "My Organization", builder = myBuilder)
A class to wrap a list of SDMX service providers
SDMXServiceProviders(providers)
SDMXServiceProviders(providers)
providers |
an object of class "list" (of SDMXServiceProvider) configured by default and/or at runtime in rsdmx |
an object of class "SDMXServiceProviders"
providers
an object of class "list" (of SDMXServiceProvider) configured by default and/or at runtime in rsdmx
this class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML StructureSpecificData data set
SDMXStructureSpecificData(xmlObj, namespaces)
SDMXStructureSpecificData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXStructureSpecificData"
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML StructureSpecificTimeSeriesData data set
SDMXStructureSpecificTimeSeriesData(xmlObj, namespaces)
SDMXStructureSpecificTimeSeriesData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXStructureSpecificTimeSeriesData"
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
A basic class to handle the type of a SDMX-ML Structure document
SDMXStructureType(xmlObj, namespaces, resource)
SDMXStructureType(xmlObj, namespaces, resource)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
resource |
object of class "character" giving the REST resource to be queried (required to distinguish between dataflows and datastructures in SDMX 2.0) |
an object of class "SDMXStructureType"
This class is not useful in itself, but it will be used by readSDMX to deal with SDMX-ML Structure documents.
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX TimeDimension
SDMXTimeDimension(xmlObj, namespaces)
SDMXTimeDimension(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXTimeDimension"
conceptRef
Object of class "character" giving the dimension conceptRef (required)
conceptVersion
Object of class "character" giving the dimension concept version
conceptAgency
Object of class "character" giving the dimension concept agency
conceptSchemeRef
Object of class "character" giving the dimension conceptScheme ref
conceptSchemeAgency
Object of class "character" giving the dimension conceptScheme agency
codelist
Object of class "character" giving the codelist ref name
codelistVersion
Object of class "character" giving the codelist ref version
codelistAgency
Object of class "character" giving the codelist ref agency
crossSectionalAttachDataset
Object of class "logical"
crossSectionalAttachGroup
Object of class "logical"
crossSectionalAttachSection
Object of class "logical"
crossSectionalAttachObservation
Object of class "logical"
This class is not useful in itself, but non-abstract classes willencapsulate it as slot, when parsing an SDMX-ML document (Concepts, or DataStructureDefinition)
Emmanuel Blondel, [email protected]
A basic class to handle the type of a SDMX-ML document
SDMXType(xmlObj)
SDMXType(xmlObj)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
an object of class "SDMXType"
type
Object of class "character" giving the type of the SDMX-ML document
this class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
At now, the following types have been implemented and successfully tested:
- StructureType
,
- GenericDataType
,
- CompactDataType
,
- StructureSpecificDataType
,
- CrossSectionalDataType
,
- UtilityDataType
,
- MessageGroupType
Emmanuel Blondel, [email protected]
A basic class to handle a SDMX-ML UtilityData data set
SDMXUtilityData(xmlObj, namespaces)
SDMXUtilityData(xmlObj, namespaces)
xmlObj |
object of class "XMLInternalDocument derived from XML package |
namespaces |
object of class "data.frame" given the list of namespace URIs |
an object of class "SDMXUtilityData"
This class is not useful in itself, but all SDMX non-abstract classes will encapsulate it as slot, when parsing an SDMX-ML document.
Emmanuel Blondel, [email protected]
set the 'dsd' slot of a SDMXData
object
setDSD(obj, dsd) ## S4 method for signature 'SDMXData' setDSD(obj, dsd)
setDSD(obj, dsd) ## S4 method for signature 'SDMXData' setDSD(obj, dsd)
obj |
An object deriving from class "SDMXData" |
dsd |
An object of class "SDMXDataStructureDefinition" |
the 'obj' object of class "SDMXData" enriched with the dsd
setDSD(SDMXData)
: set the 'dsd' slot of a SDMXData
object
Emmanuel Blondel, [email protected]
function used internally by rsdmx, when loading the package, to set the list of SDMXServiceProvider known by rsdmx (hence known by readSDMX to query data/metadata in an easier way). For internal use only (this function does not provide any value for the end user, but it is here documented for transparency, and to explain how the package works.)
setSDMXServiceProviders()
setSDMXServiceProviders()
Emmanuel Blondel, [email protected]
getSDMXServiceProviders addSDMXServiceProvider findSDMXServiceProvider readSDMX
dataflow' resource (path="dataset/resourceId/def.sdmx.xml") datastructure' resource (path="dataset/resourceID.structure.sdmx.xml") data' resource (path="dataset/resourceID.generic.sdmx.xml") dataflow' resource (path="/") datastructure' resource (path="/resourceID) data' resource (path="getdata?dataflow=flowRef&key=key) dataflow' resource (path="/") datastructure' resource (path="/resourceID) data' resource (path="getdata?dataflow=flowRef&key=key)