Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CC0 1.0 license #431

Closed
fkohrt opened this issue Dec 17, 2021 · 5 comments · Fixed by #472
Closed

Support CC0 1.0 license #431

fkohrt opened this issue Dec 17, 2021 · 5 comments · Fixed by #472
Labels
feature request 🗻 a feature request or enhancement

Comments

@fkohrt
Copy link

fkohrt commented Dec 17, 2021

It would be nice if the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication would be supported as well for the creative_commons metadata key.

@cderv
Copy link
Collaborator

cderv commented Dec 17, 2021

Currently only the licenses available at https://creativecommons.org/licenses/?lang=en are supported

distill/R/metadata.R

Lines 137 to 145 in dcfab66

if (!is.null(metadata$creative_commons)) {
# validate
valid_licenses <- c("CC BY", "CC BY-SA", "CC BY-ND", "CC BY-NC",
"CC BY-NC-SA", "CC BY-NC-ND")
if (!metadata$creative_commons %in% valid_licenses) {
stop("creative_commonds license must be one of ",
paste(valid_licenses, collapse = ", "))
}

For the one you suggest, the URL is different so we would need a special handling

https://github.com/rstudio/distill/blob/dcfab6615ddf2786ef56478cc04434a33c878d7f/R/metadata.R#L858-866

Is there a list of other licenses like CC0 we may need to add ?

I believe CC0 is a special case right ?
https://creativecommons.org/share-your-work/public-domain/cc0

Is there any other you know off ?

@cderv cderv added the feature request 🗻 a feature request or enhancement label Dec 17, 2021
@fkohrt
Copy link
Author

fkohrt commented Dec 17, 2021

Is there a list of other licenses like CC0 we may need to add ?

The CC 4.0 licenses and the CC0 1.0 are the ones available via Creative Commons' License Chooser, so that should already cover most cases. CC also offers the Public Domain Mark, but that is designed for indicating that something is already in the public domain, rather than for putting it into it.

Among other licenses the GNU Free Documentation License could be considered. I am not so sure about software licenses (GPLv3, AGPLv3, LGPLv3, MPL 2.0, MIT, Apache 2.0), R Markdown documents are software to some extent. But they would require a different key than creative_commons anyways. If you decide to add any, identifying them by their SPDX License Identifiers would be nice, because they exist in multiple versions. The same is true for CC licenses, their license version matters and identification via SPDX identifiers would be nice.

Also note that the canonical URIs for CC licenses linked via rel start with http://, not https://.

More info on canonical URIs

All CC licenses have a canonical URI that starts with http://. It is used when describing the license status of works in a machine readable way and the scheme is part of it. This can be verified when looking at the RDF index of CC licenses that contains all canonical URIs. See creativecommons/cc-legal-tools-app#361 and cc-archive/cc.licenserdf#7 for the relevant discussion at CC.

This is the same for the GNU licenses, which also have the http scheme as part of their canonical URI, see gpl-3.0.rdf.

Source: h5p/h5p-editor-php-library#124 (comment)

I believe CC0 is a special case right ?

URI-wise, yes. Note that the canonical URI is http://creativecommons.org/publicdomain/zero/1.0/ (not https://creativecommons.org/share-your-work/public-domain/cc0).

For CC 4.0 and CC0 1.0 licenses I have written a utility function, maybe it is of some use to you: https://gitlab.com/fkohrt/bachelorarbeit-code/-/blob/1fe83030/R/functions.R#L57-138

@cderv
Copy link
Collaborator

cderv commented Dec 17, 2021

The CC 4.0 licenses and the CC0 1.0 are the ones available via Creative Commons' License Chooser, so that should already cover most cases.

So let's add the CC0. Do you want to make a PR for this tweaking the two places I shared above ? Otherwise I'll do it next time I work on distill
I don't know if we need to switch the helper completely. Seems like adding a special handling for creative_commons: CC0 will be enough.

Regarding other licenses, we could bring support if needed but that would be another feature as not the same YAML key.

@fkohrt
Copy link
Author

fkohrt commented Dec 17, 2021

The text displayed in the appendix would need to change as well, as CC0 does not require attribution:

distill/R/appendices.R

Lines 89 to 98 in dcfab66

reuse_note <- sprintf(
paste0(
'Text and figures are licensed under Creative Commons Attribution ',
'<a rel="license" href="%s">%s 4.0</a>. %sThe figures that have been reused from ',
'other sources don\'t fall under this license and can be ',
'recognized by a note in their caption: "Figure from ...".'
),
htmlEscape(metadata$license_url, TRUE),
htmlEscape(metadata$creative_commons),
source_note

So let's add the CC0. Do you want to make a PR for this tweaking the two places I shared above ? Otherwise I'll do it next time I work on distill

I don't have the capacities right now, so feel free to tackle this. Still, if find time, I will write a short note here.

@cderv
Copy link
Collaborator

cderv commented Sep 6, 2022

dev version now has support for CC0

remotes::install_github("rstudio/distill")

Thanks for the suggestion !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 🗻 a feature request or enhancement
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants