Skip to content

Commit

Permalink
src/main/java: more DOI normalization
Browse files Browse the repository at this point in the history
Normalize %2f to /.
  • Loading branch information
alanorth committed Jun 26, 2024
1 parent 28668f7 commit 3a583c4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* TODO: allow operation on communities and collections (currently only works on items)
*
* @author Alan Orth for the International Livestock Research Institute
* @version 7.6.1.2
* @version 7.6.1.3
* @since 7.6.1.1
*/
@Suspendable
Expand Down Expand Up @@ -88,6 +88,8 @@ private static String getNormalizedDOI(MetadataValue itemDOI) {
newDOI = newDOI.replace("dx.doi.org", "doi.org");
// Prefer doi.org to www.doi.org
newDOI = newDOI.replace("www.doi.org", "doi.org");
// Fix URL encoded slashes (%2f)
newDOI = newDOI.replace("%2f", "/");
// Replace values like doi: 10.11648/j.jps.20140201.14
newDOI = newDOI.replaceAll("^doi: 10\\.", "https://doi.org/10.");
// Replace values like 10.3390/foods12010115
Expand Down

0 comments on commit 3a583c4

Please sign in to comment.