diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java index d509b954e7..0689b44c5a 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java @@ -2,6 +2,7 @@ package eu.dnetlib.dhp.schema.oaf; import java.io.Serializable; +import java.util.List; import java.util.Objects; public class ExternalReference implements Serializable { @@ -11,12 +12,12 @@ public class ExternalReference implements Serializable { // title private String label; + // alternative labels + private List alternateLabel; + // text() private String url; - // ?? not mapped yet ?? - private String description; - // type private Qualifier qualifier; @@ -45,6 +46,14 @@ public class ExternalReference implements Serializable { this.label = label; } + public List getAlternateLabel() { + return alternateLabel; + } + + public void setAlternateLabel(List alternateLabel) { + this.alternateLabel = alternateLabel; + } + public String getUrl() { return url; } @@ -53,14 +62,6 @@ public class ExternalReference implements Serializable { this.url = url; } - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - public Qualifier getQualifier() { return qualifier; } @@ -103,7 +104,6 @@ public class ExternalReference implements Serializable { return Objects.equals(sitename, that.sitename) && Objects.equals(label, that.label) && Objects.equals(url, that.url) - && Objects.equals(description, that.description) && Objects.equals(qualifier, that.qualifier) && Objects.equals(refidentifier, that.refidentifier) && Objects.equals(query, that.query) @@ -114,6 +114,7 @@ public class ExternalReference implements Serializable { public int hashCode() { return Objects .hash( - sitename, label, url, description, qualifier, refidentifier, query, dataInfo); + sitename, label, url, qualifier, refidentifier, query, dataInfo); } + } diff --git a/dhp-workflows/dhp-actionmanager/src/main/java/eu/dnetlib/dhp/actionmanager/migration/ProtoConverter.java b/dhp-workflows/dhp-actionmanager/src/main/java/eu/dnetlib/dhp/actionmanager/migration/ProtoConverter.java index 2478da0e9c..70f37fba3f 100644 --- a/dhp-workflows/dhp-actionmanager/src/main/java/eu/dnetlib/dhp/actionmanager/migration/ProtoConverter.java +++ b/dhp-workflows/dhp-actionmanager/src/main/java/eu/dnetlib/dhp/actionmanager/migration/ProtoConverter.java @@ -132,7 +132,6 @@ public class ProtoConverter implements Serializable { ex.setQuery(e.getQuery()); ex.setQualifier(mapQualifier(e.getQualifier())); ex.setLabel(e.getLabel()); - ex.setDescription(e.getDescription()); ex.setDataInfo(ex.getDataInfo()); return ex; } diff --git a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlRecordFactory.java b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlRecordFactory.java index b9d450c757..644ed98ab1 100644 --- a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlRecordFactory.java +++ b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlRecordFactory.java @@ -45,7 +45,6 @@ import eu.dnetlib.dhp.schema.oaf.Result; public class XmlRecordFactory implements Serializable { - private static final String REL_SUBTYPE_DEDUP = "dedup"; private final Map accumulators; private final Set specialDatasourceTypes; @@ -1202,12 +1201,18 @@ public class XmlRecordFactory implements Serializable { if (isNotBlank(er.getLabel())) { fields.add(XmlSerializationUtils.asXmlElement("label", er.getLabel())); } + Optional + .ofNullable(er.getAlternateLabel()) + .map( + altLabel -> altLabel + .stream() + .filter(StringUtils::isNotBlank) + .collect(Collectors.toList())) + .orElse(Lists.newArrayList()) + .forEach(alt -> fields.add(XmlSerializationUtils.asXmlElement("alternatelabel", alt))); if (isNotBlank(er.getUrl())) { fields.add(XmlSerializationUtils.asXmlElement("url", er.getUrl())); } - if (isNotBlank(er.getDescription())) { - fields.add(XmlSerializationUtils.asXmlElement("description", er.getDescription())); - } if (isNotBlank(er.getUrl())) { fields.add(XmlSerializationUtils.mapQualifier("qualifier", er.getQualifier())); }