Add new RDA exporter

This commit is contained in:
George Kalampokis 2020-03-20 18:20:22 +02:00
parent a23b1dd262
commit 9e72be32d4
49 changed files with 6447 additions and 7 deletions

View File

@ -105,14 +105,16 @@ public class DataManagementPlanManager {
private UtilitiesService utilitiesService; private UtilitiesService utilitiesService;
private DatabaseRepository databaseRepository; private DatabaseRepository databaseRepository;
private Environment environment; private Environment environment;
private RDAManager rdaManager;
@Autowired @Autowired
public DataManagementPlanManager(ApiContext apiContext, DatasetManager datasetManager, Environment environment) { public DataManagementPlanManager(ApiContext apiContext, DatasetManager datasetManager, Environment environment, RDAManager rdaManager) {
this.apiContext = apiContext; this.apiContext = apiContext;
this.datasetManager = datasetManager; this.datasetManager = datasetManager;
this.utilitiesService = apiContext.getUtilitiesService(); this.utilitiesService = apiContext.getUtilitiesService();
this.databaseRepository = apiContext.getOperationsContext().getDatabaseRepository(); this.databaseRepository = apiContext.getOperationsContext().getDatabaseRepository();
this.environment = environment; this.environment = environment;
this.rdaManager = rdaManager;
} }
public DataTableData<DataManagementPlanListingModel> getPaged(DataManagementPlanTableRequest dataManagementPlanTableRequest, Principal principal, String fieldsGroup) throws Exception { public DataTableData<DataManagementPlanListingModel> getPaged(DataManagementPlanTableRequest dataManagementPlanTableRequest, Principal principal, String fieldsGroup) throws Exception {
@ -1129,15 +1131,20 @@ public class DataManagementPlanManager {
eu.eudat.data.entities.DMP dmp = databaseRepository.getDmpDao().find(UUID.fromString(id)); eu.eudat.data.entities.DMP dmp = databaseRepository.getDmpDao().find(UUID.fromString(id));
if (!dmp.isPublic() && dmp.getUsers().stream().noneMatch(userInfo -> userInfo.getUser().getId() == principal.getId())) if (!dmp.isPublic() && dmp.getUsers().stream().noneMatch(userInfo -> userInfo.getUser().getId() == principal.getId()))
throw new UnauthorisedException(); throw new UnauthorisedException();
RDAExportModel rdaExportModel = new RDAExportModel().fromDataModel(dmp, datasetManager, principal); // RDAExportModel rdaExportModel = new RDAExportModel().fromDataModel(dmp, datasetManager, principal);
String result = rdaManager.convertToRDA(dmp);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
String fileName = dmp.getLabel(); String fileName = dmp.getLabel();
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", ""); fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
File file = new File(fileName + ".json"); File file = new File(fileName + ".json");
OutputStream output = new FileOutputStream(file);
try { try {
mapper.writeValue(file, rdaExportModel); // mapper.writeValue(file, rdaExportModel);
output.write(result.getBytes());
output.flush();
output.close();
} catch (IOException e) { } catch (IOException e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
} }

View File

@ -113,8 +113,8 @@ public class DatasetProfileManager {
ResponseEntity<Object> response = restTemplate.exchange(data.getUrl() + "?search=" + like, HttpMethod.GET, entity, Object.class); ResponseEntity<Object> response = restTemplate.exchange(data.getUrl() + "?search=" + like, HttpMethod.GET, entity, Object.class);
DocumentContext jsonContext = JsonPath.parse(response.getBody()); DocumentContext jsonContext = JsonPath.parse(response.getBody());
List<Map<String, String>> jsonItems = jsonContext.read(data.getOptionsRoot() + "['" + data.getAutoCompleteOptions().getLabel() + "','" + data.getAutoCompleteOptions().getValue() + "','" + data.getAutoCompleteOptions().getSource() + "']"); List<Map<String, String>> jsonItems = jsonContext.read(data.getOptionsRoot() + "['" + data.getAutoCompleteOptions().getLabel() + "','" + data.getAutoCompleteOptions().getValue() + "','" + data.getAutoCompleteOptions().getSource() + "','" + "uri" + "']");
jsonItems.forEach(item -> result.add(new ExternalAutocompleteFieldModel(item.get(data.getAutoCompleteOptions().getValue()), item.get(data.getAutoCompleteOptions().getLabel()), item.get(data.getAutoCompleteOptions().getSource())))); jsonItems.forEach(item -> result.add(new ExternalAutocompleteFieldModel(item.get(data.getAutoCompleteOptions().getValue()), item.get(data.getAutoCompleteOptions().getLabel()), item.get(data.getAutoCompleteOptions().getSource()), item.get("uri"))));
return result; return result;
} }

View File

@ -0,0 +1,38 @@
package eu.eudat.logic.managers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.data.entities.DMP;
import eu.eudat.models.rda.Dmp;
import eu.eudat.models.rda.RDAModel;
import eu.eudat.models.rda.mapper.DmpRDAMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.text.SimpleDateFormat;
@Component
public class RDAManager {
private DmpRDAMapper dmpRDAMapper;
@Autowired
public RDAManager(DmpRDAMapper dmpRDAMapper) {
this.dmpRDAMapper = dmpRDAMapper;
}
@Transactional
public String convertToRDA(DMP dmp) throws JsonProcessingException {
String result = "";
Dmp rdaDmp = dmpRDAMapper.toRDA(dmp);
ObjectMapper mapper = new ObjectMapper();
mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
result = mapper.writeValueAsString(rdaDmp);
return result;
}
}

View File

@ -0,0 +1,32 @@
package eu.eudat.logic.utilities.json;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class JsonSearcher {
public static List<JsonNode> findNodes(JsonNode root, String key, String value) {
List<JsonNode> nodes = new ArrayList<>();
for (Iterator<JsonNode> it = root.elements(); it.hasNext(); ) {
JsonNode node = it.next();
int found = 0;
for (Iterator<String> iter = node.fieldNames(); iter.hasNext(); ) {
String fieldName = iter.next();
if (fieldName.equals(key)) {
if (node.get(fieldName).asText().equals(value) || node.get(fieldName).asText().startsWith(value)) {
nodes.add(node);
found++;
}
}
}
if (found == 0) {
nodes.addAll(findNodes(node, key, value));
}
}
return nodes;
}
}

View File

@ -64,6 +64,7 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
this.autoCompleteOptions.setLabel(optionElement.getAttribute("label")); this.autoCompleteOptions.setLabel(optionElement.getAttribute("label"));
this.autoCompleteOptions.setValue(optionElement.getAttribute("value")); this.autoCompleteOptions.setValue(optionElement.getAttribute("value"));
this.autoCompleteOptions.setSource(optionElement.getAttribute("source")); this.autoCompleteOptions.setSource(optionElement.getAttribute("source"));
this.autoCompleteOptions.setUri(optionElement.getAttribute("uri"));
} }
return this; return this;
} }
@ -81,6 +82,7 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
this.autoCompleteOptions.setLabel(options.get("label")); this.autoCompleteOptions.setLabel(options.get("label"));
this.autoCompleteOptions.setValue(options.get("value")); this.autoCompleteOptions.setValue(options.get("value"));
this.autoCompleteOptions.setSource(options.get("source")); this.autoCompleteOptions.setSource(options.get("source"));
this.autoCompleteOptions.setUri(options.get("uri"));
} }
} }

View File

@ -12,6 +12,7 @@ public abstract class ComboBoxData<T> extends FieldData<T> {
private String label; private String label;
private String value; private String value;
private String source; private String source;
private String uri;
public String getLabel() { public String getLabel() {
return label; return label;
@ -34,12 +35,21 @@ public abstract class ComboBoxData<T> extends FieldData<T> {
this.source = source; this.source = source;
} }
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
@Override @Override
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element option = doc.createElement("option"); Element option = doc.createElement("option");
option.setAttribute("label", this.label); option.setAttribute("label", this.label);
option.setAttribute("value", this.value); option.setAttribute("value", this.value);
option.setAttribute("source", this.source); option.setAttribute("source", this.source);
option.setAttribute("uri", this.uri);
return option; return option;
} }
@ -48,6 +58,7 @@ public abstract class ComboBoxData<T> extends FieldData<T> {
this.label = item.getAttribute("label"); this.label = item.getAttribute("label");
this.value = item.getAttribute("value"); this.value = item.getAttribute("value");
this.source = item.getAttribute("source"); this.source = item.getAttribute("source");
this.uri = item.getAttribute("uri");
return this; return this;
} }

View File

@ -4,11 +4,13 @@ public class ExternalAutocompleteFieldModel {
private String id; private String id;
private String label; private String label;
private String source; private String source;
private String uri;
public ExternalAutocompleteFieldModel(String id, String label, String source) { public ExternalAutocompleteFieldModel(String id, String label, String source, String uri) {
this.id = id; this.id = id;
this.label = label; this.label = label;
this.source = source; this.source = source;
this.uri = uri;
} }
public String getId() { public String getId() {
@ -31,4 +33,12 @@ public class ExternalAutocompleteFieldModel {
public void setSource(String source) { public void setSource(String source) {
this.source = source; this.source = source;
} }
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
} }

View File

@ -321,7 +321,8 @@ public class DatasetRDAExportModel {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
Map<String, Object> jsonObjectMap = jsonObject.toMap(); Map<String, Object> jsonObjectMap = jsonObject.toMap();
DatasetMetadataRDAExportModel metadataRda1 = new DatasetMetadataRDAExportModel(); DatasetMetadataRDAExportModel metadataRda1 = new DatasetMetadataRDAExportModel();
metadataRda1.setMetadata_standard_id(new IdRDAExportModel(jsonObjectMap.get("label").toString(), jsonObjectMap.get("source").toString())); // metadataRda1.setMetadata_standard_id(new IdRDAExportModel(jsonObjectMap.get("label").toString(), jsonObjectMap.get("source").toString()));
metadataRda1.setMetadata_standard_id(new IdRDAExportModel(jsonObjectMap.get("uri").toString(), "url"));
metadataRDAExportModelList.add(metadataRda1); metadataRDAExportModelList.add(metadataRda1);
} }
} }

View File

@ -0,0 +1,146 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* The DMP Contact Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"contact_id",
"mbox",
"name"
})
public class Contact implements Serializable
{
/**
* The Contact ID Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contact_id")
private ContactId contactId;
/**
* The Mailbox Schema
* <p>
* Contact Person's E-mail address
* (Required)
*
*/
@JsonProperty("mbox")
@JsonPropertyDescription("Contact Person's E-mail address")
private String mbox;
/**
* The Name Schema
* <p>
* Name of the contact person
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Name of the contact person")
private String name;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -2062619884605400321L;
/**
* The Contact ID Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contact_id")
public ContactId getContactId() {
return contactId;
}
/**
* The Contact ID Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contact_id")
public void setContactId(ContactId contactId) {
this.contactId = contactId;
}
/**
* The Mailbox Schema
* <p>
* Contact Person's E-mail address
* (Required)
*
*/
@JsonProperty("mbox")
public String getMbox() {
return mbox;
}
/**
* The Mailbox Schema
* <p>
* Contact Person's E-mail address
* (Required)
*
*/
@JsonProperty("mbox")
public void setMbox(String mbox) {
this.mbox = mbox;
}
/**
* The Name Schema
* <p>
* Name of the contact person
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* The Name Schema
* <p>
* Name of the contact person
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}

View File

@ -0,0 +1,154 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Contact ID Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class ContactId implements Serializable
{
/**
* The DMP Contact Identifier Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("identifier")
private String identifier;
/**
* The DMP Contact Identifier Type Schema
* <p>
* Identifier type. Allowed values: orcid, isni, openid, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Identifier type. Allowed values: orcid, isni, openid, other")
private ContactId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -7066973565810615822L;
/**
* The DMP Contact Identifier Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The DMP Contact Identifier Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The DMP Contact Identifier Type Schema
* <p>
* Identifier type. Allowed values: orcid, isni, openid, other
* (Required)
*
*/
@JsonProperty("type")
public ContactId.Type getType() {
return type;
}
/**
* The DMP Contact Identifier Type Schema
* <p>
* Identifier type. Allowed values: orcid, isni, openid, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(ContactId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
ORCID("orcid"),
ISNI("isni"),
OPENID("openid"),
OTHER("other");
private final String value;
private final static Map<String, ContactId.Type> CONSTANTS = new HashMap<String, ContactId.Type>();
static {
for (ContactId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static ContactId.Type fromValue(String value) {
ContactId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,181 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
/**
* The Contributor Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"contributor_id",
"mbox",
"name",
"role"
})
public class Contributor implements Serializable
{
/**
* The Contributor_id Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contributor_id")
private ContributorId contributorId;
/**
* The Contributor Mailbox Schema
* <p>
* Contributor Mail address
*
*/
@JsonProperty("mbox")
@JsonPropertyDescription("Contributor Mail address")
private String mbox;
/**
* The Name Schema
* <p>
* Name of the contributor
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Name of the contributor")
private String name;
/**
* The Role Schema
* <p>
* Type of contributor
* (Required)
*
*/
@JsonProperty("role")
@JsonDeserialize(as = java.util.LinkedHashSet.class)
@JsonPropertyDescription("Type of contributor")
private Set<String> role = null;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 3452606902359513114L;
/**
* The Contributor_id Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contributor_id")
public ContributorId getContributorId() {
return contributorId;
}
/**
* The Contributor_id Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contributor_id")
public void setContributorId(ContributorId contributorId) {
this.contributorId = contributorId;
}
/**
* The Contributor Mailbox Schema
* <p>
* Contributor Mail address
*
*/
@JsonProperty("mbox")
public String getMbox() {
return mbox;
}
/**
* The Contributor Mailbox Schema
* <p>
* Contributor Mail address
*
*/
@JsonProperty("mbox")
public void setMbox(String mbox) {
this.mbox = mbox;
}
/**
* The Name Schema
* <p>
* Name of the contributor
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* The Name Schema
* <p>
* Name of the contributor
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
/**
* The Role Schema
* <p>
* Type of contributor
* (Required)
*
*/
@JsonProperty("role")
public Set<String> getRole() {
return role;
}
/**
* The Role Schema
* <p>
* Type of contributor
* (Required)
*
*/
@JsonProperty("role")
public void setRole(Set<String> role) {
this.role = role;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}

View File

@ -0,0 +1,155 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Contributor_id Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class ContributorId implements Serializable
{
/**
* The Contributor Identifier Schema
* <p>
* Identifier for a contact person
* (Required)
*
*/
@JsonProperty("identifier")
@JsonPropertyDescription("Identifier for a contact person")
private String identifier;
/**
* The Contributor Identifier Type Schema
* <p>
* Identifier type. Allowed values: orcid, isni, openid, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Identifier type. Allowed values: orcid, isni, openid, other")
private ContributorId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 3089650417960767482L;
/**
* The Contributor Identifier Schema
* <p>
* Identifier for a contact person
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The Contributor Identifier Schema
* <p>
* Identifier for a contact person
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The Contributor Identifier Type Schema
* <p>
* Identifier type. Allowed values: orcid, isni, openid, other
* (Required)
*
*/
@JsonProperty("type")
public ContributorId.Type getType() {
return type;
}
/**
* The Contributor Identifier Type Schema
* <p>
* Identifier type. Allowed values: orcid, isni, openid, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(ContributorId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
ORCID("orcid"),
ISNI("isni"),
OPENID("openid"),
OTHER("other");
private final String value;
private final static Map<String, ContributorId.Type> CONSTANTS = new HashMap<String, ContributorId.Type>();
static {
for (ContributorId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static ContributorId.Type fromValue(String value) {
ContributorId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,374 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Cost Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"currency_code",
"description",
"title",
"value"
})
public class Cost implements Serializable
{
/**
* The Cost Currency Code Schema
* <p>
* Allowed values defined by ISO 4217
*
*/
@JsonProperty("currency_code")
@JsonPropertyDescription("Allowed values defined by ISO 4217")
private Cost.CurrencyCode currencyCode;
/**
* The Cost Description Schema
* <p>
* Cost(s) Description
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Cost(s) Description")
private String description;
/**
* The Cost Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Title")
private String title;
/**
* The Cost Value Schema
* <p>
* Value
*
*/
@JsonProperty("value")
@JsonPropertyDescription("Value")
private Double value;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -322637784848035165L;
/**
* The Cost Currency Code Schema
* <p>
* Allowed values defined by ISO 4217
*
*/
@JsonProperty("currency_code")
public Cost.CurrencyCode getCurrencyCode() {
return currencyCode;
}
/**
* The Cost Currency Code Schema
* <p>
* Allowed values defined by ISO 4217
*
*/
@JsonProperty("currency_code")
public void setCurrencyCode(Cost.CurrencyCode currencyCode) {
this.currencyCode = currencyCode;
}
/**
* The Cost Description Schema
* <p>
* Cost(s) Description
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Cost Description Schema
* <p>
* Cost(s) Description
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Cost Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The Cost Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
/**
* The Cost Value Schema
* <p>
* Value
*
*/
@JsonProperty("value")
public Double getValue() {
return value;
}
/**
* The Cost Value Schema
* <p>
* Value
*
*/
@JsonProperty("value")
public void setValue(Double value) {
this.value = value;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum CurrencyCode {
AED("AED"),
AFN("AFN"),
ALL("ALL"),
AMD("AMD"),
ANG("ANG"),
AOA("AOA"),
ARS("ARS"),
AUD("AUD"),
AWG("AWG"),
AZN("AZN"),
BAM("BAM"),
BBD("BBD"),
BDT("BDT"),
BGN("BGN"),
BHD("BHD"),
BIF("BIF"),
BMD("BMD"),
BND("BND"),
BOB("BOB"),
BRL("BRL"),
BSD("BSD"),
BTN("BTN"),
BWP("BWP"),
BYN("BYN"),
BZD("BZD"),
CAD("CAD"),
CDF("CDF"),
CHF("CHF"),
CLP("CLP"),
CNY("CNY"),
COP("COP"),
CRC("CRC"),
CUC("CUC"),
CUP("CUP"),
CVE("CVE"),
CZK("CZK"),
DJF("DJF"),
DKK("DKK"),
DOP("DOP"),
DZD("DZD"),
EGP("EGP"),
ERN("ERN"),
ETB("ETB"),
EUR("EUR"),
FJD("FJD"),
FKP("FKP"),
GBP("GBP"),
GEL("GEL"),
GGP("GGP"),
GHS("GHS"),
GIP("GIP"),
GMD("GMD"),
GNF("GNF"),
GTQ("GTQ"),
GYD("GYD"),
HKD("HKD"),
HNL("HNL"),
HRK("HRK"),
HTG("HTG"),
HUF("HUF"),
IDR("IDR"),
ILS("ILS"),
IMP("IMP"),
INR("INR"),
IQD("IQD"),
IRR("IRR"),
ISK("ISK"),
JEP("JEP"),
JMD("JMD"),
JOD("JOD"),
JPY("JPY"),
KES("KES"),
KGS("KGS"),
KHR("KHR"),
KMF("KMF"),
KPW("KPW"),
KRW("KRW"),
KWD("KWD"),
KYD("KYD"),
KZT("KZT"),
LAK("LAK"),
LBP("LBP"),
LKR("LKR"),
LRD("LRD"),
LSL("LSL"),
LYD("LYD"),
MAD("MAD"),
MDL("MDL"),
MGA("MGA"),
MKD("MKD"),
MMK("MMK"),
MNT("MNT"),
MOP("MOP"),
MRU("MRU"),
MUR("MUR"),
MVR("MVR"),
MWK("MWK"),
MXN("MXN"),
MYR("MYR"),
MZN("MZN"),
NAD("NAD"),
NGN("NGN"),
NIO("NIO"),
NOK("NOK"),
NPR("NPR"),
NZD("NZD"),
OMR("OMR"),
PAB("PAB"),
PEN("PEN"),
PGK("PGK"),
PHP("PHP"),
PKR("PKR"),
PLN("PLN"),
PYG("PYG"),
QAR("QAR"),
RON("RON"),
RSD("RSD"),
RUB("RUB"),
RWF("RWF"),
SAR("SAR"),
SBD("SBD"),
SCR("SCR"),
SDG("SDG"),
SEK("SEK"),
SGD("SGD"),
SHP("SHP"),
SLL("SLL"),
SOS("SOS"),
SPL("SPL*"),
SRD("SRD"),
STN("STN"),
SVC("SVC"),
SYP("SYP"),
SZL("SZL"),
THB("THB"),
TJS("TJS"),
TMT("TMT"),
TND("TND"),
TOP("TOP"),
TRY("TRY"),
TTD("TTD"),
TVD("TVD"),
TWD("TWD"),
TZS("TZS"),
UAH("UAH"),
UGX("UGX"),
USD("USD"),
UYU("UYU"),
UZS("UZS"),
VEF("VEF"),
VND("VND"),
VUV("VUV"),
WST("WST"),
XAF("XAF"),
XCD("XCD"),
XDR("XDR"),
XOF("XOF"),
XPF("XPF"),
YER("YER"),
ZAR("ZAR"),
ZMW("ZMW"),
ZWD("ZWD");
private final String value;
private final static Map<String, Cost.CurrencyCode> CONSTANTS = new HashMap<String, Cost.CurrencyCode>();
static {
for (Cost.CurrencyCode c: values()) {
CONSTANTS.put(c.value, c);
}
}
private CurrencyCode(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Cost.CurrencyCode fromValue(String value) {
Cost.CurrencyCode constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,839 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Dataset Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"data_quality_assurance",
"dataset_id",
"description",
"distribution",
"issued",
"keyword",
"language",
"metadata",
"personal_data",
"preservation_statement",
"security_and_privacy",
"sensitive_data",
"technical_resource",
"title",
"type"
})
public class Dataset implements Serializable
{
/**
* The Data Quality Assurance Schema
* <p>
* Data Quality Assurance
*
*/
@JsonProperty("data_quality_assurance")
@JsonPropertyDescription("Data Quality Assurance")
private List<String> dataQualityAssurance = null;
/**
* The Dataset ID Schema
* <p>
* Dataset ID
* (Required)
*
*/
@JsonProperty("dataset_id")
@JsonPropertyDescription("Dataset ID")
private DatasetId datasetId;
/**
* The Dataset Description Schema
* <p>
* Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.")
private String description;
/**
* The Dataset Distribution Schema
* <p>
* To provide technical information on a specific instance of data.
*
*/
@JsonProperty("distribution")
@JsonPropertyDescription("To provide technical information on a specific instance of data.")
private List<Distribution> distribution = null;
/**
* The Dataset Date of Issue Schema
* <p>
* Date of Issue
*
*/
@JsonProperty("issued")
@JsonPropertyDescription("Date of Issue")
private String issued;
/**
* The Dataset Keyword(s) Schema
* <p>
* Keywords
*
*/
@JsonProperty("keyword")
@JsonPropertyDescription("Keywords")
private List<String> keyword = null;
/**
* The Dataset Language Schema
* <p>
* Language of the dataset expressed using ISO 639-3.
*
*/
@JsonProperty("language")
@JsonPropertyDescription("Language of the dataset expressed using ISO 639-3.")
private Dataset.Language language;
/**
* The Dataset Metadata Schema
* <p>
* To describe metadata standards used.
*
*/
@JsonProperty("metadata")
@JsonPropertyDescription("To describe metadata standards used.")
private List<Metadatum> metadata = null;
/**
* The Dataset Personal Data Schema
* <p>
* If any personal data is contained. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("personal_data")
@JsonPropertyDescription("If any personal data is contained. Allowed values: yes, no, unknown")
private Dataset.PersonalData personalData;
/**
* The Dataset Preservation Statement Schema
* <p>
* Preservation Statement
*
*/
@JsonProperty("preservation_statement")
@JsonPropertyDescription("Preservation Statement")
private String preservationStatement;
/**
* The Dataset Security and Policy Schema
* <p>
* To list all issues and requirements related to security and privacy
*
*/
@JsonProperty("security_and_privacy")
@JsonPropertyDescription("To list all issues and requirements related to security and privacy")
private List<SecurityAndPrivacy> securityAndPrivacy = null;
/**
* The Dataset Sensitive Data Schema
* <p>
* If any sensitive data is contained. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("sensitive_data")
@JsonPropertyDescription("If any sensitive data is contained. Allowed values: yes, no, unknown")
private Dataset.SensitiveData sensitiveData;
/**
* The Dataset Technical Resource Schema
* <p>
* To list all technical resources needed to implement a DMP
*
*/
@JsonProperty("technical_resource")
@JsonPropertyDescription("To list all technical resources needed to implement a DMP")
private List<TechnicalResource> technicalResource = null;
/**
* The Dataset Title Schema
* <p>
* Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.")
private String title;
/**
* The Dataset Type Schema
* <p>
* If appropriate, type according to: DataCite and/or COAR dictionary. Otherwise use the common name for the type, e.g. raw data, software, survey, etc. https://schema.datacite.org/meta/kernel-4.1/doc/DataCite-MetadataKernel_v4.1.pdf http://vocabularies.coar-repositories.org/pubby/resource_type.html
*
*/
@JsonProperty("type")
@JsonPropertyDescription("If appropriate, type according to: DataCite and/or COAR dictionary. Otherwise use the common name for the type, e.g. raw data, software, survey, etc. https://schema.datacite.org/meta/kernel-4.1/doc/DataCite-MetadataKernel_v4.1.pdf http://vocabularies.coar-repositories.org/pubby/resource_type.html")
private String type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -6931119120629009399L;
/**
* The Data Quality Assurance Schema
* <p>
* Data Quality Assurance
*
*/
@JsonProperty("data_quality_assurance")
public List<String> getDataQualityAssurance() {
return dataQualityAssurance;
}
/**
* The Data Quality Assurance Schema
* <p>
* Data Quality Assurance
*
*/
@JsonProperty("data_quality_assurance")
public void setDataQualityAssurance(List<String> dataQualityAssurance) {
this.dataQualityAssurance = dataQualityAssurance;
}
/**
* The Dataset ID Schema
* <p>
* Dataset ID
* (Required)
*
*/
@JsonProperty("dataset_id")
public DatasetId getDatasetId() {
return datasetId;
}
/**
* The Dataset ID Schema
* <p>
* Dataset ID
* (Required)
*
*/
@JsonProperty("dataset_id")
public void setDatasetId(DatasetId datasetId) {
this.datasetId = datasetId;
}
/**
* The Dataset Description Schema
* <p>
* Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Dataset Description Schema
* <p>
* Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Dataset Distribution Schema
* <p>
* To provide technical information on a specific instance of data.
*
*/
@JsonProperty("distribution")
public List<Distribution> getDistribution() {
return distribution;
}
/**
* The Dataset Distribution Schema
* <p>
* To provide technical information on a specific instance of data.
*
*/
@JsonProperty("distribution")
public void setDistribution(List<Distribution> distribution) {
this.distribution = distribution;
}
/**
* The Dataset Date of Issue Schema
* <p>
* Date of Issue
*
*/
@JsonProperty("issued")
public String getIssued() {
return issued;
}
/**
* The Dataset Date of Issue Schema
* <p>
* Date of Issue
*
*/
@JsonProperty("issued")
public void setIssued(String issued) {
this.issued = issued;
}
/**
* The Dataset Keyword(s) Schema
* <p>
* Keywords
*
*/
@JsonProperty("keyword")
public List<String> getKeyword() {
return keyword;
}
/**
* The Dataset Keyword(s) Schema
* <p>
* Keywords
*
*/
@JsonProperty("keyword")
public void setKeyword(List<String> keyword) {
this.keyword = keyword;
}
/**
* The Dataset Language Schema
* <p>
* Language of the dataset expressed using ISO 639-3.
*
*/
@JsonProperty("language")
public Dataset.Language getLanguage() {
return language;
}
/**
* The Dataset Language Schema
* <p>
* Language of the dataset expressed using ISO 639-3.
*
*/
@JsonProperty("language")
public void setLanguage(Dataset.Language language) {
this.language = language;
}
/**
* The Dataset Metadata Schema
* <p>
* To describe metadata standards used.
*
*/
@JsonProperty("metadata")
public List<Metadatum> getMetadata() {
return metadata;
}
/**
* The Dataset Metadata Schema
* <p>
* To describe metadata standards used.
*
*/
@JsonProperty("metadata")
public void setMetadata(List<Metadatum> metadata) {
this.metadata = metadata;
}
/**
* The Dataset Personal Data Schema
* <p>
* If any personal data is contained. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("personal_data")
public Dataset.PersonalData getPersonalData() {
return personalData;
}
/**
* The Dataset Personal Data Schema
* <p>
* If any personal data is contained. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("personal_data")
public void setPersonalData(Dataset.PersonalData personalData) {
this.personalData = personalData;
}
/**
* The Dataset Preservation Statement Schema
* <p>
* Preservation Statement
*
*/
@JsonProperty("preservation_statement")
public String getPreservationStatement() {
return preservationStatement;
}
/**
* The Dataset Preservation Statement Schema
* <p>
* Preservation Statement
*
*/
@JsonProperty("preservation_statement")
public void setPreservationStatement(String preservationStatement) {
this.preservationStatement = preservationStatement;
}
/**
* The Dataset Security and Policy Schema
* <p>
* To list all issues and requirements related to security and privacy
*
*/
@JsonProperty("security_and_privacy")
public List<SecurityAndPrivacy> getSecurityAndPrivacy() {
return securityAndPrivacy;
}
/**
* The Dataset Security and Policy Schema
* <p>
* To list all issues and requirements related to security and privacy
*
*/
@JsonProperty("security_and_privacy")
public void setSecurityAndPrivacy(List<SecurityAndPrivacy> securityAndPrivacy) {
this.securityAndPrivacy = securityAndPrivacy;
}
/**
* The Dataset Sensitive Data Schema
* <p>
* If any sensitive data is contained. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("sensitive_data")
public Dataset.SensitiveData getSensitiveData() {
return sensitiveData;
}
/**
* The Dataset Sensitive Data Schema
* <p>
* If any sensitive data is contained. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("sensitive_data")
public void setSensitiveData(Dataset.SensitiveData sensitiveData) {
this.sensitiveData = sensitiveData;
}
/**
* The Dataset Technical Resource Schema
* <p>
* To list all technical resources needed to implement a DMP
*
*/
@JsonProperty("technical_resource")
public List<TechnicalResource> getTechnicalResource() {
return technicalResource;
}
/**
* The Dataset Technical Resource Schema
* <p>
* To list all technical resources needed to implement a DMP
*
*/
@JsonProperty("technical_resource")
public void setTechnicalResource(List<TechnicalResource> technicalResource) {
this.technicalResource = technicalResource;
}
/**
* The Dataset Title Schema
* <p>
* Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The Dataset Title Schema
* <p>
* Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
/**
* The Dataset Type Schema
* <p>
* If appropriate, type according to: DataCite and/or COAR dictionary. Otherwise use the common name for the type, e.g. raw data, software, survey, etc. https://schema.datacite.org/meta/kernel-4.1/doc/DataCite-MetadataKernel_v4.1.pdf http://vocabularies.coar-repositories.org/pubby/resource_type.html
*
*/
@JsonProperty("type")
public String getType() {
return type;
}
/**
* The Dataset Type Schema
* <p>
* If appropriate, type according to: DataCite and/or COAR dictionary. Otherwise use the common name for the type, e.g. raw data, software, survey, etc. https://schema.datacite.org/meta/kernel-4.1/doc/DataCite-MetadataKernel_v4.1.pdf http://vocabularies.coar-repositories.org/pubby/resource_type.html
*
*/
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Language {
AAR("aar"),
ABK("abk"),
AFR("afr"),
AKA("aka"),
AMH("amh"),
ARA("ara"),
ARG("arg"),
ASM("asm"),
AVA("ava"),
AVE("ave"),
AYM("aym"),
AZE("aze"),
BAK("bak"),
BAM("bam"),
BEL("bel"),
BEN("ben"),
BIH("bih"),
BIS("bis"),
BOD("bod"),
BOS("bos"),
BRE("bre"),
BUL("bul"),
CAT("cat"),
CES("ces"),
CHA("cha"),
CHE("che"),
CHU("chu"),
CHV("chv"),
COR("cor"),
COS("cos"),
CRE("cre"),
CYM("cym"),
DAN("dan"),
DEU("deu"),
DIV("div"),
DZO("dzo"),
ELL("ell"),
ENG("eng"),
EPO("epo"),
EST("est"),
EUS("eus"),
EWE("ewe"),
FAO("fao"),
FAS("fas"),
FIJ("fij"),
FIN("fin"),
FRA("fra"),
FRY("fry"),
FUL("ful"),
GLA("gla"),
GLE("gle"),
GLG("glg"),
GLV("glv"),
GRN("grn"),
GUJ("guj"),
HAT("hat"),
HAU("hau"),
HBS("hbs"),
HEB("heb"),
HER("her"),
HIN("hin"),
HMO("hmo"),
HRV("hrv"),
HUN("hun"),
HYE("hye"),
IBO("ibo"),
IDO("ido"),
III("iii"),
IKU("iku"),
ILE("ile"),
INA("ina"),
IND("ind"),
IPK("ipk"),
ISL("isl"),
ITA("ita"),
JAV("jav"),
JPN("jpn"),
KAL("kal"),
KAN("kan"),
KAS("kas"),
KAT("kat"),
KAU("kau"),
KAZ("kaz"),
KHM("khm"),
KIK("kik"),
KIN("kin"),
KIR("kir"),
KOM("kom"),
KON("kon"),
KOR("kor"),
KUA("kua"),
KUR("kur"),
LAO("lao"),
LAT("lat"),
LAV("lav"),
LIM("lim"),
LIN("lin"),
LIT("lit"),
LTZ("ltz"),
LUB("lub"),
LUG("lug"),
MAH("mah"),
MAL("mal"),
MAR("mar"),
MKD("mkd"),
MLG("mlg"),
MLT("mlt"),
MON("mon"),
MRI("mri"),
MSA("msa"),
MYA("mya"),
NAU("nau"),
NAV("nav"),
NBL("nbl"),
NDE("nde"),
NDO("ndo"),
NEP("nep"),
NLD("nld"),
NNO("nno"),
NOB("nob"),
NOR("nor"),
NYA("nya"),
OCI("oci"),
OJI("oji"),
ORI("ori"),
ORM("orm"),
OSS("oss"),
PAN("pan"),
PLI("pli"),
POL("pol"),
POR("por"),
PUS("pus"),
QUE("que"),
ROH("roh"),
RON("ron"),
RUN("run"),
RUS("rus"),
SAG("sag"),
SAN("san"),
SIN("sin"),
SLK("slk"),
SLV("slv"),
SME("sme"),
SMO("smo"),
SNA("sna"),
SND("snd"),
SOM("som"),
SOT("sot"),
SPA("spa"),
SQI("sqi"),
SRD("srd"),
SRP("srp"),
SSW("ssw"),
SUN("sun"),
SWA("swa"),
SWE("swe"),
TAH("tah"),
TAM("tam"),
TAT("tat"),
TEL("tel"),
TGK("tgk"),
TGL("tgl"),
THA("tha"),
TIR("tir"),
TON("ton"),
TSN("tsn"),
TSO("tso"),
TUK("tuk"),
TUR("tur"),
TWI("twi"),
UIG("uig"),
UKR("ukr"),
URD("urd"),
UZB("uzb"),
VEN("ven"),
VIE("vie"),
VOL("vol"),
WLN("wln"),
WOL("wol"),
XHO("xho"),
YID("yid"),
YOR("yor"),
ZHA("zha"),
ZHO("zho"),
ZUL("zul");
private final String value;
private final static Map<String, Dataset.Language> CONSTANTS = new HashMap<String, Dataset.Language>();
static {
for (Dataset.Language c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Language(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Dataset.Language fromValue(String value) {
Dataset.Language constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
public enum PersonalData {
YES("yes"),
NO("no"),
UNKNOWN("unknown");
private final String value;
private final static Map<String, Dataset.PersonalData> CONSTANTS = new HashMap<String, Dataset.PersonalData>();
static {
for (Dataset.PersonalData c: values()) {
CONSTANTS.put(c.value, c);
}
}
private PersonalData(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Dataset.PersonalData fromValue(String value) {
Dataset.PersonalData constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
public enum SensitiveData {
YES("yes"),
NO("no"),
UNKNOWN("unknown");
private final String value;
private final static Map<String, Dataset.SensitiveData> CONSTANTS = new HashMap<String, Dataset.SensitiveData>();
static {
for (Dataset.SensitiveData c: values()) {
CONSTANTS.put(c.value, c);
}
}
private SensitiveData(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Dataset.SensitiveData fromValue(String value) {
Dataset.SensitiveData constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,156 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Dataset ID Schema
* <p>
* Dataset ID
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class DatasetId implements Serializable
{
/**
* The Dataset Identifier Schema
* <p>
* Identifier for a dataset
* (Required)
*
*/
@JsonProperty("identifier")
@JsonPropertyDescription("Identifier for a dataset")
private String identifier;
/**
* The Dataset Identifier Type Schema
* <p>
* Dataset identifier type. Allowed values: handle, doi, ark, url, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Dataset identifier type. Allowed values: handle, doi, ark, url, other")
private DatasetId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -6295164005851378031L;
/**
* The Dataset Identifier Schema
* <p>
* Identifier for a dataset
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The Dataset Identifier Schema
* <p>
* Identifier for a dataset
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The Dataset Identifier Type Schema
* <p>
* Dataset identifier type. Allowed values: handle, doi, ark, url, other
* (Required)
*
*/
@JsonProperty("type")
public DatasetId.Type getType() {
return type;
}
/**
* The Dataset Identifier Type Schema
* <p>
* Dataset identifier type. Allowed values: handle, doi, ark, url, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(DatasetId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
HANDLE("handle"),
DOI("doi"),
ARK("ark"),
URL("url"),
OTHER("other");
private final String value;
private final static Map<String, DatasetId.Type> CONSTANTS = new HashMap<String, DatasetId.Type>();
static {
for (DatasetId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static DatasetId.Type fromValue(String value) {
DatasetId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,412 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Dataset Distribution Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"access_url",
"available_until",
"byte_size",
"data_access",
"description",
"download_url",
"format",
"host",
"license",
"title"
})
public class Distribution implements Serializable
{
/**
* The Dataset Distribution Access URL Schema
* <p>
* A URL of the resource that gives access to a distribution of the dataset. e.g. landing page.
*
*/
@JsonProperty("access_url")
@JsonPropertyDescription("A URL of the resource that gives access to a distribution of the dataset. e.g. landing page.")
private String accessUrl;
/**
* The Dataset Distribution Available Until Schema
* <p>
* Indicates how long this distribution will be / should be available.
*
*/
@JsonProperty("available_until")
@JsonPropertyDescription("Indicates how long this distribution will be / should be available.")
private String availableUntil;
/**
* The Dataset Distribution Byte Size Schema
* <p>
* Size in bytes.
*
*/
@JsonProperty("byte_size")
@JsonPropertyDescription("Size in bytes.")
private Integer byteSize;
/**
* The Dataset Distribution Data Access Schema
* <p>
* Indicates access mode for data. Allowed values: open, shared, closed
* (Required)
*
*/
@JsonProperty("data_access")
@JsonPropertyDescription("Indicates access mode for data. Allowed values: open, shared, closed")
private Distribution.DataAccess dataAccess;
/**
* The Dataset Distribution Description Schema
* <p>
* Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.")
private String description;
/**
* The Dataset Distribution Download URL Schema
* <p>
* The URL of the downloadable file in a given format. E.g. CSV file or RDF file.
*
*/
@JsonProperty("download_url")
@JsonPropertyDescription("The URL of the downloadable file in a given format. E.g. CSV file or RDF file.")
private URI downloadUrl;
/**
* The Dataset Distribution Format Schema
* <p>
* Format according to: https://www.iana.org/assignments/media-types/media-types.xhtml if appropriate, otherwise use the common name for this format.
*
*/
@JsonProperty("format")
@JsonPropertyDescription("Format according to: https://www.iana.org/assignments/media-types/media-types.xhtml if appropriate, otherwise use the common name for this format.")
private List<String> format = null;
/**
* The Dataset Distribution Host Schema
* <p>
* To provide information on quality of service provided by infrastructure (e.g. repository) where data is stored.
*
*/
@JsonProperty("host")
@JsonPropertyDescription("To provide information on quality of service provided by infrastructure (e.g. repository) where data is stored.")
private Host host;
/**
* The Dataset Distribution License(s) Schema
* <p>
* To list all licenses applied to a specific distribution of data.
*
*/
@JsonProperty("license")
@JsonPropertyDescription("To list all licenses applied to a specific distribution of data.")
private List<License> license = null;
/**
* The Dataset Distribution Title Schema
* <p>
* Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.")
private String title;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -6018365280419917902L;
/**
* The Dataset Distribution Access URL Schema
* <p>
* A URL of the resource that gives access to a distribution of the dataset. e.g. landing page.
*
*/
@JsonProperty("access_url")
public String getAccessUrl() {
return accessUrl;
}
/**
* The Dataset Distribution Access URL Schema
* <p>
* A URL of the resource that gives access to a distribution of the dataset. e.g. landing page.
*
*/
@JsonProperty("access_url")
public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl;
}
/**
* The Dataset Distribution Available Until Schema
* <p>
* Indicates how long this distribution will be / should be available.
*
*/
@JsonProperty("available_until")
public String getAvailableUntil() {
return availableUntil;
}
/**
* The Dataset Distribution Available Until Schema
* <p>
* Indicates how long this distribution will be / should be available.
*
*/
@JsonProperty("available_until")
public void setAvailableUntil(String availableUntil) {
this.availableUntil = availableUntil;
}
/**
* The Dataset Distribution Byte Size Schema
* <p>
* Size in bytes.
*
*/
@JsonProperty("byte_size")
public Integer getByteSize() {
return byteSize;
}
/**
* The Dataset Distribution Byte Size Schema
* <p>
* Size in bytes.
*
*/
@JsonProperty("byte_size")
public void setByteSize(Integer byteSize) {
this.byteSize = byteSize;
}
/**
* The Dataset Distribution Data Access Schema
* <p>
* Indicates access mode for data. Allowed values: open, shared, closed
* (Required)
*
*/
@JsonProperty("data_access")
public Distribution.DataAccess getDataAccess() {
return dataAccess;
}
/**
* The Dataset Distribution Data Access Schema
* <p>
* Indicates access mode for data. Allowed values: open, shared, closed
* (Required)
*
*/
@JsonProperty("data_access")
public void setDataAccess(Distribution.DataAccess dataAccess) {
this.dataAccess = dataAccess;
}
/**
* The Dataset Distribution Description Schema
* <p>
* Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Dataset Distribution Description Schema
* <p>
* Description is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Dataset Distribution Download URL Schema
* <p>
* The URL of the downloadable file in a given format. E.g. CSV file or RDF file.
*
*/
@JsonProperty("download_url")
public URI getDownloadUrl() {
return downloadUrl;
}
/**
* The Dataset Distribution Download URL Schema
* <p>
* The URL of the downloadable file in a given format. E.g. CSV file or RDF file.
*
*/
@JsonProperty("download_url")
public void setDownloadUrl(URI downloadUrl) {
this.downloadUrl = downloadUrl;
}
/**
* The Dataset Distribution Format Schema
* <p>
* Format according to: https://www.iana.org/assignments/media-types/media-types.xhtml if appropriate, otherwise use the common name for this format.
*
*/
@JsonProperty("format")
public List<String> getFormat() {
return format;
}
/**
* The Dataset Distribution Format Schema
* <p>
* Format according to: https://www.iana.org/assignments/media-types/media-types.xhtml if appropriate, otherwise use the common name for this format.
*
*/
@JsonProperty("format")
public void setFormat(List<String> format) {
this.format = format;
}
/**
* The Dataset Distribution Host Schema
* <p>
* To provide information on quality of service provided by infrastructure (e.g. repository) where data is stored.
*
*/
@JsonProperty("host")
public Host getHost() {
return host;
}
/**
* The Dataset Distribution Host Schema
* <p>
* To provide information on quality of service provided by infrastructure (e.g. repository) where data is stored.
*
*/
@JsonProperty("host")
public void setHost(Host host) {
this.host = host;
}
/**
* The Dataset Distribution License(s) Schema
* <p>
* To list all licenses applied to a specific distribution of data.
*
*/
@JsonProperty("license")
public List<License> getLicense() {
return license;
}
/**
* The Dataset Distribution License(s) Schema
* <p>
* To list all licenses applied to a specific distribution of data.
*
*/
@JsonProperty("license")
public void setLicense(List<License> license) {
this.license = license;
}
/**
* The Dataset Distribution Title Schema
* <p>
* Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The Dataset Distribution Title Schema
* <p>
* Title is a property in both Dataset and Distribution, in compliance with W3C DCAT. In some cases these might be identical, but in most cases the Dataset represents a more abstract concept, while the distribution can point to a specific file.
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum DataAccess {
OPEN("open"),
SHARED("shared"),
CLOSED("closed");
private final String value;
private final static Map<String, Distribution.DataAccess> CONSTANTS = new HashMap<String, Distribution.DataAccess>();
static {
for (Distribution.DataAccess c: values()) {
CONSTANTS.put(c.value, c);
}
}
private DataAccess(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Distribution.DataAccess fromValue(String value) {
Distribution.DataAccess constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,774 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.net.URI;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The DMP Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"contact",
"contributor",
"cost",
"created",
"dataset",
"description",
"dmp_id",
"ethical_issues_description",
"ethical_issues_exist",
"ethical_issues_report",
"language",
"modified",
"project",
"title"
})
public class Dmp implements Serializable
{
/**
* The DMP Contact Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contact")
private Contact contact;
/**
* The Contributor Schema
* <p>
*
*
*/
@JsonProperty("contributor")
private List<Contributor> contributor = null;
/**
* The Cost Schema
* <p>
*
*
*/
@JsonProperty("cost")
private List<Cost> cost = null;
/**
* The DMP Creation Schema
* <p>
*
*
*/
@JsonProperty("created")
@JsonPropertyDescription("")
private Date created;
/**
* The Dataset Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("dataset")
private List<Dataset> dataset = null;
/**
* The DMP Description Schema
* <p>
* To provide any free-form text information on a DMP
*
*/
@JsonProperty("description")
@JsonPropertyDescription("To provide any free-form text information on a DMP")
private String description;
/**
* The DMP Identifier Schema
* <p>
* Identifier for the DMP itself
* (Required)
*
*/
@JsonProperty("dmp_id")
@JsonPropertyDescription("Identifier for the DMP itself")
private DmpId dmpId;
/**
* The DMP Ethical Issues Description Schema
* <p>
* To describe ethical issues directly in a DMP
*
*/
@JsonProperty("ethical_issues_description")
@JsonPropertyDescription("To describe ethical issues directly in a DMP")
private String ethicalIssuesDescription;
/**
* The DMP Ethical Issues Exist Schema
* <p>
* To indicate whether there are ethical issues related to data that this DMP describes. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("ethical_issues_exist")
@JsonPropertyDescription("To indicate whether there are ethical issues related to data that this DMP describes. Allowed values: yes, no, unknown")
private Dmp.EthicalIssuesExist ethicalIssuesExist;
/**
* The DMP Ethical Issues Report Schema
* <p>
* To indicate where a protocol from a meeting with an ethical commitee can be found
*
*/
@JsonProperty("ethical_issues_report")
@JsonPropertyDescription("To indicate where a protocol from a meeting with an ethical commitee can be found")
private URI ethicalIssuesReport;
/**
* The DMP Language Schema
* <p>
* Language of the DMP expressed using ISO 639-3.
* (Required)
*
*/
@JsonProperty("language")
@JsonPropertyDescription("Language of the DMP expressed using ISO 639-3.")
private Dmp.Language language;
/**
* The DMP Modification Schema
* <p>
* Must be set each time DMP is modified. Indicates DMP version.
* (Required)
*
*/
@JsonProperty("modified")
@JsonPropertyDescription("Must be set each time DMP is modified. Indicates DMP version.")
private Date modified;
/**
* The DMP Project Schema
* <p>
* Project related to a DMP
*
*/
@JsonProperty("project")
@JsonPropertyDescription("Project related to a DMP")
private List<Project> project = null;
/**
* The DMP Title Schema
* <p>
* Title of a DMP
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Title of a DMP")
private String title;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 4599713332472772292L;
/**
* The DMP Contact Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contact")
public Contact getContact() {
return contact;
}
/**
* The DMP Contact Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("contact")
public void setContact(Contact contact) {
this.contact = contact;
}
/**
* The Contributor Schema
* <p>
*
*
*/
@JsonProperty("contributor")
public List<Contributor> getContributor() {
return contributor;
}
/**
* The Contributor Schema
* <p>
*
*
*/
@JsonProperty("contributor")
public void setContributor(List<Contributor> contributor) {
this.contributor = contributor;
}
/**
* The Cost Schema
* <p>
*
*
*/
@JsonProperty("cost")
public List<Cost> getCost() {
return cost;
}
/**
* The Cost Schema
* <p>
*
*
*/
@JsonProperty("cost")
public void setCost(List<Cost> cost) {
this.cost = cost;
}
/**
* The DMP Creation Schema
* <p>
*
*
*/
@JsonProperty("created")
public Date getCreated() {
return created;
}
/**
* The DMP Creation Schema
* <p>
*
*
*/
@JsonProperty("created")
public void setCreated(Date created) {
this.created = created;
}
/**
* The Dataset Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("dataset")
public List<Dataset> getDataset() {
return dataset;
}
/**
* The Dataset Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("dataset")
public void setDataset(List<Dataset> dataset) {
this.dataset = dataset;
}
/**
* The DMP Description Schema
* <p>
* To provide any free-form text information on a DMP
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The DMP Description Schema
* <p>
* To provide any free-form text information on a DMP
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The DMP Identifier Schema
* <p>
* Identifier for the DMP itself
* (Required)
*
*/
@JsonProperty("dmp_id")
public DmpId getDmpId() {
return dmpId;
}
/**
* The DMP Identifier Schema
* <p>
* Identifier for the DMP itself
* (Required)
*
*/
@JsonProperty("dmp_id")
public void setDmpId(DmpId dmpId) {
this.dmpId = dmpId;
}
/**
* The DMP Ethical Issues Description Schema
* <p>
* To describe ethical issues directly in a DMP
*
*/
@JsonProperty("ethical_issues_description")
public String getEthicalIssuesDescription() {
return ethicalIssuesDescription;
}
/**
* The DMP Ethical Issues Description Schema
* <p>
* To describe ethical issues directly in a DMP
*
*/
@JsonProperty("ethical_issues_description")
public void setEthicalIssuesDescription(String ethicalIssuesDescription) {
this.ethicalIssuesDescription = ethicalIssuesDescription;
}
/**
* The DMP Ethical Issues Exist Schema
* <p>
* To indicate whether there are ethical issues related to data that this DMP describes. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("ethical_issues_exist")
public Dmp.EthicalIssuesExist getEthicalIssuesExist() {
return ethicalIssuesExist;
}
/**
* The DMP Ethical Issues Exist Schema
* <p>
* To indicate whether there are ethical issues related to data that this DMP describes. Allowed values: yes, no, unknown
* (Required)
*
*/
@JsonProperty("ethical_issues_exist")
public void setEthicalIssuesExist(Dmp.EthicalIssuesExist ethicalIssuesExist) {
this.ethicalIssuesExist = ethicalIssuesExist;
}
/**
* The DMP Ethical Issues Report Schema
* <p>
* To indicate where a protocol from a meeting with an ethical commitee can be found
*
*/
@JsonProperty("ethical_issues_report")
public URI getEthicalIssuesReport() {
return ethicalIssuesReport;
}
/**
* The DMP Ethical Issues Report Schema
* <p>
* To indicate where a protocol from a meeting with an ethical commitee can be found
*
*/
@JsonProperty("ethical_issues_report")
public void setEthicalIssuesReport(URI ethicalIssuesReport) {
this.ethicalIssuesReport = ethicalIssuesReport;
}
/**
* The DMP Language Schema
* <p>
* Language of the DMP expressed using ISO 639-3.
* (Required)
*
*/
@JsonProperty("language")
public Dmp.Language getLanguage() {
return language;
}
/**
* The DMP Language Schema
* <p>
* Language of the DMP expressed using ISO 639-3.
* (Required)
*
*/
@JsonProperty("language")
public void setLanguage(Dmp.Language language) {
this.language = language;
}
/**
* The DMP Modification Schema
* <p>
* Must be set each time DMP is modified. Indicates DMP version.
* (Required)
*
*/
@JsonProperty("modified")
public Date getModified() {
return modified;
}
/**
* The DMP Modification Schema
* <p>
* Must be set each time DMP is modified. Indicates DMP version.
* (Required)
*
*/
@JsonProperty("modified")
public void setModified(Date modified) {
this.modified = modified;
}
/**
* The DMP Project Schema
* <p>
* Project related to a DMP
*
*/
@JsonProperty("project")
public List<Project> getProject() {
return project;
}
/**
* The DMP Project Schema
* <p>
* Project related to a DMP
*
*/
@JsonProperty("project")
public void setProject(List<Project> project) {
this.project = project;
}
/**
* The DMP Title Schema
* <p>
* Title of a DMP
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The DMP Title Schema
* <p>
* Title of a DMP
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum EthicalIssuesExist {
YES("yes"),
NO("no"),
UNKNOWN("unknown");
private final String value;
private final static Map<String, Dmp.EthicalIssuesExist> CONSTANTS = new HashMap<String, Dmp.EthicalIssuesExist>();
static {
for (Dmp.EthicalIssuesExist c: values()) {
CONSTANTS.put(c.value, c);
}
}
private EthicalIssuesExist(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Dmp.EthicalIssuesExist fromValue(String value) {
Dmp.EthicalIssuesExist constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
public enum Language {
AAR("aar"),
ABK("abk"),
AFR("afr"),
AKA("aka"),
AMH("amh"),
ARA("ara"),
ARG("arg"),
ASM("asm"),
AVA("ava"),
AVE("ave"),
AYM("aym"),
AZE("aze"),
BAK("bak"),
BAM("bam"),
BEL("bel"),
BEN("ben"),
BIH("bih"),
BIS("bis"),
BOD("bod"),
BOS("bos"),
BRE("bre"),
BUL("bul"),
CAT("cat"),
CES("ces"),
CHA("cha"),
CHE("che"),
CHU("chu"),
CHV("chv"),
COR("cor"),
COS("cos"),
CRE("cre"),
CYM("cym"),
DAN("dan"),
DEU("deu"),
DIV("div"),
DZO("dzo"),
ELL("ell"),
ENG("eng"),
EPO("epo"),
EST("est"),
EUS("eus"),
EWE("ewe"),
FAO("fao"),
FAS("fas"),
FIJ("fij"),
FIN("fin"),
FRA("fra"),
FRY("fry"),
FUL("ful"),
GLA("gla"),
GLE("gle"),
GLG("glg"),
GLV("glv"),
GRN("grn"),
GUJ("guj"),
HAT("hat"),
HAU("hau"),
HBS("hbs"),
HEB("heb"),
HER("her"),
HIN("hin"),
HMO("hmo"),
HRV("hrv"),
HUN("hun"),
HYE("hye"),
IBO("ibo"),
IDO("ido"),
III("iii"),
IKU("iku"),
ILE("ile"),
INA("ina"),
IND("ind"),
IPK("ipk"),
ISL("isl"),
ITA("ita"),
JAV("jav"),
JPN("jpn"),
KAL("kal"),
KAN("kan"),
KAS("kas"),
KAT("kat"),
KAU("kau"),
KAZ("kaz"),
KHM("khm"),
KIK("kik"),
KIN("kin"),
KIR("kir"),
KOM("kom"),
KON("kon"),
KOR("kor"),
KUA("kua"),
KUR("kur"),
LAO("lao"),
LAT("lat"),
LAV("lav"),
LIM("lim"),
LIN("lin"),
LIT("lit"),
LTZ("ltz"),
LUB("lub"),
LUG("lug"),
MAH("mah"),
MAL("mal"),
MAR("mar"),
MKD("mkd"),
MLG("mlg"),
MLT("mlt"),
MON("mon"),
MRI("mri"),
MSA("msa"),
MYA("mya"),
NAU("nau"),
NAV("nav"),
NBL("nbl"),
NDE("nde"),
NDO("ndo"),
NEP("nep"),
NLD("nld"),
NNO("nno"),
NOB("nob"),
NOR("nor"),
NYA("nya"),
OCI("oci"),
OJI("oji"),
ORI("ori"),
ORM("orm"),
OSS("oss"),
PAN("pan"),
PLI("pli"),
POL("pol"),
POR("por"),
PUS("pus"),
QUE("que"),
ROH("roh"),
RON("ron"),
RUN("run"),
RUS("rus"),
SAG("sag"),
SAN("san"),
SIN("sin"),
SLK("slk"),
SLV("slv"),
SME("sme"),
SMO("smo"),
SNA("sna"),
SND("snd"),
SOM("som"),
SOT("sot"),
SPA("spa"),
SQI("sqi"),
SRD("srd"),
SRP("srp"),
SSW("ssw"),
SUN("sun"),
SWA("swa"),
SWE("swe"),
TAH("tah"),
TAM("tam"),
TAT("tat"),
TEL("tel"),
TGK("tgk"),
TGL("tgl"),
THA("tha"),
TIR("tir"),
TON("ton"),
TSN("tsn"),
TSO("tso"),
TUK("tuk"),
TUR("tur"),
TWI("twi"),
UIG("uig"),
UKR("ukr"),
URD("urd"),
UZB("uzb"),
VEN("ven"),
VIE("vie"),
VOL("vol"),
WLN("wln"),
WOL("wol"),
XHO("xho"),
YID("yid"),
YOR("yor"),
ZHA("zha"),
ZHO("zho"),
ZUL("zul");
private final String value;
private final static Map<String, Dmp.Language> CONSTANTS = new HashMap<String, Dmp.Language>();
static {
for (Dmp.Language c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Language(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Dmp.Language fromValue(String value) {
Dmp.Language constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,156 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The DMP Identifier Schema
* <p>
* Identifier for the DMP itself
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class DmpId implements Serializable
{
/**
* The DMP Identifier Value Schema
* <p>
* Identifier for a DMP
* (Required)
*
*/
@JsonProperty("identifier")
@JsonPropertyDescription("Identifier for a DMP")
private String identifier;
/**
* The DMP Identifier Type Schema
* <p>
* The DMP Identifier Type. Allowed values: handle, doi, ark, url, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("The DMP Identifier Type. Allowed values: handle, doi, ark, url, other")
private DmpId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -6059908070202476841L;
/**
* The DMP Identifier Value Schema
* <p>
* Identifier for a DMP
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The DMP Identifier Value Schema
* <p>
* Identifier for a DMP
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The DMP Identifier Type Schema
* <p>
* The DMP Identifier Type. Allowed values: handle, doi, ark, url, other
* (Required)
*
*/
@JsonProperty("type")
public DmpId.Type getType() {
return type;
}
/**
* The DMP Identifier Type Schema
* <p>
* The DMP Identifier Type. Allowed values: handle, doi, ark, url, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(DmpId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
HANDLE("handle"),
DOI("doi"),
ARK("ark"),
URL("url"),
OTHER("other");
private final String value;
private final static Map<String, DmpId.Type> CONSTANTS = new HashMap<String, DmpId.Type>();
static {
for (DmpId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static DmpId.Type fromValue(String value) {
DmpId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,154 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Funder ID Schema
* <p>
* Funder ID of the associated project
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class FunderId implements Serializable
{
/**
* The Funder ID Value Schema
* <p>
* Funder ID, recommended to use CrossRef Funder Registry. See: https://www.crossref.org/services/funder-registry/
* (Required)
*
*/
@JsonProperty("identifier")
@JsonPropertyDescription("Funder ID, recommended to use CrossRef Funder Registry. See: https://www.crossref.org/services/funder-registry/")
private String identifier;
/**
* The Funder ID Type Schema
* <p>
* Identifier type. Allowed values: fundref, url, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Identifier type. Allowed values: fundref, url, other")
private FunderId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 1783349151334366078L;
/**
* The Funder ID Value Schema
* <p>
* Funder ID, recommended to use CrossRef Funder Registry. See: https://www.crossref.org/services/funder-registry/
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The Funder ID Value Schema
* <p>
* Funder ID, recommended to use CrossRef Funder Registry. See: https://www.crossref.org/services/funder-registry/
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The Funder ID Type Schema
* <p>
* Identifier type. Allowed values: fundref, url, other
* (Required)
*
*/
@JsonProperty("type")
public FunderId.Type getType() {
return type;
}
/**
* The Funder ID Type Schema
* <p>
* Identifier type. Allowed values: fundref, url, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(FunderId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
FUNDREF("fundref"),
URL("url"),
OTHER("other");
private final String value;
private final static Map<String, FunderId.Type> CONSTANTS = new HashMap<String, FunderId.Type>();
static {
for (FunderId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static FunderId.Type fromValue(String value) {
FunderId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,187 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The DMP Project Funding Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"funder_id",
"funding_status",
"grant_id"
})
public class Funding implements Serializable
{
/**
* The Funder ID Schema
* <p>
* Funder ID of the associated project
* (Required)
*
*/
@JsonProperty("funder_id")
@JsonPropertyDescription("Funder ID of the associated project")
private FunderId funderId;
/**
* The Funding Status Schema
* <p>
* To express different phases of project lifecycle. Allowed values: planned, applied, granted, rejected
*
*/
@JsonProperty("funding_status")
@JsonPropertyDescription("To express different phases of project lifecycle. Allowed values: planned, applied, granted, rejected")
private Funding.FundingStatus fundingStatus;
/**
* The Funding Grant ID Schema
* <p>
* Grant ID of the associated project
* (Required)
*
*/
@JsonProperty("grant_id")
@JsonPropertyDescription("Grant ID of the associated project")
private GrantId grantId;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 8962229321225336165L;
/**
* The Funder ID Schema
* <p>
* Funder ID of the associated project
* (Required)
*
*/
@JsonProperty("funder_id")
public FunderId getFunderId() {
return funderId;
}
/**
* The Funder ID Schema
* <p>
* Funder ID of the associated project
* (Required)
*
*/
@JsonProperty("funder_id")
public void setFunderId(FunderId funderId) {
this.funderId = funderId;
}
/**
* The Funding Status Schema
* <p>
* To express different phases of project lifecycle. Allowed values: planned, applied, granted, rejected
*
*/
@JsonProperty("funding_status")
public Funding.FundingStatus getFundingStatus() {
return fundingStatus;
}
/**
* The Funding Status Schema
* <p>
* To express different phases of project lifecycle. Allowed values: planned, applied, granted, rejected
*
*/
@JsonProperty("funding_status")
public void setFundingStatus(Funding.FundingStatus fundingStatus) {
this.fundingStatus = fundingStatus;
}
/**
* The Funding Grant ID Schema
* <p>
* Grant ID of the associated project
* (Required)
*
*/
@JsonProperty("grant_id")
public GrantId getGrantId() {
return grantId;
}
/**
* The Funding Grant ID Schema
* <p>
* Grant ID of the associated project
* (Required)
*
*/
@JsonProperty("grant_id")
public void setGrantId(GrantId grantId) {
this.grantId = grantId;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum FundingStatus {
PLANNED("planned"),
APPLIED("applied"),
GRANTED("granted"),
REJECTED("rejected");
private final String value;
private final static Map<String, Funding.FundingStatus> CONSTANTS = new HashMap<String, Funding.FundingStatus>();
static {
for (Funding.FundingStatus c: values()) {
CONSTANTS.put(c.value, c);
}
}
private FundingStatus(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Funding.FundingStatus fromValue(String value) {
Funding.FundingStatus constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,153 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Funding Grant ID Schema
* <p>
* Grant ID of the associated project
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class GrantId implements Serializable
{
/**
* The Funding Grant ID Value Schema
* <p>
* Grant ID
* (Required)
*
*/
@JsonProperty("identifier")
@JsonPropertyDescription("Grant ID")
private String identifier;
/**
* The Funding Grant ID Type Schema
* <p>
* Identifier type. Allowed values: url, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Identifier type. Allowed values: url, other")
private GrantId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -7738072672837592065L;
/**
* The Funding Grant ID Value Schema
* <p>
* Grant ID
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The Funding Grant ID Value Schema
* <p>
* Grant ID
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The Funding Grant ID Type Schema
* <p>
* Identifier type. Allowed values: url, other
* (Required)
*
*/
@JsonProperty("type")
public GrantId.Type getType() {
return type;
}
/**
* The Funding Grant ID Type Schema
* <p>
* Identifier type. Allowed values: url, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(GrantId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
URL("url"),
OTHER("other");
private final String value;
private final static Map<String, GrantId.Type> CONSTANTS = new HashMap<String, GrantId.Type>();
static {
for (GrantId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static GrantId.Type fromValue(String value) {
GrantId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,775 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Dataset Distribution Host Schema
* <p>
* To provide information on quality of service provided by infrastructure (e.g. repository) where data is stored.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"availability",
"backup_frequency",
"backup_type",
"certified_with",
"description",
"geo_location",
"pid_system",
"storage_type",
"support_versioning",
"title",
"url"
})
public class Host implements Serializable
{
/**
* The Dataset Distribution Host Availability Schema
* <p>
* Availability
*
*/
@JsonProperty("availability")
@JsonPropertyDescription("Availability")
private String availability;
/**
* The Dataset Distribution Host Backup Frequency Schema
* <p>
* Backup Frequency
*
*/
@JsonProperty("backup_frequency")
@JsonPropertyDescription("Backup Frequency")
private String backupFrequency;
/**
* The Dataset Distribution Host Backup Type Schema
* <p>
* Backup Type
*
*/
@JsonProperty("backup_type")
@JsonPropertyDescription("Backup Type")
private String backupType;
/**
* The Dataset Distribution Host Certification Type Schema
* <p>
* Repository certified to a recognised standard. Allowed values: din31644, dini-zertifikat, dsa, iso16363, iso16919, trac, wds, coretrustseal
*
*/
@JsonProperty("certified_with")
@JsonPropertyDescription("Repository certified to a recognised standard. Allowed values: din31644, dini-zertifikat, dsa, iso16363, iso16919, trac, wds, coretrustseal")
private Host.CertifiedWith certifiedWith;
/**
* The Dataset Distribution Host Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Description")
private String description;
/**
* The Dataset Distribution Host Geographical Location Schema
* <p>
* Physical location of the data expressed using ISO 3166-1 country code.
*
*/
@JsonProperty("geo_location")
@JsonPropertyDescription("Physical location of the data expressed using ISO 3166-1 country code.")
private Host.GeoLocation geoLocation;
/**
* The Dataset Distribution Host PID System Schema
* <p>
* PID system(s). Allowed values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pmid, purl, upc, url, urn, other
*
*/
@JsonProperty("pid_system")
@JsonPropertyDescription("PID system(s). Allowed values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pmid, purl, upc, url, urn, other")
private List<PidSystem> pidSystem = null;
/**
* The Dataset Distribution Host Storage Type Schema
* <p>
* The type of storage required
*
*/
@JsonProperty("storage_type")
@JsonPropertyDescription("The type of storage required")
private String storageType;
/**
* The Dataset Distribution Host Support Versioning Schema
* <p>
* If host supports versioning. Allowed values: yes, no, unknown
*
*/
@JsonProperty("support_versioning")
@JsonPropertyDescription("If host supports versioning. Allowed values: yes, no, unknown")
private Host.SupportVersioning supportVersioning;
/**
* The Dataset Distribution Host Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Title")
private String title;
/**
* The Dataset Distribution Host Title Schema
* <p>
* The URL of the system hosting a distribution of a dataset
* (Required)
*
*/
@JsonProperty("url")
@JsonPropertyDescription("The URL of the system hosting a distribution of a dataset")
private URI url;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 8564338806797654115L;
/**
* The Dataset Distribution Host Availability Schema
* <p>
* Availability
*
*/
@JsonProperty("availability")
public String getAvailability() {
return availability;
}
/**
* The Dataset Distribution Host Availability Schema
* <p>
* Availability
*
*/
@JsonProperty("availability")
public void setAvailability(String availability) {
this.availability = availability;
}
/**
* The Dataset Distribution Host Backup Frequency Schema
* <p>
* Backup Frequency
*
*/
@JsonProperty("backup_frequency")
public String getBackupFrequency() {
return backupFrequency;
}
/**
* The Dataset Distribution Host Backup Frequency Schema
* <p>
* Backup Frequency
*
*/
@JsonProperty("backup_frequency")
public void setBackupFrequency(String backupFrequency) {
this.backupFrequency = backupFrequency;
}
/**
* The Dataset Distribution Host Backup Type Schema
* <p>
* Backup Type
*
*/
@JsonProperty("backup_type")
public String getBackupType() {
return backupType;
}
/**
* The Dataset Distribution Host Backup Type Schema
* <p>
* Backup Type
*
*/
@JsonProperty("backup_type")
public void setBackupType(String backupType) {
this.backupType = backupType;
}
/**
* The Dataset Distribution Host Certification Type Schema
* <p>
* Repository certified to a recognised standard. Allowed values: din31644, dini-zertifikat, dsa, iso16363, iso16919, trac, wds, coretrustseal
*
*/
@JsonProperty("certified_with")
public Host.CertifiedWith getCertifiedWith() {
return certifiedWith;
}
/**
* The Dataset Distribution Host Certification Type Schema
* <p>
* Repository certified to a recognised standard. Allowed values: din31644, dini-zertifikat, dsa, iso16363, iso16919, trac, wds, coretrustseal
*
*/
@JsonProperty("certified_with")
public void setCertifiedWith(Host.CertifiedWith certifiedWith) {
this.certifiedWith = certifiedWith;
}
/**
* The Dataset Distribution Host Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Dataset Distribution Host Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Dataset Distribution Host Geographical Location Schema
* <p>
* Physical location of the data expressed using ISO 3166-1 country code.
*
*/
@JsonProperty("geo_location")
public Host.GeoLocation getGeoLocation() {
return geoLocation;
}
/**
* The Dataset Distribution Host Geographical Location Schema
* <p>
* Physical location of the data expressed using ISO 3166-1 country code.
*
*/
@JsonProperty("geo_location")
public void setGeoLocation(Host.GeoLocation geoLocation) {
this.geoLocation = geoLocation;
}
/**
* The Dataset Distribution Host PID System Schema
* <p>
* PID system(s). Allowed values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pmid, purl, upc, url, urn, other
*
*/
@JsonProperty("pid_system")
public List<PidSystem> getPidSystem() {
return pidSystem;
}
/**
* The Dataset Distribution Host PID System Schema
* <p>
* PID system(s). Allowed values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pmid, purl, upc, url, urn, other
*
*/
@JsonProperty("pid_system")
public void setPidSystem(List<PidSystem> pidSystem) {
this.pidSystem = pidSystem;
}
/**
* The Dataset Distribution Host Storage Type Schema
* <p>
* The type of storage required
*
*/
@JsonProperty("storage_type")
public String getStorageType() {
return storageType;
}
/**
* The Dataset Distribution Host Storage Type Schema
* <p>
* The type of storage required
*
*/
@JsonProperty("storage_type")
public void setStorageType(String storageType) {
this.storageType = storageType;
}
/**
* The Dataset Distribution Host Support Versioning Schema
* <p>
* If host supports versioning. Allowed values: yes, no, unknown
*
*/
@JsonProperty("support_versioning")
public Host.SupportVersioning getSupportVersioning() {
return supportVersioning;
}
/**
* The Dataset Distribution Host Support Versioning Schema
* <p>
* If host supports versioning. Allowed values: yes, no, unknown
*
*/
@JsonProperty("support_versioning")
public void setSupportVersioning(Host.SupportVersioning supportVersioning) {
this.supportVersioning = supportVersioning;
}
/**
* The Dataset Distribution Host Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The Dataset Distribution Host Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
/**
* The Dataset Distribution Host Title Schema
* <p>
* The URL of the system hosting a distribution of a dataset
* (Required)
*
*/
@JsonProperty("url")
public URI getUrl() {
return url;
}
/**
* The Dataset Distribution Host Title Schema
* <p>
* The URL of the system hosting a distribution of a dataset
* (Required)
*
*/
@JsonProperty("url")
public void setUrl(URI url) {
this.url = url;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum CertifiedWith {
DIN_31644("din31644"),
DINI_ZERTIFIKAT("dini-zertifikat"),
DSA("dsa"),
ISO_16363("iso16363"),
ISO_16919("iso16919"),
TRAC("trac"),
WDS("wds"),
CORETRUSTSEAL("coretrustseal");
private final String value;
private final static Map<String, Host.CertifiedWith> CONSTANTS = new HashMap<String, Host.CertifiedWith>();
static {
for (Host.CertifiedWith c: values()) {
CONSTANTS.put(c.value, c);
}
}
private CertifiedWith(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Host.CertifiedWith fromValue(String value) {
Host.CertifiedWith constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
public enum GeoLocation {
AD("AD"),
AE("AE"),
AF("AF"),
AG("AG"),
AI("AI"),
AL("AL"),
AM("AM"),
AO("AO"),
AQ("AQ"),
AR("AR"),
AS("AS"),
AT("AT"),
AU("AU"),
AW("AW"),
AX("AX"),
AZ("AZ"),
BA("BA"),
BB("BB"),
BD("BD"),
BE("BE"),
BF("BF"),
BG("BG"),
BH("BH"),
BI("BI"),
BJ("BJ"),
BL("BL"),
BM("BM"),
BN("BN"),
BO("BO"),
BQ("BQ"),
BR("BR"),
BS("BS"),
BT("BT"),
BV("BV"),
BW("BW"),
BY("BY"),
BZ("BZ"),
CA("CA"),
CC("CC"),
CD("CD"),
CF("CF"),
CG("CG"),
CH("CH"),
CI("CI"),
CK("CK"),
CL("CL"),
CM("CM"),
CN("CN"),
CO("CO"),
CR("CR"),
CU("CU"),
CV("CV"),
CW("CW"),
CX("CX"),
CY("CY"),
CZ("CZ"),
DE("DE"),
DJ("DJ"),
DK("DK"),
DM("DM"),
DO("DO"),
DZ("DZ"),
EC("EC"),
EE("EE"),
EG("EG"),
EH("EH"),
ER("ER"),
ES("ES"),
ET("ET"),
FI("FI"),
FJ("FJ"),
FK("FK"),
FM("FM"),
FO("FO"),
FR("FR"),
GA("GA"),
GB("GB"),
GD("GD"),
GE("GE"),
GF("GF"),
GG("GG"),
GH("GH"),
GI("GI"),
GL("GL"),
GM("GM"),
GN("GN"),
GP("GP"),
GQ("GQ"),
GR("GR"),
GS("GS"),
GT("GT"),
GU("GU"),
GW("GW"),
GY("GY"),
HK("HK"),
HM("HM"),
HN("HN"),
HR("HR"),
HT("HT"),
HU("HU"),
ID("ID"),
IE("IE"),
IL("IL"),
IM("IM"),
IN("IN"),
IO("IO"),
IQ("IQ"),
IR("IR"),
IS("IS"),
IT("IT"),
JE("JE"),
JM("JM"),
JO("JO"),
JP("JP"),
KE("KE"),
KG("KG"),
KH("KH"),
KI("KI"),
KM("KM"),
KN("KN"),
KP("KP"),
KR("KR"),
KW("KW"),
KY("KY"),
KZ("KZ"),
LA("LA"),
LB("LB"),
LC("LC"),
LI("LI"),
LK("LK"),
LR("LR"),
LS("LS"),
LT("LT"),
LU("LU"),
LV("LV"),
LY("LY"),
MA("MA"),
MC("MC"),
MD("MD"),
ME("ME"),
MF("MF"),
MG("MG"),
MH("MH"),
MK("MK"),
ML("ML"),
MM("MM"),
MN("MN"),
MO("MO"),
MP("MP"),
MQ("MQ"),
MR("MR"),
MS("MS"),
MT("MT"),
MU("MU"),
MV("MV"),
MW("MW"),
MX("MX"),
MY("MY"),
MZ("MZ"),
NA("NA"),
NC("NC"),
NE("NE"),
NF("NF"),
NG("NG"),
NI("NI"),
NL("NL"),
NO("NO"),
NP("NP"),
NR("NR"),
NU("NU"),
NZ("NZ"),
OM("OM"),
PA("PA"),
PE("PE"),
PF("PF"),
PG("PG"),
PH("PH"),
PK("PK"),
PL("PL"),
PM("PM"),
PN("PN"),
PR("PR"),
PS("PS"),
PT("PT"),
PW("PW"),
PY("PY"),
QA("QA"),
RE("RE"),
RO("RO"),
RS("RS"),
RU("RU"),
RW("RW"),
SA("SA"),
SB("SB"),
SC("SC"),
SD("SD"),
SE("SE"),
SG("SG"),
SH("SH"),
SI("SI"),
SJ("SJ"),
SK("SK"),
SL("SL"),
SM("SM"),
SN("SN"),
SO("SO"),
SR("SR"),
SS("SS"),
ST("ST"),
SV("SV"),
SX("SX"),
SY("SY"),
SZ("SZ"),
TC("TC"),
TD("TD"),
TF("TF"),
TG("TG"),
TH("TH"),
TJ("TJ"),
TK("TK"),
TL("TL"),
TM("TM"),
TN("TN"),
TO("TO"),
TR("TR"),
TT("TT"),
TV("TV"),
TW("TW"),
TZ("TZ"),
UA("UA"),
UG("UG"),
UM("UM"),
US("US"),
UY("UY"),
UZ("UZ"),
VA("VA"),
VC("VC"),
VE("VE"),
VG("VG"),
VI("VI"),
VN("VN"),
VU("VU"),
WF("WF"),
WS("WS"),
YE("YE"),
YT("YT"),
ZA("ZA"),
ZM("ZM"),
ZW("ZW");
private final String value;
private final static Map<String, Host.GeoLocation> CONSTANTS = new HashMap<String, Host.GeoLocation>();
static {
for (Host.GeoLocation c: values()) {
CONSTANTS.put(c.value, c);
}
}
private GeoLocation(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Host.GeoLocation fromValue(String value) {
Host.GeoLocation constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
public enum SupportVersioning {
YES("yes"),
NO("no"),
UNKNOWN("unknown");
private final String value;
private final static Map<String, Host.SupportVersioning> CONSTANTS = new HashMap<String, Host.SupportVersioning>();
static {
for (Host.SupportVersioning c: values()) {
CONSTANTS.put(c.value, c);
}
}
private SupportVersioning(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Host.SupportVersioning fromValue(String value) {
Host.SupportVersioning constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,113 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* The Dataset Distribution License Items
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"license_ref",
"start_date"
})
public class License implements Serializable
{
/**
* The Dataset Distribution License Reference Schema
* <p>
* Link to license document.
* (Required)
*
*/
@JsonProperty("license_ref")
@JsonPropertyDescription("Link to license document.")
private URI licenseRef;
/**
* The Dataset Distribution License Start Date Schema
* <p>
* Starting date of license. If date is set in the future, it indicates embargo period.
* (Required)
*
*/
@JsonProperty("start_date")
@JsonPropertyDescription("Starting date of license. If date is set in the future, it indicates embargo period.")
private String startDate;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 4148207295817559010L;
/**
* The Dataset Distribution License Reference Schema
* <p>
* Link to license document.
* (Required)
*
*/
@JsonProperty("license_ref")
public URI getLicenseRef() {
return licenseRef;
}
/**
* The Dataset Distribution License Reference Schema
* <p>
* Link to license document.
* (Required)
*
*/
@JsonProperty("license_ref")
public void setLicenseRef(URI licenseRef) {
this.licenseRef = licenseRef;
}
/**
* The Dataset Distribution License Start Date Schema
* <p>
* Starting date of license. If date is set in the future, it indicates embargo period.
* (Required)
*
*/
@JsonProperty("start_date")
public String getStartDate() {
return startDate;
}
/**
* The Dataset Distribution License Start Date Schema
* <p>
* Starting date of license. If date is set in the future, it indicates embargo period.
* (Required)
*
*/
@JsonProperty("start_date")
public void setStartDate(String startDate) {
this.startDate = startDate;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}

View File

@ -0,0 +1,153 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Dataset Metadata Standard ID Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"identifier",
"type"
})
public class MetadataStandardId implements Serializable
{
/**
* The Dataset Metadata Standard Identifier Value Schema
* <p>
* Identifier for the metadata standard used.
* (Required)
*
*/
@JsonProperty("identifier")
@JsonPropertyDescription("Identifier for the metadata standard used.")
private String identifier;
/**
* The Dataset Metadata Standard Identifier Type Schema
* <p>
* Identifier type. Allowed values: url, other
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Identifier type. Allowed values: url, other")
private MetadataStandardId.Type type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -7641042701935397947L;
/**
* The Dataset Metadata Standard Identifier Value Schema
* <p>
* Identifier for the metadata standard used.
* (Required)
*
*/
@JsonProperty("identifier")
public String getIdentifier() {
return identifier;
}
/**
* The Dataset Metadata Standard Identifier Value Schema
* <p>
* Identifier for the metadata standard used.
* (Required)
*
*/
@JsonProperty("identifier")
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* The Dataset Metadata Standard Identifier Type Schema
* <p>
* Identifier type. Allowed values: url, other
* (Required)
*
*/
@JsonProperty("type")
public MetadataStandardId.Type getType() {
return type;
}
/**
* The Dataset Metadata Standard Identifier Type Schema
* <p>
* Identifier type. Allowed values: url, other
* (Required)
*
*/
@JsonProperty("type")
public void setType(MetadataStandardId.Type type) {
this.type = type;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Type {
URL("url"),
OTHER("other");
private final String value;
private final static Map<String, MetadataStandardId.Type> CONSTANTS = new HashMap<String, MetadataStandardId.Type>();
static {
for (MetadataStandardId.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static MetadataStandardId.Type fromValue(String value) {
MetadataStandardId.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,368 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The Dataset Metadata Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"description",
"language",
"metadata_standard_id"
})
public class Metadatum implements Serializable
{
/**
* The Dataset Metadata Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Description")
private String description;
/**
* The Dataset Metadata Language Schema
* <p>
* Language of the metadata expressed using ISO 639-3.
* (Required)
*
*/
@JsonProperty("language")
@JsonPropertyDescription("Language of the metadata expressed using ISO 639-3.")
private Metadatum.Language language;
/**
* The Dataset Metadata Standard ID Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("metadata_standard_id")
private MetadataStandardId metadataStandardId;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 6511312853153406190L;
/**
* The Dataset Metadata Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Dataset Metadata Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Dataset Metadata Language Schema
* <p>
* Language of the metadata expressed using ISO 639-3.
* (Required)
*
*/
@JsonProperty("language")
public Metadatum.Language getLanguage() {
return language;
}
/**
* The Dataset Metadata Language Schema
* <p>
* Language of the metadata expressed using ISO 639-3.
* (Required)
*
*/
@JsonProperty("language")
public void setLanguage(Metadatum.Language language) {
this.language = language;
}
/**
* The Dataset Metadata Standard ID Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("metadata_standard_id")
public MetadataStandardId getMetadataStandardId() {
return metadataStandardId;
}
/**
* The Dataset Metadata Standard ID Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("metadata_standard_id")
public void setMetadataStandardId(MetadataStandardId metadataStandardId) {
this.metadataStandardId = metadataStandardId;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public enum Language {
AAR("aar"),
ABK("abk"),
AFR("afr"),
AKA("aka"),
AMH("amh"),
ARA("ara"),
ARG("arg"),
ASM("asm"),
AVA("ava"),
AVE("ave"),
AYM("aym"),
AZE("aze"),
BAK("bak"),
BAM("bam"),
BEL("bel"),
BEN("ben"),
BIH("bih"),
BIS("bis"),
BOD("bod"),
BOS("bos"),
BRE("bre"),
BUL("bul"),
CAT("cat"),
CES("ces"),
CHA("cha"),
CHE("che"),
CHU("chu"),
CHV("chv"),
COR("cor"),
COS("cos"),
CRE("cre"),
CYM("cym"),
DAN("dan"),
DEU("deu"),
DIV("div"),
DZO("dzo"),
ELL("ell"),
ENG("eng"),
EPO("epo"),
EST("est"),
EUS("eus"),
EWE("ewe"),
FAO("fao"),
FAS("fas"),
FIJ("fij"),
FIN("fin"),
FRA("fra"),
FRY("fry"),
FUL("ful"),
GLA("gla"),
GLE("gle"),
GLG("glg"),
GLV("glv"),
GRN("grn"),
GUJ("guj"),
HAT("hat"),
HAU("hau"),
HBS("hbs"),
HEB("heb"),
HER("her"),
HIN("hin"),
HMO("hmo"),
HRV("hrv"),
HUN("hun"),
HYE("hye"),
IBO("ibo"),
IDO("ido"),
III("iii"),
IKU("iku"),
ILE("ile"),
INA("ina"),
IND("ind"),
IPK("ipk"),
ISL("isl"),
ITA("ita"),
JAV("jav"),
JPN("jpn"),
KAL("kal"),
KAN("kan"),
KAS("kas"),
KAT("kat"),
KAU("kau"),
KAZ("kaz"),
KHM("khm"),
KIK("kik"),
KIN("kin"),
KIR("kir"),
KOM("kom"),
KON("kon"),
KOR("kor"),
KUA("kua"),
KUR("kur"),
LAO("lao"),
LAT("lat"),
LAV("lav"),
LIM("lim"),
LIN("lin"),
LIT("lit"),
LTZ("ltz"),
LUB("lub"),
LUG("lug"),
MAH("mah"),
MAL("mal"),
MAR("mar"),
MKD("mkd"),
MLG("mlg"),
MLT("mlt"),
MON("mon"),
MRI("mri"),
MSA("msa"),
MYA("mya"),
NAU("nau"),
NAV("nav"),
NBL("nbl"),
NDE("nde"),
NDO("ndo"),
NEP("nep"),
NLD("nld"),
NNO("nno"),
NOB("nob"),
NOR("nor"),
NYA("nya"),
OCI("oci"),
OJI("oji"),
ORI("ori"),
ORM("orm"),
OSS("oss"),
PAN("pan"),
PLI("pli"),
POL("pol"),
POR("por"),
PUS("pus"),
QUE("que"),
ROH("roh"),
RON("ron"),
RUN("run"),
RUS("rus"),
SAG("sag"),
SAN("san"),
SIN("sin"),
SLK("slk"),
SLV("slv"),
SME("sme"),
SMO("smo"),
SNA("sna"),
SND("snd"),
SOM("som"),
SOT("sot"),
SPA("spa"),
SQI("sqi"),
SRD("srd"),
SRP("srp"),
SSW("ssw"),
SUN("sun"),
SWA("swa"),
SWE("swe"),
TAH("tah"),
TAM("tam"),
TAT("tat"),
TEL("tel"),
TGK("tgk"),
TGL("tgl"),
THA("tha"),
TIR("tir"),
TON("ton"),
TSN("tsn"),
TSO("tso"),
TUK("tuk"),
TUR("tur"),
TWI("twi"),
UIG("uig"),
UKR("ukr"),
URD("urd"),
UZB("uzb"),
VEN("ven"),
VIE("vie"),
VOL("vol"),
WLN("wln"),
WOL("wol"),
XHO("xho"),
YID("yid"),
YOR("yor"),
ZHA("zha"),
ZHO("zho"),
ZUL("zul");
private final String value;
private final static Map<String, Metadatum.Language> CONSTANTS = new HashMap<String, Metadatum.Language>();
static {
for (Metadatum.Language c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Language(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Metadatum.Language fromValue(String value) {
Metadatum.Language constant = CONSTANTS.get(value);
if (constant == null) {
return null;
// throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}

View File

@ -0,0 +1,63 @@
package eu.eudat.models.rda;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
public enum PidSystem {
ARK("ark"),
ARXIV("arxiv"),
BIBCODE("bibcode"),
DOI("doi"),
EAN_13("ean13"),
EISSN("eissn"),
HANDLE("handle"),
IGSN("igsn"),
ISBN("isbn"),
ISSN("issn"),
ISTC("istc"),
LISSN("lissn"),
LSID("lsid"),
PMID("pmid"),
PURL("purl"),
UPC("upc"),
URL("url"),
URN("urn"),
OTHER("other");
private final String value;
private final static Map<String, PidSystem> CONSTANTS = new HashMap<String, PidSystem>();
static {
for (PidSystem c: values()) {
CONSTANTS.put(c.value, c);
}
}
private PidSystem(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static PidSystem fromValue(String value) {
PidSystem constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}

View File

@ -0,0 +1,212 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* The DMP Project Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"description",
"end",
"funding",
"start",
"title"
})
public class Project implements Serializable
{
/**
* The DMP Project Description Schema
* <p>
* Project description
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Project description")
private String description;
/**
* The DMP Project End Date Schema
* <p>
* Project end date
* (Required)
*
*/
@JsonProperty("end")
@JsonPropertyDescription("Project end date")
private String end;
/**
* The DMP Project Funding Schema
* <p>
* Funding related with a project
*
*/
@JsonProperty("funding")
@JsonPropertyDescription("Funding related with a project")
private List<Funding> funding = null;
/**
* The DMP Project Start Date Schema
* <p>
* Project start date
* (Required)
*
*/
@JsonProperty("start")
@JsonPropertyDescription("Project start date")
private String start;
/**
* The DMP Project Title Schema
* <p>
* Project title
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Project title")
private String title;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 1437619307195890472L;
/**
* The DMP Project Description Schema
* <p>
* Project description
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The DMP Project Description Schema
* <p>
* Project description
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The DMP Project End Date Schema
* <p>
* Project end date
* (Required)
*
*/
@JsonProperty("end")
public String getEnd() {
return end;
}
/**
* The DMP Project End Date Schema
* <p>
* Project end date
* (Required)
*
*/
@JsonProperty("end")
public void setEnd(String end) {
this.end = end;
}
/**
* The DMP Project Funding Schema
* <p>
* Funding related with a project
*
*/
@JsonProperty("funding")
public List<Funding> getFunding() {
return funding;
}
/**
* The DMP Project Funding Schema
* <p>
* Funding related with a project
*
*/
@JsonProperty("funding")
public void setFunding(List<Funding> funding) {
this.funding = funding;
}
/**
* The DMP Project Start Date Schema
* <p>
* Project start date
* (Required)
*
*/
@JsonProperty("start")
public String getStart() {
return start;
}
/**
* The DMP Project Start Date Schema
* <p>
* Project start date
* (Required)
*
*/
@JsonProperty("start")
public void setStart(String start) {
this.start = start;
}
/**
* The DMP Project Title Schema
* <p>
* Project title
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The DMP Project Title Schema
* <p>
* Project title
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}

View File

@ -0,0 +1,58 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* RDA DMP Common Standard Schema
* <p>
* JSON Schema for the RDA DMP Common Standard
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"dmp"
})
public class RDAModel implements Serializable
{
/**
* The DMP Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("dmp")
private Dmp dmp;
private final static long serialVersionUID = 7331666133368350998L;
/**
* The DMP Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("dmp")
public Dmp getDmp() {
return dmp;
}
/**
* The DMP Schema
* <p>
*
* (Required)
*
*/
@JsonProperty("dmp")
public void setDmp(Dmp dmp) {
this.dmp = dmp;
}
}

View File

@ -0,0 +1,109 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* The Dataset Security & Policy Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"description",
"title"
})
public class SecurityAndPrivacy implements Serializable
{
/**
* The Dataset Security & Policy Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Description")
private String description;
/**
* The Dataset Security & Policy Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
@JsonPropertyDescription("Title")
private String title;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 7863747935827682977L;
/**
* The Dataset Security & Policy Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Dataset Security & Policy Description Schema
* <p>
* Description
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Dataset Security & Policy Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
public String getTitle() {
return title;
}
/**
* The Dataset Security & Policy Title Schema
* <p>
* Title
* (Required)
*
*/
@JsonProperty("title")
public void setTitle(String title) {
this.title = title;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}

View File

@ -0,0 +1,109 @@
package eu.eudat.models.rda;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* The Dataset Technical Resource Items Schema
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"description",
"name"
})
public class TechnicalResource implements Serializable
{
/**
* The Dataset Technical Resource Description Schema
* <p>
* Description of the technical resource
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Description of the technical resource")
private String description;
/**
* The Dataset Technical Resource Name Schema
* <p>
* Name of the technical resource
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Name of the technical resource")
private String name;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -7451757227129483110L;
/**
* The Dataset Technical Resource Description Schema
* <p>
* Description of the technical resource
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* The Dataset Technical Resource Description Schema
* <p>
* Description of the technical resource
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* The Dataset Technical Resource Name Schema
* <p>
* Name of the technical resource
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* The Dataset Technical Resource Name Schema
* <p>
* Name of the technical resource
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}

View File

@ -0,0 +1,15 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.models.rda.ContactId;
import java.util.UUID;
public class ContactIdRDAMapper {
public static ContactId toRDA(UUID id) {
ContactId rda = new ContactId();
rda.setIdentifier(id.toString());
rda.setType(ContactId.Type.OTHER);
return rda;
}
}

View File

@ -0,0 +1,16 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.rda.Contact;
import eu.eudat.models.rda.ContactId;
public class ContactRDAMapper {
public static Contact toRDA(UserInfo creator) {
Contact rda = new Contact();
rda.setName(creator.getName());
rda.setMbox(creator.getEmail());
rda.setContactId(ContactIdRDAMapper.toRDA(creator.getId()));
return rda;
}
}

View File

@ -0,0 +1,16 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.models.rda.Contributor;
import eu.eudat.models.rda.ContributorId;
import java.util.UUID;
public class ContributorIdRDAMapper {
public static ContributorId toRDA(UUID id) {
ContributorId rda = new ContributorId();
rda.setIdentifier(id.toString());
rda.setType(ContributorId.Type.OTHER);
return rda;
}
}

View File

@ -0,0 +1,20 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.data.entities.UserDMP;
import eu.eudat.models.rda.Contributor;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
public class ContributorRDAMapper {
public static Contributor toRDA(UserDMP userDMP) {
Contributor rda = new Contributor();
rda.setContributorId(ContributorIdRDAMapper.toRDA(userDMP.getUser().getId()));
rda.setName(userDMP.getUser().getName());
rda.setMbox(userDMP.getUser().getEmail());
rda.setRole(new HashSet<>(Arrays.asList(UserDMP.UserDMPRoles.fromInteger(userDMP.getRole()).name())));
return rda;
}
}

View File

@ -0,0 +1,17 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.models.rda.DatasetId;
import java.util.UUID;
public class DatasetIdRDAMapper {
public static DatasetId toRDA(UUID id) {
DatasetId rda = new DatasetId();
rda.setIdentifier(id.toString());
rda.setType(DatasetId.Type.OTHER);
return rda;
}
}

View File

@ -0,0 +1,100 @@
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.managers.DatasetManager;
import eu.eudat.logic.utilities.json.JsonSearcher;
import eu.eudat.models.data.datasetwizard.DatasetWizardModel;
import eu.eudat.models.rda.Dataset;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class DatasetRDAMapper {
private static final Logger logger = LoggerFactory.getLogger(DatasetRDAMapper.class);
private DatasetManager datasetManager;
@Autowired
public DatasetRDAMapper(DatasetManager datasetManager) {
this.datasetManager = datasetManager;
}
@Transactional
public Dataset toRDA(eu.eudat.data.entities.Dataset dataset) {
Dataset rda = new Dataset();
rda.setDatasetId(DatasetIdRDAMapper.toRDA(dataset.getId()));
rda.setTitle(dataset.getLabel());
rda.setDescription(dataset.getDescription());
try {
DatasetWizardModel datasetWizardModel = new DatasetWizardModel().fromDataModel(dataset);
datasetWizardModel.setDatasetProfileDefinition(datasetManager.getPagedProfile(datasetWizardModel, dataset));
ObjectMapper mapper = new ObjectMapper();
JsonNode properties = mapper.readTree(dataset.getProperties());
String datasetDescriptionJson = mapper.writeValueAsString(datasetWizardModel.getDatasetProfileDefinition());
JsonNode datasetDescriptionObj = mapper.readTree(datasetDescriptionJson);
List<JsonNode> typeNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.type");
if (!typeNodes.isEmpty()) {
rda.setType(properties.get(typeNodes.get(0).get("id").asText()).asText());
}
List<JsonNode> languageNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.language");
if (!languageNodes.isEmpty()) {
rda.setLanguage(Dataset.Language.fromValue(properties.get(languageNodes.get(0).get("id").asText()).asText()));
}
List<JsonNode> metadataNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.metadata");
if (!metadataNodes.isEmpty()) {
rda.setMetadata(metadataNodes.stream().map(node -> MetadataRDAMapper.toRDA(node, properties)).collect(Collectors.toList()));
}
List<JsonNode> qaNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.data_quality_assurance");
if (!qaNodes.isEmpty()) {
rda.setDataQualityAssurance(qaNodes.stream().map(qaNode -> properties.get(qaNode.get("id").asText()).asText()).collect(Collectors.toList()));
}
List<JsonNode> preservationNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.preservation_statement");
if (!preservationNodes.isEmpty()) {
rda.setDataQualityAssurance(preservationNodes.stream().map(preservationNode -> properties.get(preservationNode.get("id").asText()).asText()).collect(Collectors.toList()));
}
List<JsonNode> distributionNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.distribution");
if (!distributionNodes.isEmpty()) {
rda.setDistribution(distributionNodes.stream().map(distributionNode -> DistributionRDAMapper.toRDA(distributionNode, properties)).collect(Collectors.toList()));
}
List<JsonNode> keywordNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.keyword");
if (!keywordNodes.isEmpty()) {
rda.setKeyword(keywordNodes.stream().map(keywordNode -> properties.get(keywordNode.get("id").asText()).asText()).collect(Collectors.toList()));
}
List<JsonNode> personalDataNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.personal_data");
if (!personalDataNodes.isEmpty()) {
rda.setPersonalData(personalDataNodes.stream().map(personalDataNode -> Dataset.PersonalData.fromValue(properties.get(personalDataNode.get("id").asText()).asText())).findFirst().get());
}
List<JsonNode> securityAndPrivacyNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.security_and_privacy");
if (!securityAndPrivacyNodes.isEmpty()) {
rda.setSecurityAndPrivacy(securityAndPrivacyNodes.stream().map(securityAndPrivacyNode -> SecurityAndPrivacyRDAMapper.toRDA(securityAndPrivacyNode, properties)).collect(Collectors.toList()));
}
List<JsonNode> sensitiveDataNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.sensitive_data");
if (!sensitiveDataNodes.isEmpty()) {
rda.setSensitiveData(securityAndPrivacyNodes.stream().map(sensitiveDataNode -> Dataset.SensitiveData.fromValue(properties.get(sensitiveDataNode.get("id").asText()).asText())).findFirst().get());
}
List<JsonNode> technicalResourceNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.technical_resource");
if (!technicalResourceNodes.isEmpty()) {
rda.setTechnicalResource(technicalResourceNodes.stream().map(technicalResourceNode -> TechnicalResourceRDAMapper.toRDA(technicalResourceNode, properties)).collect(Collectors.toList()));
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return rda;
}
}

View File

@ -0,0 +1,39 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import eu.eudat.models.rda.Distribution;
import java.net.URI;
import java.util.Collections;
public class DistributionRDAMapper {
public static Distribution toRDA(JsonNode structure, JsonNode properties) {
Distribution rda = new Distribution();
String rdaProperty = structure.get("rdaProperty").asText();
if (rdaProperty.contains("access_url")) {
rda.setAccessUrl(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("available_util")) {
rda.setAvailableUntil(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("byte_size")) {
rda.setByteSize(properties.get(structure.get("id").asText()).asInt());
} else if (rdaProperty.contains("data_access")) {
rda.setDataAccess(Distribution.DataAccess.fromValue(properties.get(structure.get("id").asText()).asText()));
} else if (rdaProperty.contains("description")) {
rda.setDescription(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("download_url")) {
rda.setDownloadUrl(URI.create(properties.get(structure.get("id").asText()).asText()));
} else if (rdaProperty.contains("format")) {
rda.setFormat(Collections.singletonList(properties.get(structure.get("id").asText()).asText()));
} else if (rdaProperty.contains("host")) {
rda.setHost(HostRDAMapper.toRDA(structure, properties));
} else if (rdaProperty.contains("license")) {
rda.setLicense(Collections.singletonList(LicenseRDAMapper.toRDA(structure, properties)));
} else if (rdaProperty.contains("title")) {
rda.setTitle(properties.get(structure.get("id").asText()).asText());
}
return rda;
}
}

View File

@ -0,0 +1,19 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.models.rda.DmpId;
import java.util.UUID;
public class DmpIdRDAMapper {
public static DmpId toRDA(Object id) {
DmpId rda = new DmpId();
rda.setIdentifier(id.toString());
if (id instanceof UUID) {
rda.setType(DmpId.Type.OTHER);
} else {
rda.setType(DmpId.Type.DOI);
}
return rda;
}
}

View File

@ -0,0 +1,51 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.entities.UserDMP;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.rda.Dmp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.util.Collections;
import java.util.stream.Collectors;
@Component
public class DmpRDAMapper {
private DatasetRDAMapper datasetRDAMapper;
@Autowired
public DmpRDAMapper(DatasetRDAMapper datasetRDAMapper) {
this.datasetRDAMapper = datasetRDAMapper;
}
@Transactional
public Dmp toRDA(DMP dmp) {
Dmp rda = new Dmp();
if (dmp.getDoi() != null && !dmp.getDoi().isEmpty()) {
rda.setDmpId(DmpIdRDAMapper.toRDA(dmp.getDoi()));
} else {
rda.setDmpId(DmpIdRDAMapper.toRDA(dmp.getId()));
}
rda.setCreated(dmp.getCreated());
rda.setDescription(dmp.getDescription());
rda.setModified(dmp.getModified());
rda.setTitle(dmp.getLabel());
UserInfo creator;
if (dmp.getCreator() != null) {
creator = dmp.getCreator();
} else {
creator = dmp.getUsers().stream().filter(userDMP -> userDMP.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())).map(UserDMP::getUser).findFirst().orElse(new UserInfo());
}
rda.setContact(ContactRDAMapper.toRDA(creator));
rda.setContributor(dmp.getUsers().stream().map(ContributorRDAMapper::toRDA).collect(Collectors.toList()));
rda.setDataset(dmp.getDataset().stream().map(dataset -> datasetRDAMapper.toRDA(dataset)).collect(Collectors.toList()));
rda.setProject(Collections.singletonList(ProjectRDAMapper.toRDA(dmp.getProject(), dmp.getGrant())));
return rda;
}
}

View File

@ -0,0 +1,19 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.models.rda.FunderId;
import java.util.UUID;
public class FunderIdRDAMapper {
public static FunderId toRDA(Object id) {
FunderId rda = new FunderId();
rda.setIdentifier(id.toString());
if (id instanceof UUID) {
rda.setType(FunderId.Type.OTHER);
} else {
rda.setType(FunderId.Type.FUNDREF);
}
return rda;
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.data.entities.Funder;
import eu.eudat.data.entities.Grant;
import eu.eudat.models.rda.Funding;
public class FundingRDAMapper {
public static Funding toRDA(Grant grant) {
Funding rda = new Funding();
String referencePrefix;
String shortReference;
if (grant.getFunder().getReference() != null) {
referencePrefix = grant.getFunder().getReference().split(":")[0];
shortReference = grant.getFunder().getReference().substring(referencePrefix.length() + 1);
rda.setFunderId(FunderIdRDAMapper.toRDA(shortReference));
} else {
rda.setFunderId(FunderIdRDAMapper.toRDA(grant.getFunder().getId()));
}
referencePrefix = grant.getReference().split(":")[0];
shortReference = grant.getReference().substring(referencePrefix.length() + 1);
rda.setGrantId(GrantIdRDAMapper.toRDA(shortReference));
return rda;
}
}

View File

@ -0,0 +1,13 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.models.rda.GrantId;
public class GrantIdRDAMapper {
public static GrantId toRDA(String id) {
GrantId rda = new GrantId();
rda.setIdentifier(id);
rda.setType(GrantId.Type.OTHER);
return rda;
}
}

View File

@ -0,0 +1,41 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import eu.eudat.models.rda.Host;
import eu.eudat.models.rda.PidSystem;
import java.net.URI;
import java.util.Collections;
public class HostRDAMapper {
public static Host toRDA(JsonNode structure, JsonNode properties) {
Host rda = new Host();
String rdaProperty = structure.get("rdaProperties").asText();
if (rdaProperty.contains("availability")) {
rda.setAvailability(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("backup_frequency")) {
rda.setBackupFrequency(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("backup_type")) {
rda.setBackupType(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("certified_with")) {
rda.setCertifiedWith(Host.CertifiedWith.fromValue(properties.get(structure.get("id").asText()).asText()));
} else if (rdaProperty.contains("description")) {
rda.setDescription(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("geo_location")) {
rda.setGeoLocation(Host.GeoLocation.fromValue(properties.get(structure.get("id").asText()).asText()));
} else if (rdaProperty.contains("pid_system")) {
rda.setPidSystem(Collections.singletonList(PidSystem.fromValue(properties.get(structure.get("id").asText()).asText())));
} else if (rdaProperty.contains("storage_type")) {
rda.setStorageType(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("support_versioning")) {
rda.setSupportVersioning(Host.SupportVersioning.fromValue(properties.get(structure.get("id").asText()).asText()));
} else if (rdaProperty.contains("title")) {
rda.setTitle(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("url")) {
rda.setUrl(URI.create(properties.get(structure.get("id").asText()).asText()));
}
return rda;
}
}

View File

@ -0,0 +1,23 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import eu.eudat.models.rda.License;
import java.net.URI;
public class LicenseRDAMapper {
public static License toRDA(JsonNode structure, JsonNode properties) {
License rda = new License();
String rdaProperty = structure.get("rdaProperty").asText();
String value = properties.get(structure.get("id").asText()).asText();
if (rdaProperty.contains("license_ref")) {
rda.setLicenseRef(URI.create(value));
} else if (rdaProperty.contains("start_date")) {
rda.setStartDate(value);
}
return rda;
}
}

View File

@ -0,0 +1,44 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.models.rda.Metadatum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Iterator;
public class MetadataRDAMapper {
private static final Logger logger = LoggerFactory.getLogger(MetadataRDAMapper.class);
public static Metadatum toRDA(JsonNode structure, JsonNode properties) {
Metadatum rda = new Metadatum();
JsonNode dataNode = null;
String rdaProperty = structure.get("rdaProperty").asText();
if (rdaProperty.contains("metadata_standard_id")) {
try {
String jsonText = properties.get(structure.get("id").asText()).asText();
if (jsonText != null && !jsonText.isEmpty()) {
dataNode = new ObjectMapper().readTree(jsonText);
for (Iterator<JsonNode> it = dataNode.elements(); it.hasNext(); ) {
JsonNode data = it.next();
if (data.get("uri") != null) {
rda.setMetadataStandardId(MetadataStandardIdRDAMapper.toRDA(data.get("uri").asText()));
}
}
}
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
} else if (rdaProperty.contains("description")) {
rda.setDescription(properties.get(structure.get("id").asText()).asText());
} else if (rdaProperty.contains("language")) {
String language = properties.get(structure.get("id").asText()).asText();
Metadatum.Language lang = Metadatum.Language.fromValue(language);
rda.setLanguage(lang);
}
return rda;
}
}

View File

@ -0,0 +1,13 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.models.rda.MetadataStandardId;
public class MetadataStandardIdRDAMapper {
public static MetadataStandardId toRDA(String uri) {
MetadataStandardId rda = new MetadataStandardId();
rda.setIdentifier(uri);
rda.setType(MetadataStandardId.Type.URL);
return rda;
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.models.rda.mapper;
import eu.eudat.data.entities.Funder;
import eu.eudat.data.entities.Grant;
import eu.eudat.models.rda.Project;
import java.util.Collections;
public class ProjectRDAMapper {
public static Project toRDA(eu.eudat.data.entities.Project project, Grant grant) {
Project rda = new Project();
rda.setTitle(project.getLabel());
rda.setDescription(project.getDescription());
if (project.getStartdate() != null) {
rda.setStart(project.getStartdate().toString());
}
if (project.getEnddate() != null) {
rda.setEnd(project.getEnddate().toString());
}
rda.setFunding(Collections.singletonList(FundingRDAMapper.toRDA(grant)));
return rda;
}
}

View File

@ -0,0 +1,21 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import eu.eudat.models.rda.SecurityAndPrivacy;
public class SecurityAndPrivacyRDAMapper {
public static SecurityAndPrivacy toRDA(JsonNode structure, JsonNode properties) {
SecurityAndPrivacy rda = new SecurityAndPrivacy();
String rdaProperty = structure.get("rdaProperty").asText();
String value = properties.get(structure.get("id").asText()).asText();
if (rdaProperty.contains("description")) {
rda.setDescription(value);
} else if (rdaProperty.contains("title")) {
rda.setTitle(value);
}
return rda;
}
}

View File

@ -0,0 +1,21 @@
package eu.eudat.models.rda.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import eu.eudat.models.rda.TechnicalResource;
public class TechnicalResourceRDAMapper {
public static TechnicalResource toRDA(JsonNode structure, JsonNode properties) {
TechnicalResource rda = new TechnicalResource();
String rdaProperty = structure.get("rdaProperty").asText();
String value = properties.get(structure.get("id").asText()).asText();
if (rdaProperty.contains("description")) {
rda.setDescription(value);
} else if (rdaProperty.contains("name")) {
rda.setName(value);
}
return rda;
}
}