redbox-mint / redbox

http://www.redboxresearchdata.com.au
GNU General Public License v2.0
5 stars 10 forks source link

Please add type property to RIF-CS licence element #48

Open grantj-re3 opened 11 years ago

grantj-re3 commented 11 years ago

I would like to recommend that RIF-CS rights/licence element be updated to include the "type" property as per http://www.ands.org.au/guides/cpguide/cpgrights.html#licence and http://www.ands.org.au/guides/cpguide/cpgrights.html#examples . Eg.

<licence type="CC-BY" ...>

Without the type property, RDA shows "Unknown" at the top of the licence section (in the right pane). With the type property set, RDA will show text or a logo representing the licence type.

It would be preferred if this change was applied to all workflows where licence can be selected (which I suspect currently is only the main dataset workflow).

Thank you.

dedickinson commented 11 years ago

Hi Grant,

I agree that we should look to get this into the default distro - I'd like to update our RIF once v1.5 is officially released.

Looking at a sample RIF segment: (taken from http://www.ands.org.au/guides/cpguide/cpgrights.html)

We do identify the licence URL so could provide that attribute and could deduce the type from the label or the URL.

I'll shy away from providing a fix here but it looks achievable based on what's there.

Cheers,

Duncan

grantj-re3 commented 9 years ago

Here is a hack (excerpt) for Creative Commons licence types in home/templates/rif.vm (Types are given at http://guides.ands.org.au/rda-cpg/rights#licence)

        ...
        ## Rights - Licence type
        #set ($licenceType = "Unknown")
        #if     ($licenceUri.matches('.*/creativecommons\.org/licenses/by/.*'))
            #set ($licenceType = "CC-BY")
        #elseif ($licenceUri.matches('.*/creativecommons\.org/licenses/by-sa/.*'))
            #set ($licenceType = "CC-BY-SA")
        #elseif ($licenceUri.matches('.*/creativecommons\.org/licenses/by-nc/.*'))
            #set ($licenceType = "CC-BY-NC")
        #elseif ($licenceUri.matches('.*/creativecommons\.org/licenses/by-nc-sa/.*'))
            #set ($licenceType = "CC-BY-NC-SA")
        #elseif ($licenceUri.matches('.*/creativecommons\.org/licenses/by-nd/.*'))
            #set ($licenceType = "CC-BY-ND")
        #elseif ($licenceUri.matches('.*/creativecommons\.org/licenses/by-nc-nd/.*'))
            #set ($licenceType = "CC-BY-NC-ND")
        #end
        #set ($licenceTypeStr = " type=${quote}${licenceType}${quote}")

        #if ("$!accessRights" != "" || "$!rights" != "" || "$!licence" != "")
            <rif:rights>
            #if ("$!rights" != "")
                <rif:rightsStatement${rightsUriStr}>$util.encodeXml($rights)</rif:rightsStatement>
            #end
            #if ("$!accessRights" != "")
                <rif:accessRights${accessRightsUriStr}>$util.encodeXml($accessRights)</rif:accessRights>
            #end
            #if ("$!licence" != "")
                <rif:licence${licenceTypeStr}${licenceUriStr}>$util.encodeXml($licence)</rif:licence>
            #end
            </rif:rights>
        #end
        ...
grantj-re3 commented 8 years ago

A similar principle applies to RIF-CS accessRights-type of Open, Conditional and Restricted (see http://guides.ands.org.au/rda-cpg/rights#accessRights)

Eg. If we specify a type such as that below, RDA will show an Open logo.

<accessRights type="Open" ...>

Below is a hack (excerpt) for Creative Commons licence types and accessRights types in home/templates/rif.vm which supersedes the above version (with a shorter regular-expression match and replace). [It is a hack because it would be better if types were defined much earlier in the submission forms.]

        ...
        ## Rights - Licence type
        #set ($licenceType = "Unknown")
        #if ($licenceUri.matches('.*/creativecommons\.org/licenses/(by|by-sa|by-nc|by-nc-sa|by-nd|by-nc-nd)/.*'))
            ## licences: CC-BY, CC-BY-SA, CC-BY-NC, CC-BY-NC-SA, CC-BY-ND, CC-BY-NC-ND
            #set ($licenceType = $licenceUri.replaceAll('.*/licenses/(by[^/]*)/.*', 'cc-$1').toUpperCase())
        #end
        #set ($licenceTypeStr = " type=${quote}${licenceType}${quote}")

        ## Rights - Access Rights type
        #set ($accessRightsTypeStr = "")
        #if ($licenceType.matches('^CC-BY.*'))
            #set ($accessRightsTypeStr = " type=${quote}open${quote}")
        #end

        #if ("$!accessRights" != "" || "$!rights" != "" || "$!licence" != "")
            <rif:rights>
            #if ("$!rights" != "")
                <rif:rightsStatement${rightsUriStr}>$util.encodeXml($rights)</rif:rightsStatement>
            #end
            #if ("$!accessRights" != "")
                <rif:accessRights${accessRightsTypeStr}${accessRightsUriStr}>$util.encodeXml($accessRights)</rif:accessRights>
            #end
            #if ("$!licence" != "")
                <rif:licence${licenceTypeStr}${licenceUriStr}>$util.encodeXml($licence)</rif:licence>
            #end
            </rif:rights>
        #end
        ...