Skip to content

Commit e0153fd

Browse files
committed
src/main: add more DOI formats to NormalizeDOIs
I saw some DOIs like "www.doi.org" in our repository recently.
1 parent 12a606a commit e0153fd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/io/github/ilri/cgspace/ctasks/NormalizeDOIs.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ private static String getNormalizedDOI(MetadataValue itemDOI) {
8686
newDOI = newDOI.replace("http://", "https://");
8787
// 4. Prefer doi.org to dx.doi.org
8888
newDOI = newDOI.replace("dx.doi.org", "doi.org");
89-
// 5. Replace values like doi: 10.11648/j.jps.20140201.14
89+
// 5. Prefer doi.org to www.doi.org
90+
newDOI = newDOI.replace("www.doi.org", "doi.org");
91+
// 6. Replace values like doi: 10.11648/j.jps.20140201.14
9092
newDOI = newDOI.replaceAll("^doi: 10\\.", "https://doi.org/10.");
91-
// 6. Replace values like 10.3390/foods12010115
93+
// 7. Replace values like 10.3390/foods12010115
9294
newDOI = newDOI.replaceAll("^10\\.", "https://doi.org/10.");
9395

9496
return newDOI;

0 commit comments

Comments
 (0)