Skip to content

Commit

Permalink
MET-5132: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stzanakis committed Oct 3, 2023
1 parent d613725 commit e405a94
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down

0 comments on commit e405a94

Please sign in to comment.