From a2f01e52590965592816ba2f2dd21c672a99cc57 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 20 Jul 2020 18:54:17 +0200 Subject: [PATCH] added getter and setter --- .../dhp/schema/dump/oaf/graph/Project.java | 135 ++++++++++++++++++ .../oa/graph/dump/graph/DumpOrganization.java | 46 ------ .../graph/dump/graph/OrganizationMapper.java | 15 -- 3 files changed, 135 insertions(+), 61 deletions(-) delete mode 100644 dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpOrganization.java delete mode 100644 dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/OrganizationMapper.java diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java index 3490befc7b..b59ed67fe3 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java @@ -35,4 +35,139 @@ public class Project implements Serializable { private Programme programme; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getWebsiteurl() { + return websiteurl; + } + + public void setWebsiteurl(String websiteurl) { + this.websiteurl = websiteurl; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getAcronym() { + return acronym; + } + + public void setAcronym(String acronym) { + this.acronym = acronym; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getStartdate() { + return startdate; + } + + public void setStartdate(String startdate) { + this.startdate = startdate; + } + + public String getEnddate() { + return enddate; + } + + public void setEnddate(String enddate) { + this.enddate = enddate; + } + + public String getCallidentifier() { + return callidentifier; + } + + public void setCallidentifier(String callidentifier) { + this.callidentifier = callidentifier; + } + + public String getKeywords() { + return keywords; + } + + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public boolean isOpenaccessmandateforpublications() { + return openaccessmandateforpublications; + } + + public void setOpenaccessmandateforpublications(boolean openaccessmandateforpublications) { + this.openaccessmandateforpublications = openaccessmandateforpublications; + } + + public boolean isOpenaccessmandatefordataset() { + return openaccessmandatefordataset; + } + + public void setOpenaccessmandatefordataset(boolean openaccessmandatefordataset) { + this.openaccessmandatefordataset = openaccessmandatefordataset; + } + + public List getSubject() { + return subject; + } + + public void setSubject(List subject) { + this.subject = subject; + } + + public Funder getFunding() { + return funding; + } + + public void setFunding(Funder funding) { + this.funding = funding; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public Granted getGranted() { + return granted; + } + + public void setGranted(Granted granted) { + this.granted = granted; + } + + public Programme getProgramme() { + return programme; + } + + public void setProgramme(Programme programme) { + this.programme = programme; + } } diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpOrganization.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpOrganization.java deleted file mode 100644 index 69a2a38dc7..0000000000 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpOrganization.java +++ /dev/null @@ -1,46 +0,0 @@ -package eu.dnetlib.dhp.oa.graph.dump.graph; - -import eu.dnetlib.dhp.oa.graph.dump.Utils; -import eu.dnetlib.dhp.oa.graph.dump.community.CommunityMap; -import eu.dnetlib.dhp.schema.oaf.OafEntity; -import eu.dnetlib.dhp.schema.oaf.Organization; -import org.apache.spark.SparkConf; -import org.apache.spark.sql.Dataset; -import org.apache.spark.sql.Encoders; -import org.apache.spark.sql.SaveMode; -import org.apache.spark.sql.SparkSession; - -import java.io.Serializable; - -import static eu.dnetlib.dhp.common.SparkSessionSupport.runWithSparkSession; - -public class DumpOrganization implements Serializable { - - public void run(Boolean isSparkSessionManaged, String inputPath, String outputPath ) { - - SparkConf conf = new SparkConf(); - - runWithSparkSession( - conf, - isSparkSessionManaged, - spark -> { - Utils.removeOutputDir(spark, outputPath); - execDump(spark, inputPath, outputPath); - - }); - } - - private void execDump(SparkSession spark, String inputPath, String outputPath) { - - Utils.readPath(spark, inputPath, Organization.class) - .map(org -> OrganizationMapper.map(org), Encoders.bean(eu.dnetlib.dhp.schema.dump.oaf.graph.Organization.class)) - .write() - .option("compression","gzip") - .mode(SaveMode.Overwrite) - .json(outputPath); - - - } - - -} diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/OrganizationMapper.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/OrganizationMapper.java deleted file mode 100644 index 9b427e899a..0000000000 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/OrganizationMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package eu.dnetlib.dhp.oa.graph.dump.graph; - -import eu.dnetlib.dhp.schema.dump.oaf.ControlledField; -import eu.dnetlib.dhp.schema.dump.oaf.Country; -import eu.dnetlib.dhp.schema.dump.oaf.graph.Organization; - -import java.io.Serializable; -import java.util.List; -import java.util.stream.Collectors; - -public class OrganizationMapper implements Serializable { - - - -}