Introduction

OpenAIRE has collected and interlinked scholarly data from various openly available sources for over ten years. In December 2019, this European open science network released the OpenAIRE Research Graph Dump [1], a big scholarly dataset that comprises metadata about more than 100 million research publications and 18 million research datasets, as well as the relationships between them. These metadata are furthermore connected to open access locations and disambiguated information about persons, organisations and funders.

Like most big scholarly data dumps, the OpenAIRE Research Graph offers many opportunities for data analysis, but working with it can be challenging for data science practitioners [2]. One reason is the size of the data release. Although already split into several files, most of these data files are too large to fit into the memory of a moderately equipped personal computer when directly imported into statistical computing environments. Another challenge is the format. Statistical methods require tidy data, i.e. datasets with a rectangular structure made up of unambiguous columns and rows [3]. The dump, however, consists of compressed XML-files following the comprehensive OpenAIRE data model [4], from which only certain elements may be needed for a specific data analysis.

In this paper, we will introduce the R package openairegraph that helps to transform the large OpenAIRE Research Graph Dump into relevant small datasets for analytical purposes. It aims at data science practitioners and researchers alike who wish to conduct their own statistical analysis using the OpenAIRE Research Graph, but are wary of handling its large data dumps. Our implementation does not only consist of tools that allow to explore and parse specific information from the OpenAIRE Research Graph Dump. The R package structure also provides a standard way to ensure the computational reproducibility of these tools. To demonstrate the usefulness of our implementation, we will benchmark compliance with the open access mandate in the European HORIZON 2020 funding programme.

Background

R packages are an open and standardized way to write, document, test, and share R code. They are not limited to statistical methods, but can be also used to access, or even disseminate various types of data [5]. An increasing proportion of research articles from various fields cite or report about R packages [6].

R packages meet generic principles for computational reproducibility: coherent file organisation, separation of data, method and results, and specification of the computational environment [7]. For data science practitioners, R packages, thus, provide a reliable way to re-use code from others. In the field of scholarly data, the rOpenSci initiative provides interfaces to many sources. Before becoming part of the rOpenSci suite, packages are openly reviewed against comprehensive criteria [8].

Implementation

The R package openairegraph, which is available on GitHub as a development version1, has two sets of functions. The first set provides helpers to split the dump release into separate, de-coded XML records that can be stored individually. The other set consists of parsers that convert data from these XML files to a table-like data representation following the tidyverse philosophy, a popular approach to practise data science with tidy data [9]. Splitting, de-coding and parsing are essential steps before analysing the OpenAIRE Research Graph.

The function openairegraph::oarg_decode() splits and de-codes each record. Storing the records individually will allow to process the files 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.

So far, there are four parsers available:

  • openairegraph::oarg_publications_md() retrieves basic publication metadata complemented by author details and access status
  • openairegraph::oarg_linked_projects() parses grants linked to publications
  • openairegraph::oarg_linked_ftxt() gives full-text links including access information
  • openairegraph::oarg_linked_affiliations() parses affiliation data

These parsers can be used alone, or together like this:

First, we obtained the locations of the de-coded XML records. After that, we read each XML file using the xml2 [10] package, and applied three parsers. We used the future [11] and future.apply [12] packages to enable reading and parsing these records simultaneously with multiple R sessions. Running code in parallel reduces the execution time. Finally, we put together the individually created datasets into one dataset.

Documentation is an essential part of the R package workflow. For each parser, we described the usage, as well as the returned output. The latter is represented as data coding tables with an description of each variables, making it more convenient to grasp the otherwise complex structure of the OpenAIRE Research Graph. While executable examples are provided for each function, an introductory vignette, an executable long-form documentation written in R Markdown[13], demonstrates a workflow using the package. All documentation is automatically rendered to an R manual, and to a package website2 created with pkgdown [14].

While writing the package, we collected exemplary OpenAIRE Research Graph records and tested our parser against these files. The package provides testthat [15] unit testing for these cases to make sure that the parsers work as expected. Along with the general automated checking routines for a R package build, these tests will be executed on a continuous integration services after every code updates. The package is available via GitHub, and can be installed from it. Following good practices for research software citation and preservation, releases are archived via Zenodo, which issues DOIs for persistent identification. Altogether, this release workflow enables that the package is “both archived for reproducibility and actively maintained for reusability” [16].

Use-Case

A main purpose of the OpenAIRE Research Graph, which links grants to publications and open access full-texts, is monitoring the efficacy of the open access mandates. Here, we will demonstrate how to benchmark the compliance with the open access mandate of the European Commission’s HORIZON 2020 funding programme (H2020) against related funding activities using our implementation. We will focus on projects affiliated with the University of Göttingen. In doing so, we want to take into account that open access mandates generally lead to above-average open access uptake levels. Yet, they can vary by discipline and funding activity [17].

As a start, we imported and transformed the whole h2020_results.gz dump file following the above-described methods. The resulting dataset comprises 84,781 literature publications from 9,008 H2020 projects. After that, we identified H2020 projects with participation from the University of Göttingen using data from CORDIS, the European Commission’s research information portal. We calculated the open access share per project affiliated with the university, and compared them by H2020 funding stream, e.g. European Research Council (ERC) grants or Marie Skłodowska-Curie actions (MCSA).

Open Access Compliance Rates of Horizon 2020 projects affiliated with the University of Göttingen (purple dots) relative to the overall performance of the corresponding funding activities, visualised as a box plot. Only projects with at least five publications were considered. Data: OpenAIRE Research Graph[@manghi_paolo_2019_3516918]

Figure 1: Open Access Compliance Rates of Horizon 2020 projects affiliated with the University of Göttingen (purple dots) relative to the overall performance of the corresponding funding activities, visualised as a box plot. Only projects with at least five publications were considered. Data: OpenAIRE Research Graph[1]

Figure 1 shows that some H2020-projects with University of Göttingen participation have an uptake of open access to grant-supported publications that is above the average in the peer group. At the same time, others perform below expectation. Together, this provides valuable insights into open access compliance at the institutional level, especially for research administrators who would like to consider differences by research field and grant type while assessing publication practises.

Discussion and Conclusion

In summary, we have presented the R package openairegraph, and described how it helps data science practitioners working primarily in R to access and analyse the OpenAIRE Research Graph Dump. R packages, which follow a standardized structure including documentation and testing, are a well-established way to share code. Wrapping helpers into a R package, allows data science practitioners to explore big scholarly data dumps while shielding them from its complexity. As our use case has demonstrated, this approach provides a reliable way to investigate large variations in scholarly communication in a reproducible manner.

Not all data science practitioners use R. We encourage others to develop helpers for analysing big scholarly data dumps in other programming languages as well. Their implementation can draw from the standardized way how R packaging documents, tests and shares code for statistical analyses. Implementing such tools for statistical computing environments can greatly improve re-use of big scholarly data dumps in quantitative science studies and data-driven decision-making.

References

1. Manghi, P. et al.: OpenAIRE Research Graph Dump, (2019). https://doi.org/10.5281/zenodo.3516918.

2. Xia, F. et al.: Big scholarly data: A survey. IEEE Transactions on Big Data. 3, 18–35 (2017). https://doi.org/10.1109/tbdata.2016.2641460.

3. Wickham, H.: Tidy data. Journal of Statistical Software. 59, (2014). https://doi.org/10.18637/jss.v059.i10.

4. Manghi, P. et al.: The OpenAIRE Research Graph Data Model, (2019). https://doi.org/10.5281/zenodo.2643199.

5. Wickham, H.: R packages. O’Reilly Media (2015).

6. Tippmann, S.: Programming tools: Adventures with r. Nature. 517, 109–110 (2014). https://doi.org/10.1038/517109a.

7. Marwick, B. et al.: Packaging data analytical work reproducibly using r (and friends). The American Statistician. 72, 80–88 (2018). https://doi.org/10.1080/00031305.2017.1375986.

8. rOpenSci et al.: Ropensci/dev_guide: Fourth release. Zenodo (2020). https://doi.org/10.5281/zenodo.3749013.

9. Wickham, H. et al.: Welcome to the tidyverse. Journal of Open Source Software. 4, 1686 (2019). https://doi.org/10.21105/joss.01686.

10. Wickham, H. et al.: Xml2: Parse xml. (2019).

11. Bengtsson, H.: Future: Unified parallel and distributed processing in r for everyone. (2020).

12. Bengtsson, H.: Future.apply: Apply function to elements in parallel using futures. (2020).

13. Xie, Y. et al.: R Markdown: The definitive guide. Chapman; Hall/CRC, Boca Raton, Florida (2018).

14. Wickham, H., Hesselberth, J.: Pkgdown: Make static html documentation for a package. (2019).

15. Wickham, H.: Testthat: Get started with testing. The R Journal. 3, 5–10 (2011).

16. Hasselbring, W. et al.: FAIR and open computer science research software, http://arxiv.org/abs/1908.05986, (2019).

17. Larivière, V., Sugimoto, C.R.: Do authors comply when funders enforce open access to research? Nature. 562, 483–486 (2018). https://doi.org/10.1038/d41586-018-07101-w.