Skip to content

Feat/hayagriva yaml importer(#15714)#15738

Closed
madhav758 wants to merge 7 commits into
JabRef:mainfrom
madhav758:feat/hayagriva-yaml-importer
Closed

Feat/hayagriva yaml importer(#15714)#15738
madhav758 wants to merge 7 commits into
JabRef:mainfrom
madhav758:feat/hayagriva-yaml-importer

Conversation

@madhav758

Copy link
Copy Markdown
Contributor

Related issues and pull requests

Closes #15714

PR Description

Added support for importing Hayagriva YAML files into JabRef by implementing a new importer in the fileformat package, adding it to the list of importers JabRef checks when opening a file and writing tests using both custom test files and the official basic.yml from the upstream Hayagriva test guide. Hayagriva is the citation format JabRef could already export to it, but had no way to read it back in.
The round-trip test (export → import → compare) covering all serial-number subtypes (DOI, ISBN, ISSN, …) cannot be added yet as it is blocked by #15713, which needs to be fixed first. It will be added as a follow-up once that issue is resolved.

Screenshot 2026-05-15 at 11 45 01 AM Screenshot 2026-05-15 at 11 52 59 AM

Steps to test

  1. Build and launch JabRef: ./gradlew :jabgui:run
  2. Go to File → Import into new library and select a .yml file in Hayagriva format (e.g. grab basic.yml (https://github.com/typst/hayagriva/blob/main/tests/data/basic.yml) from the upstream Hayagriva repo)
  3. In the importer dialog, choose Hayagriva YAML from the format dropdown and confirm
  4. Verify that entries appear with correct types, authors, titles, and fields like journal/booktitle populated from the nested parent block
  5. To run the automated tests: ./gradlew :jablib:test --tests "org.jabref.logic.importer.fileformat.HayagrivaYamlImporterTest"

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@github-actions github-actions Bot added good second issue Issues that involve a tour of two or three interweaved components in JabRef component: import-load labels May 15, 2026
@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label May 15, 2026
@subhramit

Copy link
Copy Markdown
Member

Please disclose AI usage in the PR description.

@pluto-han

pluto-han commented May 15, 2026

Copy link
Copy Markdown
Collaborator

PR description and steps to test are suspected to be generated by AI.

At least please disclose AI usage and attach screenshots in steps to test. Otherwise your PR will not be reviewed.

@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels May 16, 2026
@pluto-han pluto-han mentioned this pull request May 16, 2026
7 tasks
@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels May 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

/// Returns the string value from a Hayagriva title or url field.
/// The field can be a plain string or a map containing a {@code value} key.
@Nullable
private static String extractStringValue(@Nullable Object field) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add @return plz

@JsonProperty("issue")
String issue;

@JsonProperty("publisher")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why repeated annotations?

Please make it an outter class. - Maybe "DTO" - see jabsrv


// POJO classes for YAML deserialization

private static class HayagrivaEntry {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

record?

Comment on lines +321 to +323
BibEntry entry = new BibEntry(entryType);
entry.setCitationKey(citationKey);
entry.setField(fields);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withers?

@koppor

koppor commented Jun 3, 2026

Copy link
Copy Markdown
Member

Closing this issue due to inactivity 💤

@koppor koppor closed this Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

This pull requests was closed without merging. You have been unassigned from the respective issue #15714. In case you closed the PR for yourself, you can re-open it. Please also check After submission of a pull request in CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: import-load good second issue Issues that involve a tour of two or three interweaved components in JabRef status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Implement Hayagriva importer

5 participants