Metadata from IPBES on Zenodo

Technical Guideline Series

Author

Rainer M Krug

Published

September 4, 2024

Doi
Abstract

To be added

GitHub Repository

Methods

Setup and get records from Zenodo

Show the code
#|

# Load the zen4R library
library(zen4R)
library(openalexR)
Thank you for using openalexR!
To acknowledge our work, please cite the package by calling `citation("openalexR")`.
To suppress this message, add `openalexR.message = suppressed` to your .Renviron file.
Show the code
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
Show the code
fn <- file.path("data", "ipbes_zenodo_records")
if (!file.exists(paste0(fn, ".rds"))) {
  # Authenticate with Zenodo
  zen <- ZenodoManager$new(token = Sys.getenv("Zenodo_IPBES_RO"))

  # Get the community ID
  community_id <- "ipbes"

  # Get the community info
  community <- zen$getCommunityById(community_id)

  # Get all deposits with ipbes somwhere
  ipbes_zenodo <- zen$getRecords(community_id)

  # Filter records based on the community ID
  ipbes <- sapply(
    ipbes_zenodo,
    function(record) {
      "ipbes" %in% unlist(record$metadata$communities)
    }
  )

  ipbes_zenodo <- ipbes_zenodo[ipbes]

  rm(ipbes)

  saveRDS(ipbes_zenodo, paste0(fn, ".rds"))
} else {
  ipbes_zenodo <- readRDS(paste0(fn, ".rds"))
}

Get the dois and titles of the records

Show the code
#|

dois <- data.frame()

for (i in seq(length.out = length(ipbes_zenodo))) {
  record <- ipbes_zenodo[[i]]
  dois <- rbind(
    dois,
    c(
      doi = record$metadata$doi,
      year = record$metadata$publication_date,
      title = record$metadata$title
    )
  )
}

names(dois) <- c("doi", "year", "title")

dois <- tibble::as_tibble(dois)
Show the code
fn <- file.path(".", "data", "ipbes_works.rds")
if (!file.exists(fn)) {
  # Define the maximum chunk size
  chunk_size <- 50
  # Split the vector into chunks
  doi_chunks <- split(
    dois$doi,
    ceiling(seq_along(dois$doi) / chunk_size)
  )

  ipbes_works <- lapply(
    doi_chunks,
    function(dois) {
      openalexR::oa_query(doi = dois) |>
        openalexR::oa_request(count_only = FALSE)
    }
  ) |>
    unlist(recursive = FALSE)

  saveRDS(ipbes_works, file = fn)
} else {
  ipbes_works <- readRDS(file = fn)
}

Results

Keywords

Number of keywords per Deposit

Show the code
#|

ipbes_zenodo |>
  sapply(
    FUN = function(x) {
      x$metadata$keywords |>
        unlist() |>
        length()
    }
  ) |>
  table() |>
  knitr::kable(
    col.names = c("Number of keywords", "n")
  )
Number of keywords n
0 129
1 61
2 44
3 77
4 21
5 10
6 13
7 8
8 1
9 1
10 1

The deposits without keywords

Show the code
#|

ipbes_zenodo |>
  lapply(
    FUN = function(x) {
      kws <- x$metadata$keywords |>
        unlist() |>
        paste0(collapse = " | ")
      result <- list(
        no_kws = x$metadata$keywords |>
          unlist() |>
          length(),
        title = paste0("<a href='", x$links$self_html, "' target='_blank'>", substr(x$title, 1, 60), "</a>"),
        keywords = kws
      )
      return(result)
    }
  ) |>
  dplyr::bind_rows() |>
  dplyr::arrange(no_kws, title) |>
  IPBES.R::table_dt()

Keywords used in the deposits

Show the code
#|

ipbes_zenodo |>
  sapply(
    FUN = function(x) {
      x$metadata$keywords |>
        unlist()
    }
  ) |>
  unlist() |>
  table() |>
  sort(decreasing = TRUE) |>
  knitr::kable(col.names = c("Keyword", "n"))
Keyword n
IPBES 178
Data management report 47
Assessment 36
data management policy 31
Values Assessment 30
Invasive alien species 27
Global Assessment 20
Supplementary material 19
Europe and Central Asia Assessment 18
Chapter 4 15
Summary for Policymakers 14
Table 13
Chapter 2 12
Figure 11
SPM 11
Full assessment report 9
Values 9
Chapter 8
Chapter 3 8
Chapter 6 7
Chapter 5 6
Regional assessment 6
Africa Assessment 5
Decision 4
Summary for policymakers 4
Biodiversity 3
Chapter 1 3
data and knowledge management policy 3
data management 3
Future 3
ILK 3
Land Degradation and Restoration Assessment 3
Pollination Assessment 3
Scenarios and Models Assessment 3
Valuation 3
Americas Assessment 2
Arabic 2
Asia and the Pacific Assessment 2
Capacities 2
Chinese 2
Data Management 2
Decision-making 2
Diverse 2
FAIR 2
French 2
Just 2
Methods 2
Operationalization 2
Russian 2
Spanish 2
stakeholder engagement 2
survey 2
Sustainable 2
active data management 1
Anthrome 1
Approaches 1
Archetypes 1
Biocultural conservation 1
Biome 1
Brightspot cases 1
CARE 1
CARE principles 1
Climate change 1
Climate Change 1
Conceptualization 1
Constitutions 1
COVID-19 1
Data and knowledge management policy 1
data backup 1
Data Management Policy 1
Data Management Report, Nature Futures Framework 1
Data Policy 1
Dataset 1
Decision making 1
Diverse values 1
DOI 1
Earth Stewardship 1
FAIR principles 1
Gap 1
global, species rarity, endemicity 1
Indicators 1
Indigenous Peoples and local communities 1
IPBES, Data Management Policy 1
IPBES, Senckenberg, Data Management, Policy, FAIR 1
IPBES, Values, Assessment, Figures, Chapter 1 1
IPBES, Values, SPM, Values 1
IPCC 1
IPCCC 1
Knowledge Management 1
long-term vision 1
Methodological 1
Methodological guidance 1
Methodologies 1
Model 1
Nature 1
Nature Futures Framework 1
open science 1
Option 1
Pandemics 1
Pathway 1
Plural Value Approach 1
Policy 1
Policy initiatives 1
Policy instruments 1
Pollination assessment 1
Scenario 1
scenarios, biodiversity, ecosystem services, nature’s contributions to people, nature futures, IPBES, visioning, narratives 1
Science-Policy 1
Stakeholder Survey 1
Transformative change 1
Transformative governance 1
VA 1
Values assessment 1
Zenodo 1

Licenses and Access

Licenses

Show the code
#|

ipbes_zenodo |>
  sapply(
    FUN = function(x) {
      l <- x$metadata$license
      if (is.null(l)) {
        l <- "NULL"
      }
      return(l)
    }
  ) |>
  unlist() |>
  table(useNA = "always") |>
  knitr::kable(
    col.names = c(
      "license",
      "n"
    )
  )
license n
cc-by-4.0 346
NULL 20
NA 0

The deposits without licenses are

Show the code
#|

ipbes_zenodo |>
  lapply(
    FUN = function(x) {
      if (is.null(x$metadata$license)) {
        result <- list(
          title = substr(x$title, 1, 60),
          link = paste0("<a href='", x$links$self_html, "' target='_blank'>", x$doi, "</a>")
        )
      } else {
        result <- NULL
      }
      return(result)
    }
  ) |>
  dplyr::bind_rows() |>
  dplyr::arrange(title) |>
  knitr::kable()
title link
2020 Stakeholder Survey of the Intergovernmental Platform on 10.5281/zenodo.4121916
DISCARD_IPBES Invasive Alien Species Assessment: Chapter 2. 10.5281/zenodo.10052573
Hotspots of endemism and rarity - Figure 2.2.3 IPBES Global 10.5281/zenodo.4957887
IPBES Core Indicators - Harmonized Dataset 10.5281/zenodo.4564763
IPBES Country Borders Package 10.5281/zenodo.5883633
IPBES IAS assessment, data management report for Chapter 2. 10.5281/zenodo.5746076
IPBES Invasive Alien Species Assessment: Chapter 1. Figures, 10.5281/zenodo.10622445
IPBES Invasive Alien Species Assessment: Chapter 1. Introduc 10.5281/zenodo.10677041
IPBES Invasive Alien Species Assessment: Chapter 2. Trends a 10.5281/zenodo.10677067
IPBES Invasive Alien Species Assessment: Chapter 3. Drivers 10.5281/zenodo.10677074
IPBES Invasive Alien Species Assessment: Chapter 3. Figures, 10.5281/zenodo.10627673
IPBES Invasive Alien Species Assessment: Chapter 4. Figures, 10.5281/zenodo.10633229
IPBES Invasive Alien Species Assessment: Chapter 4. Impacts 10.5281/zenodo.10677193
IPBES Invasive Alien Species Assessment: Chapter 5. Figures, 10.5281/zenodo.10633264
IPBES Invasive Alien Species Assessment: Chapter 5. Manageme 10.5281/zenodo.11437851
IPBES Invasive Alien Species Assessment: Chapter 6. Figures, 10.5281/zenodo.10633484
IPBES Invasive Alien Species Assessment: Chapter 6. Governan 10.5281/zenodo.10677227
IPBES Invasive Alien Species Assessment: Full report 10.5281/zenodo.11629357
IPBES Long-term Vision on Data and Knowledge Management 10.5281/zenodo.5513474
Interactive Dashboard of the 2020 Stakeholder Survey of the 10.5281/zenodo.5046948

Access Rights

Show the code
#|

ipbes_zenodo |>
  sapply(
    FUN = function(x) {
      x$metadata$access_right
    }
  ) |>
  table(useNA = "always") |>
  knitr::kable(
    col.names = c(
      "access right",
      "n"
    )
  )
access right n
embargoed 2
open 320
restricted 44
NA 0

The non-open deposits are:

Show the code
#|

ipbes_zenodo |>
  lapply(
    FUN = function(x) {
      if (x$metadata$access_right != "open") {
        result <- list(
          title = substr(x$title, 1, 60),
          access_right = x$metadata$access_right,
          link = paste0("<a href='", x$links$self_html, "' target='_blank'>", x$doi, "</a>")
        )
      } else {
        result <- NULL
      }
      return(result)
    }
  ) |>
  dplyr::bind_rows() |>
  dplyr::arrange(title) |>
  knitr::kable()
title access_right link
2020 Stakeholder Survey of the Intergovernmental Platform on restricted 10.5281/zenodo.4121916
DISCARD_IPBES Invasive Alien Species Assessment: Chapter 2. restricted 10.5281/zenodo.10052573
Hotspots of endemism and rarity - Figure 2.2.3 IPBES Global restricted 10.5281/zenodo.4957887
IPBES Core Indicators - Harmonized Dataset restricted 10.5281/zenodo.4564763
IPBES Country Borders Package restricted 10.5281/zenodo.5883633
IPBES IAS assessment, data management report for Chapter 2. restricted 10.5281/zenodo.5746076
IPBES Invasive Alien Species Assessment, data management rep embargoed 10.5281/zenodo.5766070
IPBES Invasive Alien Species Assessment, database for Chapte embargoed 10.5281/zenodo.5706617
IPBES Long-term Vision on Data and Knowledge Management restricted 10.5281/zenodo.5513474
IPBES TCA Chapter 1. Analysis of contributions on what trans restricted 10.5281/zenodo.12532308
IPBES TCA Chapter 1. Analysis of knowledge gaps / IPBES tran restricted 10.5281/zenodo.11657378
IPBES TCA Chapter 1. Creation of a case studies database / I restricted 10.5281/zenodo.10260234
IPBES TCA Chapter 1. Literature and data review regarding th restricted 10.5281/zenodo.10245400
IPBES TCA Chapter 1. Literature review determining the princ restricted 10.5281/zenodo.11657640
IPBES TCA Chapter 1. Literature review of case studies with restricted 10.5281/zenodo.10246745
IPBES TCA Chapter 2. Content analysis of most potentially tr restricted 10.5281/zenodo.10548648
IPBES TCA Chapter 2. Systematic literature review on visions restricted 10.5281/zenodo.10252320
IPBES TCA Chapter 3. Identification of on-going initiatives restricted 10.5281/zenodo.10250564
IPBES TCA Chapter 3. Review of knowledge on theories and fra restricted 10.5281/zenodo.10250534
IPBES TCA Chapter 3. Systematic review of literature on tran restricted 10.5281/zenodo.10523261
IPBES TCA Chapter 4. Review of literature on colonial modern restricted 10.5281/zenodo.10250610
IPBES TCA Chapter 4. Review of literature on institutional m restricted 10.5281/zenodo.10252251
IPBES TCA Chapter 4. Review of literature on limited access restricted 10.5281/zenodo.10251409
IPBES TCA Chapter 4. Review of literature on power imbalance restricted 10.5281/zenodo.10251326
IPBES TCA Chapter 4. Review of literature on unsustainable c restricted 10.5281/zenodo.10252305
IPBES TCA Chapter 5. Shifting power towards just and sustai restricted 10.5281/zenodo.10304954
IPBES TCA Chapter 5. Addressing unsustainable production and restricted 10.5281/zenodo.10262310
IPBES TCA Chapter 5. Biodiversity conservation assessment me restricted 10.5281/zenodo.10261652
IPBES TCA Chapter 5. Capacity building and technology transf restricted 10.5281/zenodo.10262495
IPBES TCA Chapter 5. Inventory options for transformative ch restricted 10.5281/zenodo.10264136
IPBES TCA Chapter 5. Review of options for achieving the 205 restricted 10.5281/zenodo.10262647
IPBES TCA Chapter 5. Views and Values / IPBES transformative restricted 10.5281/zenodo.10305489
IPBES TCA. Corpus of literature on transformative change / I restricted 10.5281/zenodo.10479548
IPBES nexus assessment - Chapter 2, data management report restricted 10.5281/zenodo.10119408
IPBES nexus assessment - Chapter 2, data management report restricted 10.5281/zenodo.10119473
IPBES nexus assessment - Chapter 2, data management report restricted 10.5281/zenodo.10119431
IPBES nexus assessment - Chapter 2, data management report restricted 10.5281/zenodo.10119511
IPBES nexus assessment - Chapter 3, data management report restricted 10.5281/zenodo.10119540
IPBES nexus assessment - Chapter 4, data management report restricted 10.5281/zenodo.10119750
IPBES nexus assessment - Chapter 4, data management report restricted 10.5281/zenodo.10119625
IPBES nexus assessment - Chapter 5.1 – BIODIVERSITY, data m restricted 10.5281/zenodo.10119872
IPBES nexus assessment - Chapter 5.2 – WATER, data manageme restricted 10.5281/zenodo.10119960
IPBES nexus assessment - Chapter 5.4 – HEALTH, data managem restricted 10.5281/zenodo.10119986
IPBES nexus assessment - Chapter 6, data management report restricted 10.5281/zenodo.10120033
IPBES nexus assessment - Chapter 2, data management report 1 restricted 10.5281/zenodo.10101030
Interactive Dashboard of the 2020 Stakeholder Survey of the restricted 10.5281/zenodo.5046948

IPBES Deposits Network

Show the code
fn <- file.path("data", "ipbes_network.rds")

if (!file.exists(fn)) {
  relations <- lapply(
    ipbes_zenodo,
    function(rec) {
      relation <- rec$metadata$related_identifiers
      if (is.null(relation)) {
        return(NULL)
      }
      result <- rec$metadata$related_identifiers |>
        dplyr::bind_rows() |>
        dplyr::mutate(
          year = rec$metadata$publication_date,
          doi = rec$metadata$doi,
          title = rec$metadata$title,
          keywords = rec$metadata$keywords |>
            unlist() |>
            paste(collapse = "; "),
        )
      return(result)
    }
  ) |>
    dplyr::bind_rows() |>
    dplyr::left_join(
      y = read.table("input/relation_direction.txt", header = TRUE),
      by = "relation"
    )

  nodes <- unique(
    c(
      relations$doi,
      relations$identifier
    )
  )

  edges <- rbind(
    relations |>
      filter(
        direction == "to"
      ) |>
      dplyr::select(
        from = doi,
        to = identifier
      ),
    relations |>
      filter(
        direction == "from"
      ) |>
      dplyr::select(
        from = doi,
        to = identifier
      )
  )

  network <- list(
    nodes = nodes,
    edges = edges
  )

  ipbes_network <- list(
    nodes = nodes,
    edges = edges,
    relations = relations
  )
  rm(nodes, edges, relations)

  saveRDS(ipbes_network, fn)
} else {
  ipbes_network <- readRDS(fn)
}
Show the code
keywords <- lapply(
  ipbes_zenodo,
  function(x) {
    result <- c(
      doi = x$doi,
      keywords = x$metadata$keywords |>
        unlist() |>
        paste(collapse = "` || `")
    )
    result["keywords"] <- paste0("`", result["keywords"], "`")
    return(result)
  }
) |>
  dplyr::bind_rows()
Show the code
fn <- file.path("figures", "ipbes_network.html")

## Simple forceNetwork
networkData <- data.frame(
  src = ipbes_network$edges$from,
  target = ipbes_network$edges$to,
  stringsAsFactors = FALSE
)

nodes <- data.frame(
  name = ipbes_network$nodes,
  # title = ipbes_network$nodes$,
  # doi = ipbes_network$nodes$doi,
  stringsAsFactors = FALSE
)

nodes$id <- 0:(nrow(nodes) - 1)

# create a data frame of the edges that uses id 0:9 instead of their names
edges <- networkData |>
  left_join(nodes, by = c("src" = "name")) |>
  select(-src) |>
  rename(source = id) |>
  left_join(nodes, by = c("target" = "name")) |>
  select(-target) |>
  rename(target = id) |>
  mutate(width = 1)


## this will be the URL which will be opened when clicked on the node
nodes$doi <- paste0("https://doi.org/", nodes$name)

# # make a grouping variable that will match to colours
x <- nodes |>
  dplyr::left_join(
    keywords,
    by = c("name" = "doi")
  )

nodes$group <- "Other"
nodes$group[grep("`Assessment`", x$keywords)] <- "Assessment"
nodes$group[grep("`Data management report`", x$keywords)] <- "Data Management Report"
nodes$group[grep("`SPM`", x$keywords)] <- "SPM"


# nodes$oa_id <- nodes$name
# nodes$name <- nodes$author

# control colours with a JS ordinal scale
ColourScale <- 'd3.scaleOrdinal()
                         .domain(["SPM",      "Assessment", "Data Management Report", "Other"])
                         .range(["#00ff26", "#FF6900",  "#0000FF",              "#694489"]);'


nwg <- networkD3::forceNetwork(
  Links = edges,
  Nodes = nodes,
  Source = "source",
  Target = "target",
  NodeID = "name",
  # Nodesize = "nodesize",
  Group = "group",
  # Value = "width",
  opacity = 0.9,
  zoom = TRUE,
  colourScale = DT::JS(ColourScale),
  fontSize = 20,
  legend = TRUE,
  clickAction = "window.open(d.doi)"
)

nwg$x$nodes$doi <- nodes$doi


networkD3::saveNetwork(
  nwg,
  file = fn,
  selfcontained = TRUE
)

unlink(
  gsub(
    fn,
    pattern = "\\.html",
    replacement = "_files"
  ),
  recursive = TRUE,
  force = TRUE
)


nwg

IPBES Deposits Network

Show the code
#|

ipbes_network$relations |>
  dplyr::select(
    doi,
    year,
    relation,
    identifier,
    direction,
    title,
    keywords
  ) |>
  IPBES.R::table_dt(
    fixedColumns = list(leftColumns = 3)
  )

IPBES deposits on Zenodo with OpenAlex ids

This is a quick and dirty table - it could made nicer - but it fulfills it’s purpose.

Show the code
ipbes_works |>
  openalexR::works2df() |>
  dplyr::select(
    # year = publication_year,
    # title,
    doi,
    oa_id = id
  ) |>
  dplyr::mutate(
    doi = gsub(pattern = "https://doi.org/", replacement = "", x = doi)
  ) |>
  dplyr::left_join(
    x = dois,
    by = c("doi" = "doi")
  ) |>
  dplyr::mutate(
    doi = paste0("<a href='https://doi.org/", doi, "' target='_blank'>", doi, "</a>"),
    oa_id = ifelse(
      is.na(oa_id),
      "",
      paste0("<a href='", oa_id, "' target='_blank'>", gsub(pattern = "https://openalex.org/", replacement = "", oa_id), "</a>")
    )
  ) |>
  select(
    doi,
    oa_id,
    year,
    title
  ) |>
  IPBES.R::table_dt()

Suggested hierarchy of keywords

I suggest the following mandatory keyword scheme. Follow the chart from left to write until you reach your type of deposit. All in bold in that path need to be specified (e.g. Chapter as well as Chapter 3 when the deposit).

Additional keywords can be added.

Q: Should we start all mandatory standardised keywords with e.g. _ to make them identifyable from the additional keywords?

IPBES Assessment  XYZthree letter assesment abbreviation SPM  Language Document Figure  Figure x.y Data Management Report Data Technical Document Table  Table x.y Data Management Report Data Technical Document Data Management Report Data Technical Document Chapter  Chapter x Document Figure  Figure x.y Data Management Report Data Technical Document Table  Table x.y Data Management Report Data Technical Document Data Management Report Data Technical Document Glossary Bibliography Decision 

Suggested hierarchy of keywords

Reuse

Citation

BibTeX citation:
@report{m_krug2024,
  author = {M Krug, Rainer},
  title = {Metadata from {IPBES} on {Zenodo}},
  date = {2024-09-04},
  url = {https://ipbes-data.github.io/IPBES_tsu_zenodo},
  doi = {10.5281/zenodo.10037104},
  langid = {en},
  abstract = {To be added}
}
For attribution, please cite this work as:
M Krug, Rainer. 2024. “Metadata from IPBES on Zenodo.” IPBES Technical Reports Series. https://doi.org/10.5281/zenodo.10037104.