-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Extend RIS import with multiple fields #3642
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
tobiasdiez
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.
The changes look good. A few of the additional fields are actually standard biblatex fields (or have an equivalent one) and thus should be added to the FieldName enum. Apart from these minor points, this can be merged.
| else if ("AV".equals(tag)) { | ||
| fields.put("archive_location", value); | ||
| } else if ("C3".equals(tag)) { | ||
| fields.put("event", value); |
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.
Biblatex has eventtitle
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.
fixed
| } else if ("DB".equals(tag)) { | ||
| fields.put("archive", value); | ||
| } else if ("N1".equals(tag) || "RN".equals(tag)) { | ||
| fields.put("note", value); |
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.
Note is a standard biblatex field and thus should be added to FieldName
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.
fixed
| } else if ("SE".equals(tag)) { | ||
| fields.put("section", value); | ||
| } else if ("ST".equals(tag)) { | ||
| fields.put("shortTitle", value); |
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.
shorttitle is a standard biblatex field
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.
shorttitle wasn't even part of FieldName so far. I have added it now.
| } else if ("ST".equals(tag)) { | ||
| fields.put("shortTitle", value); | ||
| } else if ("C2".equals(tag)) { | ||
| fields.put("pubmed-identifier", value); |
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.
I'm not sure if we are already have a PMID field. If not, the (biblatex) standard is to specify it in the format
eprint = {<pmid>},
eprinttype = {pubmed},
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.
fixed
| } else if ("C2".equals(tag)) { | ||
| fields.put("pubmed-identifier", value); | ||
| } else if ("TA".equals(tag)) { | ||
| fields.put("translator", value); |
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.
translator is also a standard biblatex field
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.
fixed
|
@tobiasdiez Thanks a lot! I didn't have biblatex in mind when setting the fields. Your comments are all integrated. |
Siedlerchr
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.
LGTM, but I would really prefer if you could add a simple test
| } else if ("BT".equals(tag)) { | ||
| fields.put(FieldName.BOOKTITLE, value); | ||
| } else if ("T2".equals(tag) && (fields.get(FieldName.JOURNAL) == null || "".equals(fields.get(FieldName.JOURNAL)))) { | ||
| } else if (("T2".equals(tag) || "J2".equals(tag) || "JA".equals(tag)) && (fields.get(FieldName.JOURNAL) == null || "".equals(fields.get(FieldName.JOURNAL)))) { |
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.
This would have been optimal to use a switch case, which is very efficient for strings, but that's a bit of personal taste ;)
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.
You are right in terms of efficiency, but I really don't like switches. It is just to easy to forget the break statement. That doesn't happen if you stick to if and always use braces.
|
Is the |
|
Regarding the test, seems to be a general problem with the parameterized tests and the new junit ä. |
|
Ok, then this is something that really needs fixing. I'll open an issue for it. Otherwise this PR is ready to merge from my point of view. |
|
In the spirit of getting things done and because all reviewer comments have been addressed, I'll merge this now. |
* upstream/master: (46 commits) Replace openoffice jars with libreoffice jars (#3662) Export no empty lines in RIS format (#3661) Remove apache commons logging in favor of slf4j + log4j for JAVA 9 (#3653) fix isbn fetcher test as Joshua Bloch has published a new revivsion of Effetive Java convert to junit5 jupiter Extend RIS import with multiple fields (#3642) Fix ICAR fetcher test which resulted in build failure (#3654) New translations JabRef_en.properties (French) (#3650) Add link to MADR and fix typo [WIP] Add "Convert to BibTeX format" cleanup (#3541) Fix typo Fix typo Quickfix to get build running on all platforms (#3638) New translations JabRef_en.properties (French) New translations JabRef_en.properties (Vietnamese) New translations JabRef_en.properties (Chinese Simplified) New translations JabRef_en.properties (Dutch) New translations JabRef_en.properties (French) New translations JabRef_en.properties (German) New translations JabRef_en.properties (Greek) New translations JabRef_en.properties (Indonesian) ...
Meeting time is programming time :)
This addresses the import related things described in #3634 #2607
I basically went through the lists linked by @dsifford in the first issue, tried to adapt our import if possible and added custom fields when not. Our importer tests are still running.