-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
ADR for entry type and item type mapping selection #15907
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
Changes from 1 commit
7d0be82
67baa7a
1d11864
9455847
8bf0c8c
21466dd
80cf838
2263fba
3f0fed5
513835a
b630ea7
a46ab61
ab3b70c
1765d60
00228ba
6ec4f2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| nav_order: 61 | ||
| parent: Decision Records | ||
| --- | ||
| # Entry type and item type mapping selection | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| We are implementing compatibility with Zotero. Zotero uses its item types, while JabRef uses BibTeX/BibLaTeX entry types. We need a suitable mapping strategy that preserves as much information as possible in both directions, from JabRef to Zotero and from Zotero to JabRef. | ||
|
|
||
| Which mapping should JabRef use to convert between entry types and Zotero's item types? | ||
|
|
||
| ## Decision Drivers | ||
|
|
||
| * Entry type to item type should try to avoid many-to-one mappings. | ||
| * Mapped item type should try to be semantically consistent with entry type. | ||
| * Mapped item type should contain as many fields from entry type as possible. | ||
|
|
||
| ## Considered Options | ||
|
|
||
| 1. Use citeproc-java's mapping | ||
| 2. Use JabRef's natural BibTeX/BibLaTeX mapping | ||
| 3. Use Zotero's natural mapping | ||
| 4. Use Better BibTeX's mapping | ||
|
|
||
| ## Decision Outcome | ||
|
|
||
| Chosen option: Use Better BibTeX's mapping in converter, because it provides both mapping directions, from entry type to item type and item type to entry type. When it comes to types that Better BibTeX does not support, we use JabRef's natural BibTeX/BibLaTeX mapping or Zotero's natural mapping. | ||
|
|
||
| ### Consequences | ||
|
Check failure on line 30 in docs/decisions/0061-EntryType-ItemType-mapping-selection.md
|
||
| * Good, because Better BibTeX supports mapping for both BibTeX and BibLaTeX entry types. | ||
|
Check failure on line 31 in docs/decisions/0061-EntryType-ItemType-mapping-selection.md
|
||
| * Good, because Better BibTeX supports more entry types than citeproc-java. | ||
| * Good, because Better BibTeX provides mapping for both entry type to item type and item type to entry type. | ||
| * Good, because Better BibTeX is designed specifically for Zotero and BibTeX and BibLaTeX interoperability. | ||
| * Good, because the repository is actively maintained. | ||
| * Bad, because Better BibTeX does not support all entry types. | ||
| * Bad, because Better BibTeX contains many-to-one mappings when converting entry type to item type, which may lose information. | ||
| * Bad, because we need to track Better BibTeX's updates, or import it as a dependency. | ||
|
|
||
| ## Pros and Cons of the Options | ||
|
|
||
| ### Use citeproc-java's mapping | ||
|
|
||
| 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) | ||
|
|
||
| * Good, because citeproc-java provides an existing converter, reducing the amount of time to customize mapping. | ||
| * Good, because citeproc-java is already a JabRef's submodule, no new dependency is needed | ||
| * Bad, because citeproc-java only provides converter from entry type to item type. | ||
| * Bad, because entry type to item type mapping contains multiple many-to-one mappings, mapping back from item type to entry type would lose information | ||
| * Bad, because citeproc-java converts unsupported entry type to "journal-article" | ||
| * Bad, because the repository is not actively maintained. | ||
|
|
||
| ### Use JabRef's natural BibTeX/BibLaTeX mapping | ||
|
|
||
| JabRef's internal behavior to map item type to entry type | ||
|
Check failure on line 55 in docs/decisions/0061-EntryType-ItemType-mapping-selection.md
|
||
|
|
||
| * 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 | ||
|
Check failure on line 62 in docs/decisions/0061-EntryType-ItemType-mapping-selection.md
|
||
|
|
||
| Zotero's internal behavior to map entry type to item type | ||
|
|
||
| * Good, because the mapping follows Zotero's internal behavior. | ||
| * Bad, because some entry types are not supported by Zotero. | ||
| * Bad, because we have limited control on the mapping. | ||
| * Bad, because round-trip conversion may cause mismatch (electronic -> web page -> online) | ||
|
|
||
| ### Use Better BibTeX's mapping | ||
|
|
||
| 1. Converter from entry type to item type can be found via [this link](https://github.com/retorquere/zotero-better-bibtex/blob/7b7237e60aad44c47656484cd5eaa40201882449/translators/bibtex/bibtex.ts#L632-L679). | ||
|
koppor marked this conversation as resolved.
Outdated
|
||
| 2. Converter from item type to BibTeX entry type can be found via [this link](https://github.com/retorquere/zotero-better-bibtex/blob/7b7237e60aad44c47656484cd5eaa40201882449/translators/bibtex/bibtex.ts#L56-L131). | ||
| 3. Converter from item type to BibLaTeX entry type can be found via [this link](https://github.com/retorquere/zotero-better-bibtex/blob/7b7237e60aad44c47656484cd5eaa40201882449/translators/bibtex/biblatex.ts#L47-L127). | ||
|
|
||
| * Good, because Better BibTeX supports mapping for both BibTeX and BibLaTeX entry types. | ||
| * Good, because Better BibTeX supports more entry types than citeproc-java. | ||
| * Good, because Better BibTeX provides mapping for both entry type to item type and item type to entry type. | ||
| * Good, because Better BibTeX is designed specifically for Zotero and BibTeX and BibLaTeX interoperability. | ||
| * Good, because the repository is actively maintained. | ||
| * Bad, because Better BibTeX does not support all entry types. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all entry types of? Jabref?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. Updated. |
||
| * Bad, because Better BibTeX contains many-to-one mappings when converting entry type to item type, which may lose information. | ||
| * Bad, because JabRef needs to track Better BibTeX's updates, or import it as a submodule. | ||
Uh oh!
There was an error while loading. Please reload this page.