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

Possible Bug with reading from json - description not found and date format of created #91

Open
rkrug opened this issue Dec 5, 2023 · 5 comments

Comments

@rkrug
Copy link

rkrug commented Dec 5, 2023

Sorry - but I found another possible bug:

in this case, description is not found, and created is apparently not in the correct format.
It must be another interaction, as this error does not come in #90

Cheers,

Rainer

library(deposits)

sessionInfo()
#> R version 4.3.2 (2023-10-31)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> Running under: macOS Sonoma 14.1.2
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: Europe/Berlin
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] deposits_0.2.1.046
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.33     styler_1.10.2     R6_2.5.1          fastmap_1.1.1    
#>  [5] xfun_0.41         magrittr_2.0.3    glue_1.6.2        R.utils_2.12.3   
#>  [9] knitr_1.45        htmltools_0.5.7   rmarkdown_2.25    lifecycle_1.0.4  
#> [13] cli_3.6.1         R.methodsS3_1.8.2 vctrs_0.6.5       reprex_2.0.2     
#> [17] withr_2.5.2       compiler_4.3.2    rprojroot_2.0.4   here_1.0.1       
#> [21] R.oo_1.25.0       R.cache_0.16.0    purrr_1.0.2       tools_4.3.2      
#> [25] evaluate_0.23     yaml_2.3.7        rlang_1.1.2       fs_1.6.3

metadata <- structure(
    list(
        title = "LEEF-1 experiment",
        description = "Data sampled during the LEEF-1 experiment",
        abstract = "The data from the LEEF-1 experiment.",
        created = "2020-01-01",
        language = "eng", accessRights = "embargoed.",
        rightsHolder = "A person or organization owning or managing rights over the resource. Recommended practice is to refer to the rights holder with a URI. If this is not possible or feasible, a literal value that identifies the rights holder may be provided.",
        license = "CC-BY-SA-4.0",
        creator = list(list(
            name = "Rainer M. Krug",
            affiliation = "University of Zurich", orcid = "0000-0002-7490-0066"
        )),
        contributor = list(list(
            name = "Rainer M. Krug", affiliation = "University of Zurich",
            orcid = "0000-0002-7490-0066", type = "DataManager"
        )),
        isPartOf = list(list(
            identifier = "https://doi.org/10.1111/ele.14217",
            relation = "isPartOf"
        ))
    )
)

cli <- depositsClient$new(service = "zenodo", sandbox = TRUE)

cli$deposit_fill_metadata(metadata)
#>             instancePath                                         schemaPath
#> 1               /created                        #/properties/created/format
#> 2              /metadata                     #/properties/metadata/required
#> 3 /metadata/access_right #/properties/metadata/properties/access_right/enum
#>    keyword params.format params.missingProperty
#> 1   format     date-time                   <NA>
#> 2 required          <NA>            description
#> 3     enum          <NA>                   <NA>
#>                  params.allowedValues
#> 1                                NULL
#> 2                                NULL
#> 3 open, embargoed, restricted, closed
#>                                      message
#> 1              must match format "date-time"
#> 2  must have required property 'description'
#> 3 must be equal to one of the allowed values
#> Error: Stopping because the metadata terms listed above do not conform with the expected schema for the zenodo service.

Created on 2023-12-05 with reprex v2.0.2

@rkrug
Copy link
Author

rkrug commented Dec 5, 2023

The problem concerning the description is an interaction with the field rightsHolder. as soon as this is excluded, the message disappears.

@mpadge
Copy link
Member

mpadge commented Feb 19, 2024

@rkrug Now address this issue, but first i note that both "created" and "access_rights" clearly state the problem in the error message:

  • "created" must be a "date-time" object, so setting to created = "2020-01-01 00:00:00" fixes that
  • "access_right" lists the enum values, and checking your code above shows you have accessRights = "embargoed.", - with a stray period at the end. Removing that fixes that one.

The description seems to be the remaining bug which i am now addressing ...

mpadge added a commit that referenced this issue Feb 19, 2024
mpadge added a commit that referenced this issue Feb 19, 2024
Plus set additionalProperties: false for both data and metadata
mpadge added a commit that referenced this issue Feb 19, 2024
@mpadge
Copy link
Member

mpadge commented Feb 19, 2024

That fixes the easy parts. The remaining problems all extend from accessRights = "embargoed". Specifying this in Zenodo then requires an embargo_date entry in the request metadata. The problem is how to represent this in the DCMI schema? It is currently not recognised there, therefore simply removed, leading to a request being submitted without this required field, which is then rejected.

@rkrug
Copy link
Author

rkrug commented Feb 27, 2024

Thanks for the clarification.

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