jabref icon indicating copy to clipboard operation
jabref copied to clipboard

ADR for entry type and item type mapping selection

Open pluto-han opened this issue 5 months ago β€’ 4 comments

Related issues and pull requests

Related to https://github.com/JabRef/jabref/issues/15875

PR Description

Add ADR for entry type and item type mapping selection

AI usage

Codex-5.4


Checklist

  • [x] I own the copyright of the code submitted and I license it under the MIT license
  • [x] If AI tools were used, I disclosed them in the "AI usage" section and reviewed, understood, and take full ownership of all AI-generated code
  • [/] 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

pluto-han avatar Jun 05 '26 17:06 pluto-han

Review Summary by Qodo

Add ADR 0061 for entry type and item type mapping selection

πŸ“ Documentation

Grey Divider

Walkthroughs

Description
β€’ Adds ADR 0061 documenting entry type and item type mapping selection
β€’ Evaluates four mapping strategies for Zotero compatibility
β€’ Selects Better BibTeX mapping as primary solution
β€’ Documents decision drivers, consequences, and trade-offs
Diagram
flowchart LR
  A["Zotero Compatibility Need"] --> B["Evaluate Mapping Strategies"]
  B --> C["citeproc-java"]
  B --> D["JabRef Natural Mapping"]
  B --> E["Zotero Natural Mapping"]
  B --> F["Better BibTeX Mapping"]
  F --> G["Selected Solution"]
  G --> H["Bidirectional Conversion Support"]

Grey Divider

File Changes

1. docs/decisions/0061-EntryType-ItemType-mapping-selection.md πŸ“ Documentation +84/-0

ADR for entry type and item type mapping selection

β€’ New ADR document establishing entry type to item type mapping strategy
β€’ Defines context for Zotero compatibility implementation
β€’ Evaluates four mapping options with pros and cons analysis
β€’ Selects Better BibTeX mapping with fallback to JabRef/Zotero natural mappings

docs/decisions/0061-EntryType-ItemType-mapping-selection.md


Grey Divider

Qodo Logo

Code Review by Qodo

🐞 Bugs (0) πŸ“˜ Rule violations (0) πŸ“Ž Requirement gaps (0) 🎨 UX issues (0) πŸ”— Cross-repo conflicts (0) πŸ“œ Skill insights (0)

Grey Divider
Action required
1. Trailing whitespace breaks markdownlint βœ“ Resolved 🐞 Bug ☼ Reliability
Description
The new ADR has trailing spaces at the end of multiple lines, which violates markdownlint MD009 and
will fail the Markdown CI job. This blocks merging until the whitespace is removed.
Code

docs/decisions/0061-EntryType-ItemType-mapping-selection.md[R55-62]

+JabRef's internal behavior to map item type to entry type 
+
+* Good, because the mapping follows JabRef's internal behavior.
+* Good, because no new dependency is needed.
+* Bad, because we have limited control on the mapping
+* Bad, because it converts multiple item type to `misc`, which loses much information.
+
+### Use Zotero's natural mapping 
Evidence
The ADR contains lines with visible trailing whitespace, and CI runs markdownlint over documentation
without disabling the trailing-whitespace rule, so the build will fail until whitespace is removed.

docs/decisions/0061-EntryType-ItemType-mapping-selection.md[55-62] .github/workflows/tests-code.yml[152-167] .markdownlint.yml[1-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The ADR contains trailing whitespace at the end of lines (e.g., after `entry type` and after a heading). This triggers markdownlint (MD009) in CI.
### Issue Context
CI runs `markdownlint-cli2-action` over `docs/**/*.md`, and the repo markdownlint config does not disable MD009.
### Fix Focus Areas
- docs/decisions/0061-EntryType-ItemType-mapping-selection.md[55-62]

β“˜ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Converter link path inconsistent βœ“ Resolved 🐞 Bug βš™ Maintainability
Description
The ADR’s citeproc-java converter URL uses a path segment citeproc/BibTeX/, which is inconsistent
with the converter package JabRef uses (de.undercouch.citeproc.bibtex.BibTeXConverter). This makes
the reference error-prone and may cause the documentation link checker to report a broken link.
Code

docs/decisions/0061-EntryType-ItemType-mapping-selection.md[44]

+Converter can be found via [this link](https://github.com/michel-kraemer/citeproc-java/blob/09d31a49090e06e6ab062016012b593897b3cb26/citeproc-java/src/main/java/de/undercouch/citeproc/BibTeX/BibTeXConverter.java#L420-L462)
Evidence
JabRef’s code imports the converter from the ...citeproc.bibtex... package, while the ADR points
to a different-cased/different-named directory (BibTeX) in the URL. Since CI runs linkspector on
docs, incorrect external URLs are surfaced as PR failures.

docs/decisions/0061-EntryType-ItemType-mapping-selection.md[42-45] jablib/src/main/java/org/jabref/logic/citationstyle/JabRefItemDataProvider.java[25-28] .github/workflows/check-links.yml[1-36] .linkspector.yml[1-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The ADR links to `.../de/undercouch/citeproc/BibTeX/BibTeXConverter.java`, but JabRef imports `de.undercouch.citeproc.bibtex.BibTeXConverter`. The URL path should be updated to match the expected `bibtex` directory naming to avoid incorrect references and link-check failures.
### Issue Context
The repository runs a dedicated link checker (linkspector) on `docs/**/*.md`.
### Fix Focus Areas
- docs/decisions/0061-EntryType-ItemType-mapping-selection.md[44-44]

β“˜ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Reply to https://github.com/JabRef/jabref/pull/15907#discussion_r3369015438 and https://github.com/JabRef/jabref/pull/15907#discussion_r3369015727:

The original JabRef's natural BibTeX/BibLaTeX mapping and Zotero's natural mapping are actually Zotero's internal export and import mapping. Zotero's exporter for BibLaTeX Zotero's exporter and importer for BibTeX

After the discussion with @subhramit, I modified the options. Please correct me if I misunderstand or miss something @subhramit @koppor .

pluto-han avatar Jun 07 '26 17:06 pluto-han

Add citation-js as an option

pluto-han avatar Jun 20 '26 23:06 pluto-han