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

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

Open
grantj-re3 opened this issue Sep 20, 2013 · 3 comments
Open

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

grantj-re3 opened this issue Sep 20, 2013 · 3 comments

Comments

@grantj-re3
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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
        ...

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

No branches or pull requests

2 participants