This repository was archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
prepare spreadsheet for manual validation of license URLs indexed in … #236
Open
njahn82
wants to merge
2
commits into
master
Choose a base branch
from
license_val
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| --- | ||
| title: "Identifying open content licenses in Crossref" | ||
| description: "Background and Methodology" | ||
| author: "Najko Jahn" | ||
| date: "`r Sys.Date()`" | ||
| opengraph: | ||
| twitter: | ||
| card: summary | ||
| creator: "@najkoja" | ||
| pkgdown: | ||
| as_is: true | ||
| output: | ||
| bookdown::html_document2: | ||
| number_sections: false | ||
| df_print: paged | ||
| toc: yes | ||
| --- | ||
|
|
||
| ```{r setup, echo = FALSE, message=FALSE} | ||
| knitr::opts_chunk$set( | ||
| warning = FALSE, | ||
| message = FALSE, | ||
| echo = TRUE | ||
| ) | ||
| library(hoad) | ||
| library(ggplot2) | ||
| library(dplyr) | ||
| library(jsonlite) | ||
| library(tidyr) | ||
| ``` | ||
|
|
||
| For each journal tagged as hybrid in the Open APC dataset, we retrieved all license URLs found in Crossref. After that, we identified open content licenses using string matching. In order to validate this approach, we will create a spreadsheet with all license URLs and how they are classified using our current method. | ||
|
|
||
| The license URLs are stored in `jn_facets_df.json`, in the list-column license_refs. | ||
|
|
||
| ```{r} | ||
| license_df <- jsonlite::stream_in(file(hoad::path_extdat("jn_facets_df.json")), verbose = FALSE) | ||
| ``` | ||
|
|
||
| Aggregate license URLs per publisher | ||
|
|
||
| ```{r} | ||
| license_ind <- license_df %>% | ||
| select(license_refs, publisher) %>% | ||
| tidyr::unnest(license_refs) %>% | ||
| group_by(license_ref = .id, publisher) %>% | ||
| summarise(n_cases = sum(V1)) | ||
| ``` | ||
|
|
||
| Which licenses would be tagged as open content licenses using our current approach? | ||
|
|
||
| ```{r} | ||
| # current license patterns | ||
| hoad::license_patterns | ||
| ``` | ||
|
|
||
| We normalize licenses URLs directing to `http` and tag the hybrid ones. | ||
|
|
||
| ```{r} | ||
| license_hybrid <- license_ind %>% | ||
| ungroup %>% | ||
| mutate(license_ref = gsub("s://", "://", license_ref), | ||
| hybrid_license = ifelse(grepl( | ||
| paste(hoad::license_patterns$url, collapse = "|"), | ||
| license_ref | ||
| ), TRUE, FALSE)) | ||
| ``` | ||
|
|
||
| Furthermore, Creative Commons URLs were normalized using the following approach. | ||
|
|
||
| ```{r} | ||
| license_cc <- license_hybrid %>% | ||
| mutate(cc_type = license_ref) %>% | ||
| mutate(cc_type = gsub("http://creativecommons.org/licenses/", "cc-", cc_type)) %>% | ||
| mutate(cc_type = gsub("/3.0*", "", cc_type)) %>% | ||
| mutate(cc_type = gsub("/4.0", "", cc_type)) %>% | ||
| mutate(cc_type = gsub("/2.0*", "", cc_type)) %>% | ||
| mutate(cc_type = gsub("/uk/legalcode", "", cc_type)) %>% | ||
| mutate(cc_type = gsub("/igo", "", cc_type)) %>% | ||
| mutate(cc_type = gsub("/legalcode", "", cc_type)) %>% | ||
| mutate(cc_type = toupper(cc_type)) %>% | ||
| mutate(cc_type = gsub("CC-BY-NCND", "CC-BY-NC-ND", cc_type)) %>% | ||
| mutate(cc_type = tolower(cc_type)) %>% | ||
| mutate(cc_type = ifelse(grepl("*cc-", cc_type), cc_type, NA)) | ||
| ``` | ||
|
|
||
| ```{r} | ||
| license_val <- license_cc %>% | ||
| group_by(license_ref, publisher, hybrid_license, cc_type) %>% | ||
| summarise(n_cases = sum(n_cases)) %>% | ||
| arrange(desc(n_cases)) | ||
|
|
||
| license_val | ||
| ``` | ||
|
|
||
| Let's export the table for manual validation: | ||
|
|
||
| ```{r} | ||
| writexl::write_xlsx(license_val, "../inst/extdata/license_val.xlsx") | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.