7
7
# ' provider = NULL, providerId = NULL, providerKey = NULL,
8
8
# ' agencyId = NULL, resource = NULL, resourceId = NULL, version = NULL,
9
9
# ' flowRef = NULL, key = NULL, key.mode = "R", start = NULL, end = NULL, dsd = FALSE,
10
- # ' headers = list(), validate = FALSE,
10
+ # ' headers = list(), validate = FALSE, references = NULL,
11
11
# ' verbose = !is.null(logger), logger = "INFO", ...)
12
12
# '
13
13
# ' @param file path to SDMX-ML document that needs to be parsed
48
48
# ' Recognized if a valid provider or provide id has been specified as argument.
49
49
# ' @param end an object of class "integer" or "character" giving the SDMX end time to apply.
50
50
# ' Recognized if a valid provider or provide id has been specified as argument.
51
+ # ' @param references an object of class "character" giving the instructions to return (or not) the
52
+ # ' artefacts referenced by the artefact to be returned.
51
53
# ' @param dsd an Object of class "logical" if an attempt to inherit the DSD should be performed.
52
54
# ' Active only if \code{"readSDMX"} is used as helper method (ie if data is fetched using
53
55
# ' an embedded service provider. Default is FALSE
@@ -138,7 +140,7 @@ readSDMX <- function(file = NULL, isURL = TRUE, isRData = FALSE,
138
140
provider = NULL , providerId = NULL , providerKey = NULL ,
139
141
agencyId = NULL , resource = NULL , resourceId = NULL , version = NULL ,
140
142
flowRef = NULL , key = NULL , key.mode = " R" , start = NULL , end = NULL , dsd = FALSE ,
141
- headers = list (), validate = FALSE ,
143
+ headers = list (), validate = FALSE , references = NULL ,
142
144
verbose = ! is.null(logger ), logger = " INFO" , ... ) {
143
145
144
146
# logger
@@ -203,8 +205,10 @@ readSDMX <- function(file = NULL, isURL = TRUE, isRData = FALSE,
203
205
key = key ,
204
206
start = start ,
205
207
end = end ,
208
+ references = references ,
206
209
compliant = provider @ builder @ compliant
207
210
)
211
+
208
212
# formatting requestParams
209
213
requestFormatter <- provider @ builder @ formatter
210
214
requestParams <- switch (resource ,
@@ -451,8 +455,10 @@ readSDMX <- function(file = NULL, isURL = TRUE, isRData = FALSE,
451
455
452
456
if (resource == " data" ){
453
457
dsdObj <- readSDMX(providerId = providerId , providerKey = providerKey ,
454
- resource = " datastructure" , resourceId = dsdRef , headers = headers ,
455
- verbose = verbose , logger = logger , ... )
458
+ resource = " datastructure" , resourceId = dsdRef , headers = headers ,
459
+ verbose = verbose , references = references , logger = logger , ... )
460
+
461
+
456
462
if (is.null(dsdObj )){
457
463
log $ WARN(sprintf(" Impossible to fetch DSD for dataset '%s'" , flowRef ))
458
464
}else {
@@ -463,7 +469,7 @@ readSDMX <- function(file = NULL, isURL = TRUE, isRData = FALSE,
463
469
dsdObj <- lapply(1 : length(dsdRef ), function (x ){
464
470
flowDsd <- readSDMX(providerId = providerId , providerKey = providerKey ,
465
471
resource = " datastructure" , resourceId = dsdRef [[x ]], headers = headers ,
466
- verbose = verbose , logger = logger , ... )
472
+ verbose = verbose , references = references , logger = logger , ... )
467
473
if (is.null(flowDsd )){
468
474
log $ INFO(sprintf(" Impossible to fetch DSD for dataflow '%s'" ,resourceId ))
469
475
}else {
0 commit comments