From ed8a0a01ade6d7d7d0776bddb113d958be0bf5dc Mon Sep 17 00:00:00 2001 From: scott Date: Wed, 14 Feb 2024 10:29:02 -0700 Subject: [PATCH] Trim whitespace from URI values (iiifManifest) --- .../enrichments/normalizations/StringNormalizations.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/scala/dpla/ingestion3/enrichments/normalizations/StringNormalizations.scala b/src/main/scala/dpla/ingestion3/enrichments/normalizations/StringNormalizations.scala index b262caa17..1e5ceceaf 100644 --- a/src/main/scala/dpla/ingestion3/enrichments/normalizations/StringNormalizations.scala +++ b/src/main/scala/dpla/ingestion3/enrichments/normalizations/StringNormalizations.scala @@ -21,6 +21,7 @@ class StringNormalizations { dataProvider = enrichEdmAgent(record.dataProvider), edmRights = record.edmRights.map(enrichEdmRights), hasView = record.hasView.map(enrichEdmWebResource), + iiifManifest = record.iiifManifest.map(enrichUri), intermediateProvider = record.intermediateProvider.map(enrichEdmAgent), isShownAt = enrichEdmWebResource(record.isShownAt), `object` = record.`object`.map(enrichEdmWebResource), @@ -70,6 +71,9 @@ class StringNormalizations { .cleanupEndingPunctuation) ) + def enrichUri(value: URI): URI = { + URI(value.toString.reduceWhitespace) + } def enrichEdmRights(edmRights: URI): URI = { val uri = new java.net.URI(edmRights.toString) // value already validated as URI in mapping // normalize uri path