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

Feature Request/Idea: API endpoint for recommended bibliographic citation text #8989

Closed
mccallc opened this issue Sep 22, 2022 · 3 comments
Closed

Comments

@mccallc
Copy link

mccallc commented Sep 22, 2022

Overview of the Feature Request
Implement a native API endpoint that serves the text of the recommended bibliographic citation (bibliographicCitation) for a dataset.

What kind of user is the feature intended for?
(Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)
API user

What inspired the request?
I am currently writing a program for data curators to automatically generate README.txt files for datasets on dataverse. In that README, I'd like to add the recommended bibliographic citation for the dataset as generated by dataverse and visible at the top of each dataset's webpage.

What existing behavior do you want changed?
There is an existing SWORD API endpoint that offers the bibliographicCitation object, but this is less useful because (reasons in order of importance)

  1. It always requires a privileged API key, even though the information is public in published datasets
  2. The result is returned in XML, not in JSON
  3. The SWORD API is an older codebase I've been discouraged from using

Any brand new behavior do you want to add to Dataverse?
I guess the addition of a new API endpoint counts as new behavior, but generating the underlying data I want to retrieve (recommended bibliographic citation text) does not require any brand new behavior.

Any related open or closed issues to this feature request?
None I could find from searching.

@pdurbin
Copy link
Member

pdurbin commented Sep 26, 2022

@mccallc hi! I'm wondering if the Search API would work for you.

Here's an example of getting the HTML version of the citation:

$ curl -s https://dataverse.harvard.edu/api/search?q=dsPersistentId:%22doi:10.7910/DVN/TJCLKP%22 | jq -r '.data.items[0].citationHtml'

Durbin, Philip, 2017, "Open Source at Harvard", <a href="https://doi.org/10.7910/DVN/TJCLKP" target="_blank">https://doi.org/10.7910/DVN/TJCLKP</a>, Harvard Dataverse, V3, UNF:6:2MMoV8KKO8R7sb27Q5GXtA== [fileUNF]

If you prefer plain text:

$ curl -s https://dataverse.harvard.edu/api/search?q=dsPersistentId:%22doi:10.7910/DVN/TJCLKP%22 | jq -r '.data.items[0].citation'

Durbin, Philip, 2017, "Open Source at Harvard", https://doi.org/10.7910/DVN/TJCLKP, Harvard Dataverse, V3, UNF:6:2MMoV8KKO8R7sb27Q5GXtA== [fileUNF]

(The %22 is to put the DOI in double quotes.)

In terms of a first class API for citations, it's been talked about here:

@mccallc
Copy link
Author

mccallc commented Sep 26, 2022

yes, this will work excellently for my needs! Thanks so much for the direction, and apologies for posting a duplicate issue.

@mccallc mccallc closed this as completed Sep 26, 2022
@pdurbin
Copy link
Member

pdurbin commented Sep 26, 2022

@mccallc no worries! Good luck on your project!

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