Skip to content

Commit

Permalink
Fix DOI import in RIS Importer
Browse files Browse the repository at this point in the history
Use DOI parse and only add valid DOIs


Follow up from #6557

Fixes #6530
  • Loading branch information
Siedlerchr committed Jun 6, 2020
1 parent 9faf500 commit 835e778
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Pattern;
Expand All @@ -24,6 +23,7 @@
import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.field.UnknownField;
import org.jabref.model.entry.identifier.DOI;
import org.jabref.model.entry.types.EntryType;
import org.jabref.model.entry.types.IEEETranEntryType;
import org.jabref.model.entry.types.StandardEntryType;
Expand Down Expand Up @@ -204,7 +204,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException {
}
} else if ("UR".equals(tag) || "L2".equals(tag) || "LK".equals(tag)) {
fields.put(StandardField.URL, value);
} else if ((tagPriority = dateTags.indexOf(tag)) != -1 && value.length() >= 4) {
} else if (((tagPriority = dateTags.indexOf(tag)) != -1) && (value.length() >= 4)) {

if (tagPriority < datePriority) {
String year = value.substring(0, 4);
Expand Down Expand Up @@ -312,12 +312,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException {
}

private void addDoi(Map<Field, String> hm, String val) {
String doi = val.toLowerCase(Locale.ENGLISH);
if (doi.startsWith("doi:")) {
doi = doi.replaceAll("(?i)doi:", "").trim();
hm.put(StandardField.DOI, doi);
} else {
hm.put(StandardField.DOI, doi);
}
Optional<DOI> parsedDoi = DOI.parse(val);
parsedDoi.ifPresent(doi -> hm.put(StandardField.DOI, doi.getDOI()));
}
}
51 changes: 0 additions & 51 deletions src/test/java/org/jabref/logic/importer/RisImporterTest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ @phdthesis{
comment = {comment0
comment1
comment2},
doi = {whatever},
issn = {kmptns},
journal = {kmptnd},
keywords = {keyword0, keyword1},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ @article{
abstract = {The objective of this work was to develop solid dosage forms using powders contg. inclusion complexes (ibuprofen with β-cyclodextrin) which were used to produce tablets (direct compression without addnl. excipients) and pellets (extrusion/spheronization) from wet mass contg. 40% (wt./wt.) of microcryst. cellulose. The pellets also demonstrated that during prepn. of the wet mass, the inclusion process occurred in a same yield that when pre-complexation was used. The particles characteristics were evaluated after being obtained through different complexation methods. The results showed that the tensile strength and profile dissoln. were as expected for both dosage forms. Tablets contg. inclusion complexes showed higher soly. when compared with a ref. formulation and with two com. formulations. The ibuprofen released from the two pellets formulations didn't show relevant differences between them. The drug released was analyzed considering different dissoln. parameters. The advantages of these new methodologies can be summarized as: (a) tablets were produced at a lower cost for the total process; and (b) in the pellet's prepn. there was no need of the previous complexation method resulting in a decrease in time and energy required. [on SciFinder(R)]},
author = {Salustio, P. J. and Feio, G. and Figueirinhas, J. L. and Cabral-Marques, H. M. and Costa, P. C. and Pinto, J. F.},
comment = {CAPLUS AN 2012:446586(Journal; Online Computer File)},
doi = {10.1016/j.powtec.2012.01.008},
issn = {0032-5910},
journal = {Powder Technology},
keywords = {ibuprofen beta cyclodextrin inclusion complex tablet},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@article{,
author = {Sears, Margaret E.},
comment = {23690738[pmid]},
doi = {10.1155/2013/219840},
database = {PMC},
issn = {1537-744X},
journal = {The Scientific World Journal},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
% Encoding: UTF-8
@Article{,
author = {Jung, Sang In and Lee, Na Kyung and Kang, Kyung Woo and Kim, Kyoung and Lee, Do Youn},
title = {The effect of smartphone usage time on posture and respiratory function},
doi = {10.1589/jpts.28.186},
issn = {2187-5626},
language = {eng},
number = {26957754},
pages = {186--189},
url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4756000/},
volume = {28},
comment = {26957754[pmid]
PMC4756000[pmcid]},
database = {PubMed},
edition = {2016/01/30},
journal = {Journal of physical therapy science},
keywords = {Posture, Respiratory function, Smartphone},
month = jan,
publisher = {The Society of Physical Therapy Science},
year = {2016},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TY - JOUR
DB - PubMed
AU - Jung, Sang In
AU - Lee, Na Kyung
AU - Kang, Kyung Woo
AU - Kim, Kyoung
AU - Lee, Do Youn
T1 - The effect of smartphone usage time on posture and respiratory function
LA - eng
SN - 0915-5287
SN - 2187-5626
Y1 - 2016/01/
ET - 2016/01/30
SP - 186
EP - 189
VL - 28
IS - 1
AN - 26957754
UR - https://pubmed.ncbi.nlm.nih.gov/26957754
DO - 10.1589/jpts.28.186
L2 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4756000/
U1 - 26957754[pmid]
U2 - PMC4756000[pmcid]
U4 - jpts-2015-817[PII]
J2 - J Phys Ther Sci
JF - Journal of physical therapy science
KW - Posture
KW - Respiratory function
KW - Smartphone
PB - The Society of Physical Therapy Science
ER -
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@Article{,
author = {Ghosh, Chanchal and Basu, Joysurya and Ramachandran, Divakar and Mohandas, E.},
doi = {10.1016/j.actamat.2016.09.028},
title = {Phase separation and ω transformation in binary V-Ti and ternary V-Ti-Cr alloys},
journal = {Acta Materialia},
year = {2016},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ @Article{
comment = {Cited By :44
Export Date: 1 April 2016},
database = {Scopus},
doi = {10.1016/j.jmps.2004.03.010},
keywords = {Composite, Inclusions, Statistical distribution, Transverse isotropy},
url = {http://www.scopus.com/inward/record.url?eid=2-s2.0-4544289390&partnerID=40&md5=ad1a4baab95650b103a3467b787b83aa},
}
Expand Down

0 comments on commit 835e778

Please sign in to comment.