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

Zenodo to InvenioRDM - citation export methods #136

Closed
Tracked by #127
oggioniale opened this issue Oct 31, 2023 · 15 comments
Closed
Tracked by #127

Zenodo to InvenioRDM - citation export methods #136

oggioniale opened this issue Oct 31, 2023 · 15 comments
Assignees
Labels
enhancement New feature or request Invenio RDM
Milestone

Comments

@oggioniale
Copy link

With zen4R version 0.9 I try to download the BibTeX citation of the record.
After a:
rec <- zenodo$getRecordByDOI(doi)
I do:
rec$exportAs("BibTeX", filename = "download_files_of_7041152/7041152")
or
rec$exportAsBibTeX(filename = "download_files_of_7041152/7041152")
but I obtain the same error:
Error in open.connection(x, "rb") : HTTP error 404.
Is it related with the changes of Zenodo APIs?

@eblondel
Copy link
Owner

Yes it is related to the change to the new Zenodo API.

@oggioniale
Copy link
Author

is there a way now to download BibTeX? Or should I assume that this is a lost functionality?

@eblondel
Copy link
Owner

At this stage, the method has not been migrated, but it will, so it will not be lost. The overall work to migrate to the new Zenodo is quite huge, and unfortunately there was no real time to test first on sandbox before the upgrade was applied to production. This was done in one shot on both environments, and I'm migrating broken methods one by one where there is no backward compatibility. Give me some time

@eblondel eblondel self-assigned this Oct 31, 2023
@eblondel eblondel changed the title exportAsBibTeX or exportAs HTTP error 404 Zenodo to InvenioRDM - citation export methods Oct 31, 2023
@eblondel eblondel added this to the 1.0 milestone Oct 31, 2023
eblondel added a commit that referenced this issue Oct 31, 2023
@eblondel
Copy link
Owner

I had a look and changes were relatively minor. This is in implemented in a dev branch. If you want to test, install zen4R from the dev branch related to the Zenodo upgrade:

remotes::install_github("eblondel/zen4R", ref = "127-zenodo-invenio-rdm")

Let me know if it works for you

@eblondel eblondel added the enhancement New feature or request label Oct 31, 2023
@oggioniale
Copy link
Author

no it doesn't work

@eblondel
Copy link
Owner

eblondel commented Nov 2, 2023

Can you give me the DOI for which you try to get the citation?

@eblondel
Copy link
Owner

eblondel commented Nov 2, 2023

I've tested again and it works. On your side you try to use a filename containing a slash, it can't work.

@oggioniale
Copy link
Author

it is a test record, the DOI is https://zenodo.org/doi/10.5281/zenodo.7034189

@eblondel
Copy link
Owner

eblondel commented Nov 2, 2023

This works:

library(zen4R)
ZENODO = ZenodoManager$new()
rec = ZENODO$getRecordByConceptDOI("10.5281/zenodo.7034189")
rec$exportAsBibTeX("test") # or rec$exportAs("BibTeX", "test")

@oggioniale
Copy link
Author

I do this:

zenodo <- zen4R::ZenodoManager$new(logger = "INFO")
rec <- zenodo$getRecordByDOI("10.5281/zenodo.7034189")
rec$exportAs("BibTeX", filename = "bib_file")

and your is:

ZENODO = ZenodoManager$new()
rec = ZENODO$getRecordByConceptDOI("10.5281/zenodo.7034189")
rec$exportAsBibTeX("test") # or rec$exportAs("BibTeX", "test")

In both case the output is Error in open.connection(x, "rb") : HTTP error 404.

@eblondel
Copy link
Owner

eblondel commented Nov 2, 2023

The error you reports means you installed zen4R from master, not from the dev branch:

remotes::install_github("eblondel/zen4R", ref = "127-zenodo-invenio-rdm")

@oggioniale
Copy link
Author

I do this but I have the same error.

> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 14.0

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.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/Rome
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] zen4R_0.9      magrittr_2.0.3

@eblondel
Copy link
Owner

eblondel commented Nov 2, 2023

I changed the package version to 0.9.9000 on the dev branch. If you can, restart R, and reinstall it, to make sure it was installed from there. This might be a package caching issue in R

@oggioniale
Copy link
Author

Yes! Now it is work!

@eblondel eblondel reopened this Nov 5, 2023
@eblondel
Copy link
Owner

eblondel commented Nov 5, 2023

Thanks @oggioniale for your feedback,. For now i'll keep tickets on InvenioRDM transition open, I will close them when all the work will be merged to the main branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Invenio RDM
Projects
None yet
Development

No branches or pull requests

2 participants