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

CSL Citation support #11163

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Jan 16, 2025

What this PR does / why we need it: This PR adds support for viewing/copying dataset citations in any of the journal/society citation formats described in the Citation Style Language like Zotero, Mendeley, and others. (Strictly just the 1000K+ "independent" ones as coded, but that could be changed.)

Which issue(s) this PR closes:
It's related to #10512 in that it provides a copy-to-clipboard option for retrieving a citation, but it does not add a copy button for the main (custom) citation displayed on the dataset page.

It's also relevant w.r.t. #9994. It doesn't adopt the design discussed there of making the EndNote/RIS/BibTeX formats into exports (which are currently only available for the latest version).

  • Closes #

Special notes for your reviewer: The PR uses a combination of Java and Javascript libraries that have overlapping functionality. As coded, the Java library is only used to create the ~native CSLJson format which is then sent to the front end where Javascript reads that and generates any of the available formats. I'm hoping this makes more sense for the SPA than doing everything in the back-end Java. The PR includes an /api/pids/<pid>/csl api call that will return the CSLJson required by the front-end Javascript.

The code also leverages DataCite's API to get their version of CSL for DataCite DOIs for the latest published version of the dataset. This should assure that Dataverse's output would match that from those generated externally from the DOI. For drafts and older versions, and for other PID types, the Java library noted above is used to generate the CSLJson required. This is a compromise but gives us the opportunity to see if/when DataCite's mapping to CSLJson differs from our own.

The PR includes an API call as well, which is hopefully useful for the SPA - as a way to get the EndNote/RIS/BibTeX formats (and the Internal one without the JSON wrapper if that's helpful) as well as to get the CSLJson which could then be transformed by the JavaScript library used here or others to generate all the other styled formats. The one thing that this PR does not do that is supported by the current download mechanism is assigning a filename to the download. That shouldn't be hard to do if it's useful, but would take a little refactoring.

Suggestions on how to test this: Create a Dataset with lots of metadata and verify that the popup allows you to generate an copy any format you select.

Set the dataverse.csl.common-styles JVM option to a comma-separated list of formats other than "chicago-author-date, ieee" and verify that the entries for common styles in the dialog match.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
image
image
image

Is there a release notes update needed for this change?: added

Additional documentation: UI, API, and setting documented.

@qqmyers qqmyers added the GDCC: DANS related to GDCC work for DANS label Jan 16, 2025
@coveralls
Copy link

coveralls commented Jan 16, 2025

Coverage Status

coverage: 22.741% (-0.01%) from 22.751%
when pulling 204f2dd on GlobalDataverseCommunityConsortium:DANS-CSL
into d70de2c on IQSS:develop.

@qqmyers qqmyers marked this pull request as ready for review January 17, 2025 19:23
@qqmyers qqmyers added the GDCC: QDR of interest to QDR label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GDCC: DANS related to GDCC work for DANS GDCC: QDR of interest to QDR
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants