Support alternative data licenses#398
Conversation
jonathanthiry
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 "" |
There was a problem hiding this comment.
| val license = if (!dest.obj.references.licence.isEmpty) dest.obj.references.licence.get.name else "" | |
| val license = dest.obj.references.licence.fold("")(_.name) |
| 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 | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Sounds good. Looking into that as well as making the licenceToAccept and licencesToAccept functions a bit clearer.
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.