From 32bcdcb1c08a4d97c602224776a72587a6b4382a Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 6 Aug 2021 14:31:35 +0200 Subject: [PATCH 1/2] added extention to the schema for the relation validated by funder --- .../schema/dump/oaf/community/Project.java | 10 ++++++ .../schema/dump/oaf/community/Validated.java | 32 +++++++++++++++++++ .../dhp/schema/dump/oaf/graph/Relation.java | 18 +++++++++++ 3 files changed, 60 insertions(+) create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Project.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Project.java index 030b565..cdbd0e0 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Project.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Project.java @@ -19,6 +19,16 @@ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { private Provenance provenance; + private Validated validated; + + public void setValidated(Validated validated){ + this.validated = validated; + } + + public Validated getValidated(){ + return validated; + } + public Provenance getProvenance() { return provenance; } diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java new file mode 100644 index 0000000..073dd3f --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java @@ -0,0 +1,32 @@ + +package eu.dnetlib.dhp.schema.dump.oaf.community; + +import java.io.Serializable; + +/** + * To store information about the funder funding the project related to the result. It has the following parameters: - + * shortName of type String to store the funder short name (e.c. AKA). - name of type String to store the funder name + * (e.c. Akademy of Finland) - fundingStream of type String to store the funding stream - jurisdiction of type String to + * store the jurisdiction of the funder + */ +public class Validated implements Serializable { + + private String validationDate; + private boolean validatedByFunder; + + public void setValidationDate(String validationDate){ + this.validationDate = validationDate; + } + + public String getValidationDate(){ + return validationDate; + } + + public void setValidatedByFunder(boolean validated){ + this.validatedByFunder = validated; + } + + public boolean getValidatedByFunder(){ + return validatedByFunder; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java index e2b126e..31af2f1 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java @@ -17,6 +17,8 @@ public class Relation implements Serializable { private Node target; private RelType reltype; private Provenance provenance; + private boolean validated; + private String validationDate; public Node getSource() { return source; @@ -50,6 +52,22 @@ public class Relation implements Serializable { this.provenance = provenance; } + public void setValidated(boolean validate){ + this.validated = validate; + } + + public boolean getValidated(){ + return validated; + } + + public void setValidationDate(String validationDate){ + this.validationDate = validationDate; + } + + public String getValidationDate(){ + return validationDate; + } + @Override public int hashCode() { From 49d42ea9d8dd00d00f0ad5ba35ea134899e46017 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 6 Aug 2021 14:44:33 +0200 Subject: [PATCH 2/2] added new static newInstance method in the Validated class --- .../dhp/schema/dump/oaf/community/Validated.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java index 073dd3f..0d136f0 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Validated.java @@ -12,7 +12,7 @@ import java.io.Serializable; public class Validated implements Serializable { private String validationDate; - private boolean validatedByFunder; + private Boolean validatedByFunder; public void setValidationDate(String validationDate){ this.validationDate = validationDate; @@ -22,11 +22,18 @@ public class Validated implements Serializable { return validationDate; } - public void setValidatedByFunder(boolean validated){ + public void setValidatedByFunder(Boolean validated){ this.validatedByFunder = validated; } - public boolean getValidatedByFunder(){ + public Boolean getValidatedByFunder(){ return validatedByFunder; } + + public static Validated newInstance(Boolean validated, String validationDate){ + Validated v = new Validated(); + v.validatedByFunder = validated; + v.validationDate = validationDate; + return v; + } }