From e0153fd38a4f09e32c41b6455214e8905907f29d Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 25 Jun 2024 11:42:37 +0300 Subject: [PATCH] src/main: add more DOI formats to NormalizeDOIs I saw some DOIs like "www.doi.org" in our repository recently. --- .../java/io/github/ilri/cgspace/ctasks/NormalizeDOIs.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/ilri/cgspace/ctasks/NormalizeDOIs.java b/src/main/java/io/github/ilri/cgspace/ctasks/NormalizeDOIs.java index 0714d41..28ec029 100644 --- a/src/main/java/io/github/ilri/cgspace/ctasks/NormalizeDOIs.java +++ b/src/main/java/io/github/ilri/cgspace/ctasks/NormalizeDOIs.java @@ -86,9 +86,11 @@ public class NormalizeDOIs extends AbstractCurationTask { newDOI = newDOI.replace("http://", "https://"); // 4. Prefer doi.org to dx.doi.org newDOI = newDOI.replace("dx.doi.org", "doi.org"); - // 5. Replace values like doi: 10.11648/j.jps.20140201.14 + // 5. Prefer doi.org to www.doi.org + newDOI = newDOI.replace("www.doi.org", "doi.org"); + // 6. Replace values like doi: 10.11648/j.jps.20140201.14 newDOI = newDOI.replaceAll("^doi: 10\\.", "https://doi.org/10."); - // 6. Replace values like 10.3390/foods12010115 + // 7. Replace values like 10.3390/foods12010115 newDOI = newDOI.replaceAll("^10\\.", "https://doi.org/10."); return newDOI;