-
Notifications
You must be signed in to change notification settings - Fork 10
Get Citation In Other Format Use Case #340
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new use case for retrieving dataset citations in various bibliographic formats (EndNote, RIS, BibTeX, CSLJson, Internal). The implementation follows the existing repository pattern and adds support for different content types including XML, plain text, JSON, and HTML formats.
- Adds
GetDatasetCitationInOtherFormatsuse case with support for 5 citation formats - Creates new domain models for citation formats and response structure
- Implements repository method with optional deaccessioned dataset inclusion
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/datasets/domain/models/CitationFormats.ts |
Defines enum for supported citation formats |
src/datasets/domain/models/CitationResponse.ts |
Type definition for citation response with content and content type |
src/datasets/domain/useCases/GetDatasetCitationInOtherFormats.ts |
Main use case implementation for retrieving citations |
src/datasets/domain/repositories/IDatasetsRepository.ts |
Interface update to include new citation method |
src/datasets/infra/repositories/DatasetsRepository.ts |
Repository implementation with API endpoint integration |
test/unit/datasets/GetDatasetCitationInOtherFormats.test.ts |
Unit tests for the new use case |
test/integration/datasets/DatasetsRepository.test.ts |
Integration tests covering all citation formats |
docs/useCases.md |
Documentation for the new use case |
test/testHelpers/roles/roleHelper.ts |
Removes deprecated 'LinkDataverse' and 'LinkDataset' permissions |
ekraffmiller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I just have suggestions for naming and the domain model.
|
@ekraffmiller Thanks for suggestions, Ellen! just fixed names and stringify json object |
ekraffmiller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, approved!
|
@ekraffmiller Hi Ellen, I add one commit for exporting this use case in |
ekraffmiller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, approved 👍
|
tests passing, merging |
What this PR does / why we need it:
Inspired by 2025 Q3 SPA proposal, we could add the citation in other formats use case. Native API works
The return results have different content types, include 'EndNote' (XML), 'RIS' (plain text), 'BibTeX' (plain text), 'CSLJson' (JSON), and 'Internal' (HTML).

Which issue(s) this PR closes:
Related Dataverse PRs:
Special notes for your reviewer:
The use case will be used for citation downloads(like the screenshot). The return type is still
Stringbut in different Content-Types, I think it makes more sense to have an use case to fetch the information here, and write a file to download by users in the front end repo?RoleHelper for testing changed because Revert "feat: "Link Dataset/Dataverse" permission"
Suggestions on how to test this:
Is there a release notes update needed for this change?:
Additional documentation: