Skip to content

Support alternative data licenses#398

Open
jonathanlindahl wants to merge 5 commits into
masterfrom
jonathanl/license-flow
Open

Support alternative data licenses#398
jonathanlindahl wants to merge 5 commits into
masterfrom
jonathanl/license-flow

Conversation

@jonathanlindahl
Copy link
Copy Markdown

Requires https://github.com/ICOS-Carbon-Portal/meta/pull/329/files

This adds ccbync4 license and excludes the license pdf from the zip file when downloading data, unless at least some data uses the ccby4 license. The table of contents file has also been updated to include a license column.

Copy link
Copy Markdown
Contributor

@jonathanthiry jonathanthiry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice progress! It would be nice to see if we can improve a few things, but good to see that it is working.

object DownloadService:

val publicDomainLicences = Set(CcMetaVocab.cc0)
val publicDomainLicences = Set(CcMetaVocab.cc0, CcMetaVocab.ccbync4)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to only show the license acceptance screen for the CC BY 4.0 license right now. It can be that we need to a check for the NC license, but that would require us to change the acceptance page.

s"$hdlProxy$pid"
}
s"$presense,${dest.fileName},${pidOpt.getOrElse("")},$landingPage,$omissionReason\n"
val license = if (!dest.obj.references.licence.isEmpty) dest.obj.references.licence.get.name else ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val license = if (!dest.obj.references.licence.isEmpty) dest.obj.references.licence.get.name else ""
val license = dest.obj.references.licence.fold("")(_.name)

Comment on lines +134 to +144
val shouldIncludeLincensePdf = dests.exists(
_.obj.references.licence.exists(
_.toString().contains("creativecommons.org/licenses/by/4.0")
)
)

if (shouldIncludeLincensePdf) {
baseSource.concat(Source.single(ZipEntry("!LICENCE.pdf") -> licenceSource))
} else {
baseSource
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to find a better way to write this, in particular to remove the string comparison. Maybe we could map over the dests and do something similar to what is being done in checkLicenceAcceptance by only adding the pdf when the license matches one in mainLicenses.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Looking into that as well as making the licenceToAccept and licencesToAccept functions a bit clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants