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

DD-1333: fixed change license script #71

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jo-pol
Copy link
Contributor

@jo-pol jo-pol commented Dec 17, 2024

Fixes DD-1333: change license script

Description of changes

How to test

  • Base box dev_vocabs-2024-12-02.box

  • Go to

    ~/git/dans-core-systems/modules/dans-datastation-tools/src/datastation/open_access_archeodepot.py
    
  • Make sure to have your API key in .dans-datastation-tools.yml

  • Put the following csv files in data/test

    • datasets.csv

      DOI,RIGHTS_HOLDER
      10.5072/FK2/OS1ML5,Archeologisch Onderzoek Leiden BV

    • dag_raporten.csv

      Titel,EASY-ID,DOI,file1,file2,file3,file4,file5,file6,file7,file8,file9,file10,file11,file12,file13,file14,file15,file16,file17,file18,file19,file20,file21
      "A bag containing multiple audiences",easy-dataset:123,https://doi.org/10.5072/FK2/OS1ML5,random images/image01.png,random images/image03.jpeg,,,,,,,,,,,,,,,,,,

    • licenses.csv

      RIGHTS_HOLDER,LICENSE_NAME,URI,COMMENT
      "Archeologisch Onderzoek Leiden BV","CC-BY-SA 4.0","http://creativecommons.org/licenses/by-sa/4.0","Dagrapporten op Restricted Access"
      
  • Set files to restricted in https://dev.archaeology.datastations.nl/dataset.xhtml?persistentId=doi:10.5072/FK2/OS1ML5
    Disable access requests an put some value in Terms of Access for Restricted Files
    The actual DOI may be different but should equal the one in dag_raporten.csv

  • Execute

    poetry run open-access-archeodepot -d data/test/datasets.csv -r data/test/dag_rapporten.csv -l data/test/licenses.csv
    

    This creates a file archeodepot-datasets-.csv

  • access requests changed to enabled, Terms of Access for Restricted Files changed to 'not available' restricted files not in dag_raporten.csv are no longer restricted, files in dagraporten are restricted

  • repeat without the second line in dagraporten, no files are restricted, check box for access requests is empty, Terms of Access for Restricted Files is still 'not available,'

Related PRs

#23 did not work any more

Notify

@DANS-KNAW/core-systems

@jo-pol jo-pol changed the title fixed at least file restriction changes DD-1232: fixed at least file restriction changes Jan 6, 2025
@jo-pol jo-pol changed the title DD-1232: fixed at least file restriction changes DD-1333: fixed at least file restriction changes Jan 6, 2025
@qqmyers
Copy link

qqmyers commented Jan 14, 2025

I don't think the native edit metadata api can handle terms - only fields in metadata blocks - but I could be wrong. The Semantic API can handle terms - see https://guides.dataverse.org/en/latest/developers/dataset-semantic-metadata-api.html#add-dataset-metadata. The key thing to be aware of there (aside from the application/ld+lson content type) is that termsOfAccess is not a top-level field so you have to embed that object in it's parent - in general mirror the format in the OAI-ORE metadata export. For termsOfAccess, I think it's ```
{
https://dataverse.org/schema/core#fileTermsOfAccess":
{
"https://dataverse.org/schema/core#termsOfAccess": "Some terms"
}
}


@jo-pol
Copy link
Contributor Author

jo-pol commented Jan 14, 2025 via email

@jo-pol jo-pol marked this pull request as ready for review January 16, 2025 12:13
@jo-pol jo-pol requested a review from a team as a code owner January 16, 2025 12:13
@jo-pol jo-pol changed the title DD-1333: fixed at least file restriction changes DD-1333: fixed change license script Jan 16, 2025
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