From e405a940e44b326891efa3e51b1ad523aba0d987 Mon Sep 17 00:00:00 2001 From: Simon Tzanakis Date: Tue, 3 Oct 2023 15:53:00 +0200 Subject: [PATCH] MET-5132: Cleanup --- .../normalization/normalizers/DatesNormalizer.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/metis-normalization/src/main/java/eu/europeana/normalization/normalizers/DatesNormalizer.java b/metis-normalization/src/main/java/eu/europeana/normalization/normalizers/DatesNormalizer.java index f8bc0b7b3..794714c77 100644 --- a/metis-normalization/src/main/java/eu/europeana/normalization/normalizers/DatesNormalizer.java +++ b/metis-normalization/src/main/java/eu/europeana/normalization/normalizers/DatesNormalizer.java @@ -180,10 +180,8 @@ public NormalizationReport normalize(Document document) throws NormalizationExce // Perform the two different kinds of normalizations final InternalNormalizationReport report = new InternalNormalizationReport(); - report.mergeWith(normalizeElements(document, europeanaProxy, DATE_PROPERTY_FIELDS, - this::normalizeDateProperty)); - report.mergeWith(normalizeElements(document, europeanaProxy, GENERIC_PROPERTY_FIELDS, - this::normalizeGenericProperty)); + report.mergeWith(normalizeElements(document, europeanaProxy, DATE_PROPERTY_FIELDS, this::normalizeDateProperty)); + report.mergeWith(normalizeElements(document, europeanaProxy, GENERIC_PROPERTY_FIELDS, this::normalizeGenericProperty)); return report; } @@ -214,6 +212,7 @@ private void normalizeElement(Document document, Element element, Namespace.Elem final String elementText = XmlUtil.getElementText(element); final DateNormalizationResult dateNormalizationResult = normalizationFunction.apply(elementText); if (dateNormalizationResult.getDateNormalizationResultStatus() == NO_MATCH) { + LOGGER.debug("Normalization did not find a match"); return; } @@ -229,10 +228,10 @@ private void normalizeElement(Document document, Element element, Namespace.Elem final Element reference = XmlUtil.createElement(elementType, europeanaProxy, List.of()); final String fullResourceName = XmlUtil.getPrefixedElementName(RDF_RESOURCE, reference.lookupPrefix(RDF_RESOURCE.getNamespace().getUri())); - final Attr dctermsIsPartOfResource = document.createAttributeNS( + final Attr dcTermsIsPartOfResource = document.createAttributeNS( RDF_RESOURCE.getNamespace().getUri(), fullResourceName); - dctermsIsPartOfResource.setValue(timespanId); - reference.setAttributeNode(dctermsIsPartOfResource); + dcTermsIsPartOfResource.setValue(timespanId); + reference.setAttributeNode(dcTermsIsPartOfResource); // Update the report. report.increment(this.getClass().getSimpleName(), ConfidenceLevel.CERTAIN);