Fix bad RDA Common Standard name and minor RDA mapper improvement

This commit is contained in:
George Kalampokis 2021-12-20 14:19:17 +02:00
parent 209b180158
commit 814a9b2fee
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.logic.utilities.helpers.MyStringUtils;
import eu.eudat.models.rda.Host;
import eu.eudat.models.rda.PidSystem;
@ -48,6 +50,13 @@ public class HostRDAMapper {
rda.setAdditionalProperty(ImportPropertyName.DESCRIPTION.getName(), node.get("id").asText());
break;
case GEO_LOCATION:
if (rdaValue.startsWith("{")) {
try {
rdaValue = new ObjectMapper().readValue(rdaValue, Map.class).get("id").toString();
} catch (JsonProcessingException e) {
logger.warn(e.getLocalizedMessage() + ". Try to pass value as is");
}
}
rda.setGeoLocation(Host.GeoLocation.fromValue(rdaValue));
rda.setAdditionalProperty(ImportPropertyName.GEO_LOCATION.getName(), node.get("id").asText());
break;

View File

@ -1,6 +1,6 @@
dataset.data_quality_assurance
dataset.distribution.access_url
dataset.distribution.available_till
dataset.distribution.available_until
dataset.distribution.byte_size
dataset.distribution.data_access
dataset.distribution.description