oarg_decode: Decode and store records from OpenAIRE Research Graph files

Description Usage Arguments Details Value Examples

View source: R/oarg_decode.R

Description

OpenAIRE Research Graph files are json-files that contain a record identifier and a BASE64 encoded text string representing the metadata. This function decodes these strings and saves them locally.

Usage

1
oarg_decode(oaire = NULL, limit = NULL, records_path = NULL, verbose = TRUE)

Arguments

oaire

compressed json file

limit

number of records to be decoded

records_path

directory for the xml files

verbose

print some information on what is going on

Details

De-coding and storing the records individually from an OpenAIRE Research Graph dump allows to process the records independent from each other, which is a common approach when working with big data.

Because the dumps are quite large, the function furthermore has a parameter that allows setting a limit, which is helpful for inspecting the output first.

By default, a progress bar presents the current state of the process.

Value

Exports de-compressed XML-formatted record, storing them locally as zip files. The file name represents the record identifier.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(jsonlite)
dump_file <- system.file("extdata", "", package = "openairegraph")
# a dump file is in json format
loaded_dump <- jsonlite::stream_in(file("dump_file"))
# writes out each XML-formatted record as a zip file to a specified folder
oaire_decode(loaded_dump, limit = 10, records_path = "data/")

## End(Not run)

njahn82/openairegraph documentation built on Aug. 26, 2020, 5:43 p.m.