change maDmpTarget type in prefilling to semanticTarget

This commit is contained in:
Bernaldo Mihasi 2023-06-22 13:47:01 +03:00
parent d996acdcc4
commit cb972c394c
5 changed files with 45 additions and 45 deletions

View File

@ -112,11 +112,11 @@ public class PrefillingMapper {
throw e; throw e;
} }
} else { } else {
List<JsonNode> nodes = JsonSearcher.findNodes(parentNode, "schematics", "rda." + prefillingMapping.getMaDmpTarget()); List<JsonNode> nodes = JsonSearcher.findNodes(parentNode, "schematics", prefillingMapping.getSemanticTarget());
// zenodo prefilling customizations // zenodo prefilling customizations
if(type.equals("zenodo")){ if(type.equals("zenodo")){
if(prefillingMapping.getMaDmpTarget().equals("dataset.distribution.data_access")){ if(prefillingMapping.getSemanticTarget().equals("rda.dataset.distribution.data_access")){
if(parsedValue != null && parsedValue.equals("open")){ if(parsedValue != null && parsedValue.equals("open")){
List<JsonNode> issuedNodes = JsonSearcher.findNodes(parentNode, "schematics", "rda.dataset.issued"); List<JsonNode> issuedNodes = JsonSearcher.findNodes(parentNode, "schematics", "rda.dataset.issued");
if(!issuedNodes.isEmpty()){ if(!issuedNodes.isEmpty()){
@ -131,7 +131,7 @@ public class PrefillingMapper {
} }
} }
if (prefillingMapping.getMaDmpTarget().equals("dataset.distribution.available_until") && parsedValue != null && !parsedValue.equals("null")) { if (prefillingMapping.getSemanticTarget().equals("rda.dataset.distribution.available_until") && parsedValue != null && !parsedValue.equals("null")) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd");
LocalDate date = LocalDate.parse(parsedValue, formatter); LocalDate date = LocalDate.parse(parsedValue, formatter);
date = date.plusYears(20); date = date.plusYears(20);

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
public class DefaultPrefillingMapping implements PrefillingMapping{ public class DefaultPrefillingMapping implements PrefillingMapping{
private String source; private String source;
private String target; private String target;
private String maDmpTarget; private String semanticTarget;
private String subSource; private String subSource;
private String trimRegex; private String trimRegex;
@ -29,13 +29,13 @@ public class DefaultPrefillingMapping implements PrefillingMapping{
this.target = target; this.target = target;
} }
public String getMaDmpTarget() { public String getSemanticTarget() {
return maDmpTarget; return semanticTarget;
} }
@XmlAttribute(name = "maDmpTarget") @XmlAttribute(name = "semanticTarget")
public void setMaDmpTarget(String maDmpTarget) { public void setSemanticTarget(String semanticTarget) {
this.maDmpTarget = maDmpTarget; this.semanticTarget = semanticTarget;
} }
public String getSubSource() { public String getSubSource() {

View File

@ -6,7 +6,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "fixedMapping") @XmlRootElement(name = "fixedMapping")
public class PrefillingFixedMapping implements PrefillingMapping{ public class PrefillingFixedMapping implements PrefillingMapping{
private String target; private String target;
private String maDmpTarget; private String semanticTarget;
private String value; private String value;
public String getTarget() { public String getTarget() {
@ -18,13 +18,13 @@ public class PrefillingFixedMapping implements PrefillingMapping{
this.target = target; this.target = target;
} }
public String getMaDmpTarget() { public String getSemanticTarget() {
return maDmpTarget; return semanticTarget;
} }
@XmlAttribute(name = "maDmpTarget") @XmlAttribute(name = "semanticTarget")
public void setMaDmpTarget(String maDmpTarget) { public void setSemanticTarget(String semanticTarget) {
this.maDmpTarget = maDmpTarget; this.semanticTarget = semanticTarget;
} }
@Override @Override

View File

@ -7,9 +7,9 @@ public interface PrefillingMapping {
void setTarget(String target); void setTarget(String target);
String getMaDmpTarget(); String getSemanticTarget();
void setMaDmpTarget(String maDmpTarget); void setSemanticTarget(String semanticTarget);
String getSubSource(); String getSubSource();

View File

@ -1224,38 +1224,38 @@ but not
<url>https://zenodo.org/api/records/{id}</url> <url>https://zenodo.org/api/records/{id}</url>
<mappings> <mappings>
<mapping source="metadata.title" target="label" /> <mapping source="metadata.title" target="label" />
<mapping source="metadata.title" maDmpTarget="dataset.distribution.title" /> <mapping source="metadata.title" semanticTarget="rda.dataset.distribution.title" />
<mapping source="metadata.description" target="description" /> <mapping source="metadata.description" target="description" />
<mapping source="metadata.description" maDmpTarget="dataset.distribution.description" /> <mapping source="metadata.description" semanticTarget="rda.dataset.distribution.description" />
<mapping source="metadata.license.id" maDmpTarget="dataset.distribution.license.license_ref" /> <mapping source="metadata.license.id" semanticTarget="rda.dataset.distribution.license.license_ref" />
<mapping source="metadata.keywords" target="tags"/> <mapping source="metadata.keywords" target="tags"/>
<mapping source="metadata.keywords" maDmpTarget="dataset.keyword"/> <mapping source="metadata.keywords" semanticTarget="rda.dataset.keyword"/>
<mapping source="metadata.filesize" maDmpTarget="dataset.distribution.byte_size"/> <mapping source="metadata.filesize" semanticTarget="rda.dataset.distribution.byte_size"/>
<mapping source="metadata.language" maDmpTarget="dataset.metadata.language"/> <mapping source="metadata.language" semanticTarget="rda.dataset.metadata.language"/>
<mapping source="metadata.dates.valid" maDmpTarget="dataset.distribution.available_until"/> <mapping source="metadata.dates.valid" semanticTarget="rda.dataset.distribution.available_until"/>
<mapping source="metadata.license.created" maDmpTarget="dataset.distribution.license.start_date"/> <mapping source="metadata.license.created" semanticTarget="rda.dataset.distribution.license.start_date"/>
<mapping source="metadata.embargo_date" maDmpTarget="dataset.distribution.license.start_date"/> <mapping source="metadata.embargo_date" semanticTarget="rda.dataset.distribution.license.start_date"/>
<mapping source="metadata.publication_date" maDmpTarget="dataset.issued"/> <mapping source="metadata.publication_date" semanticTarget="rda.dataset.issued"/>
<mapping source="metadata.access_right" maDmpTarget="dataset.distribution.data_access"/> <mapping source="metadata.access_right" semanticTarget="rda.dataset.distribution.data_access"/>
<mapping source="files" subSource="filename" trimRegex="^.*\." maDmpTarget="dataset.distribution.format"/> <mapping source="files" subSource="filename" trimRegex="^.*\." semanticTarget="rda.dataset.distribution.format"/>
<mapping source="doi" maDmpTarget="dataset.dataset_id" /> <mapping source="doi" semanticTarget="rda.dataset.dataset_id" />
<mapping source="doi" maDmpTarget="dataset.dataset_id.identifier" /> <mapping source="doi" semanticTarget="rda.dataset.dataset_id.identifier" />
</mappings> </mappings>
<fixedMappings> <fixedMappings>
<fixedMapping maDmpTarget="dataset.distribution.host.title" value="Zenodo" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.title" value="Zenodo" />
<fixedMapping maDmpTarget="dataset.distribution.host.availability" value="More than 99% uptime yearly" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.availability" value="More than 99% uptime yearly" />
<fixedMapping maDmpTarget="dataset.distribution.host.geo_location" value="CH" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.geo_location" value="CH" />
<fixedMapping maDmpTarget="dataset.distribution.host.storage_type" value="All files uploaded to Zenodo are stored in CERNs EOS service in an 18 petabytes disk cluster." /> <fixedMapping semanticTarget="rda.dataset.distribution.host.storage_type" value="All files uploaded to Zenodo are stored in CERNs EOS service in an 18 petabytes disk cluster." />
<fixedMapping maDmpTarget="dataset.dataset_id.type" value="doi" /> <fixedMapping semanticTarget="rda.dataset.dataset_id.type" value="doi" />
<fixedMapping maDmpTarget="dataset.metadata.metadata_standard_id.identifier" value="https://schema.datacite.org/meta/kernel-4.4/" /> <fixedMapping semanticTarget="rda.dataset.metadata.metadata_standard_id.identifier" value="https://schema.datacite.org/meta/kernel-4.4/" />
<fixedMapping maDmpTarget="dataset.metadata.metadata_standard_id.type" value="url" /> <fixedMapping semanticTarget="rda.dataset.metadata.metadata_standard_id.type" value="url" />
<fixedMapping maDmpTarget="dataset.metadata.language" value="eng" /> <fixedMapping semanticTarget="rda.dataset.metadata.language" value="eng" />
<fixedMapping maDmpTarget="dataset.metadata.description" value="DataCite Metadata Schema" /> <fixedMapping semanticTarget="rda.dataset.metadata.description" value="DataCite Metadata Schema" />
<fixedMapping maDmpTarget="dataset.distribution.host.backup_frequency" value="Hourly" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.backup_frequency" value="Hourly" />
<fixedMapping maDmpTarget="dataset.distribution.host.backup_type" value="Incremental backup" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.backup_type" value="Incremental backup" />
<fixedMapping maDmpTarget="dataset.distribution.host.description" value="Repository hosted by Zenodo" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.description" value="Repository hosted by Zenodo" />
<fixedMapping maDmpTarget="dataset.distribution.host.url" value="https://zenodo.org" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.url" value="https://zenodo.org" />
<fixedMapping maDmpTarget="dataset.distribution.host.pid_system" value="doi" /> <fixedMapping semanticTarget="rda.dataset.distribution.host.pid_system" value="doi" />
</fixedMappings> </fixedMappings>
</prefillingGet> </prefillingGet>
</config> </config>