From 9e8abe59f8a63f9661914a3e721283a65fc562eb Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 10:36:00 +0100 Subject: [PATCH 1/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - part 2 --- .../dhp/schema/dump/oaf/Container.java | 3 +- .../dnetlib/dhp/schema/dump/oaf/Funder.java | 6 + .../dnetlib/dhp/schema/dump/oaf/Project.java | 8 ++ .../dhp/schema/dump/oaf/graph/Datasource.java | 113 ++++++++++++++++-- .../dhp/schema/dump/oaf/graph/Funder.java | 3 + .../dhp/schema/dump/oaf/graph/Fundings.java | 4 + .../dhp/schema/dump/oaf/graph/Granted.java | 8 ++ .../dhp/schema/dump/oaf/graph/Programme.java | 5 + .../dhp/schema/dump/oaf/graph/Project.java | 44 ++----- .../dump/oaf/graph/ResearchCommunity.java | 3 + .../dump/oaf/graph/ResearchInitiative.java | 14 +++ 11 files changed, 164 insertions(+), 47 deletions(-) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java index 85fcff7..177f077 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java @@ -36,12 +36,13 @@ public class Container implements Serializable { @JsonSchema(description="End page") private String ep; - @JsonSchema(description="Journal issue") + @JsonSchema(description="Journal issue number") private String iss; @JsonSchema(description="Start page") private String sp; + @JsonSchema(description = "Volume") private String vol; @JsonSchema(description="Edition of the journal or conference proceeding") diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java index 16cab22..112b8a6 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java @@ -1,13 +1,19 @@ package eu.dnetlib.dhp.schema.dump.oaf; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; public class Funder implements Serializable { + + @JsonSchema(description = "The short name of the funder (EC)") private String shortName; + @JsonSchema(description = "The name of the funder (European Commission)") private String name; + @JsonSchema(description = "The jurisdiction of the funder (i.e. EU)") private String jurisdiction; public String getJurisdiction() { diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java index 00cd7a0..96ad5e9 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; /** @@ -10,9 +12,13 @@ import java.io.Serializable; * the tile of the project */ public class Project implements Serializable { + @JsonSchema(description = "The OpenAIRE id for the project") protected String id;// OpenAIRE id + + @JsonSchema(description = "The grant agreement number") protected String code; + @JsonSchema(description = "The acronym of the project") protected String acronym; protected String title; @@ -49,3 +55,5 @@ public class Project implements Serializable { this.title = title; } } + + diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java index de845b3..dace8d7 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java @@ -4,6 +4,7 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; import java.io.Serializable; import java.util.List; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; import eu.dnetlib.dhp.schema.dump.oaf.Container; import eu.dnetlib.dhp.schema.dump.oaf.ControlledField; @@ -33,70 +34,91 @@ import eu.dnetlib.dhp.schema.dump.oaf.ControlledField; * datasource. It corresponds to description.value of the datasource represented in the internal model */ public class Datasource implements Serializable { - + @JsonSchema(description = "The OpenAIRE id of the data source") private String id; // string + @JsonSchema(description = "Original identifiers for the datasource") private List originalId; // list string - private List pid; // list + @JsonSchema(description = "Persistent identifiers of the datasource") + private List pid; // list - private ControlledField datasourcetype; // value + @JsonSchema(description = "The type of the datasource. See https://api.openaire.eu/vocabularies/dnet:datasource_typologies") + private DatasourceSchemeValue datasourcetype; // value + @JsonSchema(description = "OpenAIRE guidelines the data source comply with. See also https://guidelines.openaire.eu.") private String openairecompatibility; // value + @JsonSchema(description = "The official name of the datasource") private String officialname; // string + @JsonSchema(description = "The English name of the datasource") private String englishname; // string private String websiteurl; // string private String logourl; // string + @JsonSchema(description = "The date of last validation against the OpenAIRE guidelines for the datasource records") private String dateofvalidation; // string private String description; // description + @JsonSchema(description = "List of subjects associated to the datasource") private List subjects; // List // opendoar specific fields (od*) + @JsonSchema(description = "The languages present in the data source's content, as defined by OpenDOAR.") private List languages; // odlanguages List + @JsonSchema(description = "Types of content in the data source, as defined by OpenDOAR") private List contenttypes; // odcontent types List // re3data fields + @JsonSchema(description = "Releasing date of the data source, as defined by re3data.org") private String releasestartdate; // string + @JsonSchema(description = "Date when the data source went offline or stopped ingesting new research data. As defined by re3data.org") private String releaseenddate; // string + @JsonSchema(description = "The URL of a mission statement describing the designated community of the data source. As defined by re3data.org") private String missionstatementurl; // string - // {open, restricted or closed} + @JsonSchema(description = "Type of access to the data source, as defined by re3data.org. Possible values: " + + "{open, restricted, closed}") private String accessrights; // databaseaccesstype string // {open, restricted or closed} + @JsonSchema(description = "Type of data upload. As defined by re3data.org: one of {open, restricted,closed}") private String uploadrights; // datauploadtype string - // {feeRequired, registration, other} + @JsonSchema(description = "Access restrinctions to the data source, as defined by re3data.org. One of {feeRequired, registration, other}") private String databaseaccessrestriction; // string - // {feeRequired, registration, other} + @JsonSchema(description = "Upload restrictions applied by the datasource, as defined by re3data.org. One of {feeRequired, registration, other}") private String datauploadrestriction; // string + @JsonSchema(description = "As defined by redata.org: 'yes' if the data source supports versioning, 'no' otherwise.") private Boolean versioning; // boolean + @JsonSchema(description = "The URL of the data source providing information on how to cite its items. As defined by re3data.org.") private String citationguidelineurl; // string // {yes, no, uknown} - + @JsonSchema(description = "The persistent identifier system that is used by the data source. As defined by re3data.org") private String pidsystems; // string + @JsonSchema(description = "The certificate, seal or standard the data source complies with. As defined by re3data.org.") private String certificates; // string + @JsonSchema(description = "Policies of the data source, as defined in OpenDOAR.") private List policies; // + @JsonSchema(description = "Information about the journal, if this data source is of type Journal.") private Container journal; // issn etc del Journal + public String getId() { return id; } @@ -113,19 +135,19 @@ public class Datasource implements Serializable { this.originalId = originalId; } - public List getPid() { + public List getPid() { return pid; } - public void setPid(List pid) { + public void setPid(List pid) { this.pid = pid; } - public ControlledField getDatasourcetype() { + public DatasourceSchemeValue getDatasourcetype() { return datasourcetype; } - public void setDatasourcetype(ControlledField datasourcetype) { + public void setDatasourcetype(DatasourceSchemeValue datasourcetype) { this.datasourcetype = datasourcetype; } @@ -313,3 +335,72 @@ public class Datasource implements Serializable { this.journal = journal; } } + +//TODO change the DatasourceSchemaValue to DatasourceKeyValue. The scheme is always the dnet one. What we show here is the entry in the scheme (the key) and its understandable value +class DatasourceSchemeValue implements Serializable{ + @JsonSchema(description="The scheme used to express the value (i.e. pubsrepository::journal)") + private String scheme; + + @JsonSchema(description="The value expressed in the scheme (Journal)") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static DatasourceSchemeValue newInstance(String scheme, String value) { + DatasourceSchemeValue cf = new DatasourceSchemeValue(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } +} + +class DatasourcePid implements Serializable{ + + @JsonSchema(description="The scheme used to express the value ") + private String scheme; + + @JsonSchema(description="The value expressed in the scheme ") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static DatasourcePid newInstance(String scheme, String value) { + DatasourcePid cf = new DatasourcePid(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } + +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Funder.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Funder.java index 19e068f..81721d2 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Funder.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Funder.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To store information about the funder funding the project related to the result. It extends * eu.dnetlib.dhp.schema.dump.oaf.Funder with the following parameter: - - private @@ -8,6 +10,7 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; */ public class Funder extends eu.dnetlib.dhp.schema.dump.oaf.Funder { + @JsonSchema(description = "Description of the funding stream") private Fundings funding_stream; public Fundings getFunding_stream() { diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java index a74c347..0b695c4 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; /** @@ -14,6 +16,7 @@ import java.io.Serializable; */ public class Fundings implements Serializable { + @JsonSchema(description = "Id of the funding stream") private String id; private String description; @@ -33,3 +36,4 @@ public class Fundings implements Serializable { this.description = description; } } + diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java index 3dec2df..22d48a2 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; /** @@ -9,8 +11,13 @@ import java.io.Serializable; * funded amount by the funder */ public class Granted implements Serializable { + @JsonSchema(description = "The currency of the granted amount (e.g. EUR)") private String currency; + + @JsonSchema(description = "The total cost of the project") private float totalcost; + + @JsonSchema(description = "The funded amount") private float fundedamount; public String getCurrency() { @@ -52,3 +59,4 @@ public class Granted implements Serializable { return granted; } } + diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java index 9892790..9b9113d 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; /** @@ -8,7 +10,10 @@ import java.io.Serializable; * to store the code of the programme - private String description to store the description of the programme */ public class Programme implements Serializable { + @JsonSchema(description = "The code of the programme") private String code; + + @JsonSchema(description = "The description of the programme") private String description; public String getCode() { diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java index f2a4a75..d1fa714 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; import java.util.List; @@ -35,12 +37,10 @@ import java.util.List; */ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { - //private String id; + private String websiteurl; - //private String code; - //private String acronym; - //private String title; + private String startdate; private String enddate; @@ -54,22 +54,17 @@ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { private boolean openaccessmandatefordataset; private List subject; + @JsonSchema(description = "Funding information for the project") private List funding; private String summary; + @JsonSchema(description = "The money granted to the project") private Granted granted; + @JsonSchema(description = "The h2020 programme funding the project") private List h2020programme; -// public String getId() { -// return id; -// } -// -// public void setId(String id) { -// this.id = id; -// } - public String getWebsiteurl() { return websiteurl; } @@ -78,29 +73,6 @@ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { 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; @@ -190,3 +162,5 @@ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { this.h2020programme = h2020programme; } } + + diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java index 026042c..3d4e631 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.util.List; /** @@ -8,6 +10,7 @@ import java.util.List; * to store the list of subjects related to the community */ public class ResearchCommunity extends ResearchInitiative { + @JsonSchema(description = "Only for research communities: the list of the subjects associated to the research community") private List subject; public List getSubject() { diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java index f79cd2a..da458ed 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import java.io.Serializable; /** @@ -18,11 +20,22 @@ import java.io.Serializable; * zenodo_community to store the zenodo community associated to the context (main zenodo community) */ public class ResearchInitiative implements Serializable { + @JsonSchema(description = "The OpenAIRE id for the community/research infrastructure") private String id; // openaireId + + @JsonSchema(description = "The acronym of the community") private String acronym; // context id + + @JsonSchema(description = "The long name of the community") private String name; // context name + + @JsonSchema(description = "One of {Research Community, Research infrastructure}") private String type; // context type: research initiative or research community + + @JsonSchema(description = "Description of the research community/research infrastructure") private String description; + + @JsonSchema(description = "The URL of the Zenodo community associated to the Research community/Research infrastructure") private String zenodo_community; public String getZenodo_community() { @@ -73,3 +86,4 @@ public class ResearchInitiative implements Serializable { this.description = description; } } + From fd0f1d5068ee326e3200622f6a740df409622a7d Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 11:01:44 +0100 Subject: [PATCH 2/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - refactoring --- .../java/eu/dnetlib/dhp/schema/dump/oaf/Author.java | 4 ++-- .../eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java | 6 ++---- .../dnetlib/dhp/schema/dump/oaf/BestAccessRight.java | 5 ++--- .../eu/dnetlib/dhp/schema/dump/oaf/Container.java | 4 ++-- .../dnetlib/dhp/schema/dump/oaf/ControlledField.java | 4 ++-- .../java/eu/dnetlib/dhp/schema/dump/oaf/Country.java | 4 ++-- .../java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java | 4 ++-- .../java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java | 11 +++++------ .../java/eu/dnetlib/dhp/schema/dump/oaf/Language.java | 5 ++--- .../java/eu/dnetlib/dhp/schema/dump/oaf/Project.java | 6 ++---- .../eu/dnetlib/dhp/schema/dump/oaf/Provenance.java | 4 ++-- .../eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java | 4 ++-- .../java/eu/dnetlib/dhp/schema/dump/oaf/Result.java | 4 ++-- .../eu/dnetlib/dhp/schema/dump/oaf/ResultCountry.java | 1 - .../eu/dnetlib/dhp/schema/dump/oaf/ResultPid.java | 5 ++--- .../java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java | 5 ++--- .../schema/dump/oaf/community/CommunityResult.java | 3 +-- .../dnetlib/dhp/schema/dump/oaf/graph/Datasource.java | 1 + .../dnetlib/dhp/schema/dump/oaf/graph/Fundings.java | 5 ++--- .../eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java | 5 ++--- .../dhp/schema/dump/oaf/graph/GraphResult.java | 1 + .../eu/dnetlib/dhp/schema/dump/oaf/graph/Node.java | 4 ++-- .../dnetlib/dhp/schema/dump/oaf/graph/Programme.java | 4 ++-- .../eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java | 6 ++---- .../eu/dnetlib/dhp/schema/dump/oaf/graph/RelType.java | 5 ++--- .../dnetlib/dhp/schema/dump/oaf/graph/Relation.java | 1 + .../dhp/schema/dump/oaf/graph/ResearchCommunity.java | 4 ++-- .../dhp/schema/dump/oaf/graph/ResearchInitiative.java | 5 ++--- .../dhp/schema/oaf/dump/GenerateJsonSchema.java | 3 +-- 29 files changed, 54 insertions(+), 69 deletions(-) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Author.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Author.java index 4a4eebe..3c7710b 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Author.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Author.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * Used to represent the generic author of the result. It has six parameters: - name of type String to store the given * name of the author. The value for this parameter corresponds to eu.dnetlib.dhp.schema.oaf.Author name - surname of diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java index 0fb42db..2ad55c0 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent the generic persistent identifier. It has two parameters: * - id of type @@ -85,5 +85,3 @@ class AuthorPidSchemeValue implements Serializable{ return cf; } } - - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/BestAccessRight.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/BestAccessRight.java index 7d73e72..06ec001 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/BestAccessRight.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/BestAccessRight.java @@ -1,9 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * BestAccessRight. Used to represent the result best access rights. Values for this element are found against the * COAR access right scheme. The classid of the element accessright in eu.dnetlib.dhp.schema.oaf.Result is used to get @@ -56,4 +56,3 @@ public class BestAccessRight implements Serializable { return ar; } } - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java index 177f077..bef5f74 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Container.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To store information about the conference or journal where the result has been presented or published. It contains * eleven parameters: - name of type String to store the name of the journal or conference. It corresponds to the diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java index feb1610..978171a 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent the information described by a scheme and a value in that scheme (i.e. doi). It has two parameters: - * scheme of type String to store the scheme - value of type String to store the value in that scheme diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Country.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Country.java index 4378389..0cf58b3 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Country.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Country.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * Represents the country associated to the generic entity. It extends eu.dnetlib.dhp.schema.dump.oaf.Qualifier with a * provenance parameter of type eu.dnetlib.dhp.schema.dumo.oaf.Provenance. The country in not mapped if its value in the diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java index 112b8a6..06af521 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + public class Funder implements Serializable { @JsonSchema(description = "The short name of the funder (EC)") diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java index 4820456..0e634e0 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java @@ -1,13 +1,14 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; -import org.apache.commons.lang3.StringUtils; - import java.io.Serializable; import java.util.List; +import org.apache.commons.lang3.StringUtils; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * Represents the manifestations (i.e. different versions) of the result. For example: the pre-print and the published * versions are two manifestations of the same research result. It has the following parameters: - license of type @@ -210,5 +211,3 @@ class AlternateIdentifier implements Serializable{ return cf; } } - - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Language.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Language.java index 8e147e2..6d4de35 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Language.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Language.java @@ -1,9 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + public class Language implements Serializable { @JsonSchema(description="alpha-3/ISO 639-2 code of the language") @@ -35,4 +35,3 @@ public class Language implements Serializable { return qualifier; } } - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java index 96ad5e9..fc7472b 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Project.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * This class to store the common information about the project that will be dumped for community and for the whole * graph - private String id to store the id of the project (OpenAIRE id) - private String code to store the grant @@ -55,5 +55,3 @@ public class Project implements Serializable { this.title = title; } } - - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Provenance.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Provenance.java index 8217cd5..884d02d 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Provenance.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Provenance.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * Indicates the process that produced (or provided) the information, and the trust associated to the information. It * has two parameters: - provenance of type String to store the provenance of the information, - trust of type String to diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java index 67ccf61..e977ee2 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent the information described by a code and a value It has two parameters: - code to store the code * (generally the classid of the eu.dnetlib.dhp.schema.oaf.Qualifier element) - label to store the label (generally the diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Result.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Result.java index bffa647..560f74b 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Result.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Result.java @@ -1,11 +1,11 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; import java.util.List; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent the dumped result. It will be extended in the dump for Research Communities - Research * Initiative/Infrastructures. It has the following parameters: diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultCountry.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultCountry.java index 5401a36..df2650b 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultCountry.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultCountry.java @@ -1,6 +1,5 @@ package eu.dnetlib.dhp.schema.dump.oaf; - import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; /** diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultPid.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultPid.java index e0a29ee..f95d06e 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultPid.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ResultPid.java @@ -1,9 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + public class ResultPid implements Serializable { @JsonSchema(description="The scheme of the persistent identifier for the result (i.e. doi). " + "If the pid is here it means the information for the pid has been collected from an authority for " + @@ -39,4 +39,3 @@ public class ResultPid implements Serializable { return cf; } } - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java index f91cb50..67a21fc 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent keywords associated to the result. It has two parameters: * - subject of type eu.dnetlib.dhp.schema.dump.oaf.SubjectSchemeValue to describe the subject. It mapped as: @@ -72,4 +72,3 @@ class SubjectSchemeValue implements Serializable{ } } - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java index 9084fb9..d32247f 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java @@ -4,6 +4,7 @@ package eu.dnetlib.dhp.schema.dump.oaf.community; import java.util.List; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.KeyValue; import eu.dnetlib.dhp.schema.dump.oaf.Result; @@ -63,5 +64,3 @@ public class CommunityResult extends Result { } } - - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java index dace8d7..5ec2598 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.List; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.Container; import eu.dnetlib.dhp.schema.dump.oaf.ControlledField; diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java index 0b695c4..56dacda 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Fundings.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To store inforamtion about the funding stream. It has two parameters: - private String id to store the id of the * fundings stream. The id is created by appending the shortname of the funder to the name of each level in the xml @@ -36,4 +36,3 @@ public class Fundings implements Serializable { this.description = description; } } - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java index 22d48a2..a4d3fa2 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Granted.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To describe the funded amount. It has the following parameters: - private String currency to store the currency of * the fund - private float totalcost to store the total cost of the project - private float fundedamount to store the @@ -59,4 +59,3 @@ public class Granted implements Serializable { return granted; } } - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/GraphResult.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/GraphResult.java index b60140a..654b75e 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/GraphResult.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/GraphResult.java @@ -4,6 +4,7 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; import java.util.List; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.Instance; import eu.dnetlib.dhp.schema.dump.oaf.Result; diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Node.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Node.java index 11aecc6..4146c01 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Node.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Node.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent the generic node in a relation. It has the following parameters: - private String id the openaire id of * the entity in the relation - private String type the type of the entity in the relation. Consider the generic diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java index 9b9113d..6ffaaac 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Programme.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To store information about the ec programme for the project. It has the following parameters: - private String code * to store the code of the programme - private String description to store the description of the programme diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java index d1fa714..63862a4 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Project.java @@ -1,11 +1,11 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; import java.util.List; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * This is the class representing the Project in the model used for the dumps of the whole graph. At the moment the dump * of the Projects differs from the other dumps because we do not create relations between Funders (Organization) and @@ -162,5 +162,3 @@ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { this.h2020programme = h2020programme; } } - - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/RelType.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/RelType.java index 618fff1..9773930 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/RelType.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/RelType.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent the semantics of the generic relation between two entities. It has the following parameters: - private * String name to store the semantics of the relation (i.e. isAuthorInstitutionOf). It corresponds to the relclass @@ -42,4 +42,3 @@ public class RelType implements Serializable { return rel; } } - 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 fe42211..07bc3c4 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 @@ -5,6 +5,7 @@ import java.io.Serializable; import java.util.Objects; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.Provenance; /** diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java index 3d4e631..95fe861 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchCommunity.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.util.List; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent RC entities. It extends eu.dnetlib.dhp.dump.oaf.grap.ResearchInitiative by adding the parameter subject * to store the list of subjects related to the community diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java index da458ed..4ea9730 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/ResearchInitiative.java @@ -1,10 +1,10 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * To represent entity of type RC/RI. It has the following parameters, which are mostly derived by the profile * - private @@ -86,4 +86,3 @@ public class ResearchInitiative implements Serializable { this.description = description; } } - diff --git a/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java b/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java index 0bc2a46..a12f281 100644 --- a/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java +++ b/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java @@ -4,10 +4,9 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.JsonNode; -import com.github.victools.jsonschema.generator.*; import com.fasterxml.jackson.databind.ObjectMapper; - import com.github.imifou.jsonschema.module.addon.AddonModule; +import com.github.victools.jsonschema.generator.*; import eu.dnetlib.dhp.schema.dump.oaf.graph.*; From 82720345f07441c28165fcb430dc4ed123d37849 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 11:23:48 +0100 Subject: [PATCH 3/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - pat 3 --- .../schema/dump/oaf/AlternateIdentifier.java | 40 +++++++++++ .../dhp/schema/dump/oaf/AuthorPid.java | 33 --------- .../schema/dump/oaf/AuthorPidSchemeValue.java | 39 +++++++++++ .../dnetlib/dhp/schema/dump/oaf/Instance.java | 69 ------------------- .../dnetlib/dhp/schema/dump/oaf/Measure.java | 44 ++++++++++++ .../dnetlib/dhp/schema/dump/oaf/Subject.java | 34 --------- .../schema/dump/oaf/SubjectSchemeValue.java | 39 +++++++++++ 7 files changed, 162 insertions(+), 136 deletions(-) create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java new file mode 100644 index 0000000..ca15fe1 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java @@ -0,0 +1,40 @@ +package eu.dnetlib.dhp.schema.dump.oaf; + +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +import java.io.Serializable; + +public class AlternateIdentifier implements Serializable { + @JsonSchema(description="The scheme of the identifier. It can be a persistent identifier (i.e. doi). If it is present in the alternate identifiers " + + "it means it has not been forged by an authority for that pid. For example we collect metadata from an institutional repository that provides " + + "as identifier for the result also the doi") + private String scheme; + + @JsonSchema(description="The value expressed in the scheme") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static AlternateIdentifier newInstance(String scheme, String value) { + AlternateIdentifier cf = new AlternateIdentifier(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java index 2ad55c0..e77a078 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPid.java @@ -52,36 +52,3 @@ public class AuthorPid implements Serializable { } -class AuthorPidSchemeValue implements Serializable{ - - @JsonSchema(description="The author's pid scheme. OpenAIRE currently supports 'ORCID'") - private String scheme; - - @JsonSchema(description="The author's pid value in that scheme (i.e. 0000-1111-2222-3333") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static AuthorPidSchemeValue newInstance(String scheme, String value) { - AuthorPidSchemeValue cf = new AuthorPidSchemeValue(); - - cf.setScheme(scheme); - cf.setValue(value); - - return cf; - } -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java new file mode 100644 index 0000000..d2db604 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java @@ -0,0 +1,39 @@ +package eu.dnetlib.dhp.schema.dump.oaf; + +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +import java.io.Serializable; + +public class AuthorPidSchemeValue implements Serializable { + + @JsonSchema(description="The author's pid scheme. OpenAIRE currently supports 'ORCID'") + private String scheme; + + @JsonSchema(description="The author's pid value in that scheme (i.e. 0000-1111-2222-3333") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static AuthorPidSchemeValue newInstance(String scheme, String value) { + AuthorPidSchemeValue cf = new AuthorPidSchemeValue(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java index 0e634e0..b8b2fbc 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Instance.java @@ -140,74 +140,5 @@ public class Instance implements Serializable { } } -class Measure implements Serializable{ - @JsonSchema(description = "The measure (i.e. popularity)") - private String key; - @JsonSchema(description = "The value for that measure") - private String value; - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static Measure newInstance(String key, String value) { - Measure inst = new Measure(); - inst.key = key; - inst.value = value; - return inst; - } - - @JsonIgnore - public boolean isBlank() { - return StringUtils.isBlank(key) && StringUtils.isBlank(value); - } - -} - -class AlternateIdentifier implements Serializable{ - @JsonSchema(description="The scheme of the identifier. It can be a persistent identifier (i.e. doi). If it is present in the alternate identifiers " + - "it means it has not been forged by an authority for that pid. For example we collect metadata from an institutional repository that provides " + - "as identifier for the result also the doi") - private String scheme; - - @JsonSchema(description="The value expressed in the scheme") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static AlternateIdentifier newInstance(String scheme, String value) { - AlternateIdentifier cf = new AlternateIdentifier(); - - cf.setScheme(scheme); - cf.setValue(value); - - return cf; - } -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java new file mode 100644 index 0000000..ebfbf24 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java @@ -0,0 +1,44 @@ +package eu.dnetlib.dhp.schema.dump.oaf; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; + +public class Measure implements Serializable { + @JsonSchema(description = "The measure (i.e. popularity)") + private String key; + + @JsonSchema(description = "The value for that measure") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static Measure newInstance(String key, String value) { + Measure inst = new Measure(); + inst.key = key; + inst.value = value; + return inst; + } + + @JsonIgnore + public boolean isBlank() { + return StringUtils.isBlank(key) && StringUtils.isBlank(value); + } + +} \ No newline at end of file diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java index 67a21fc..2edee2f 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Subject.java @@ -38,37 +38,3 @@ public class Subject implements Serializable { } } - -class SubjectSchemeValue implements Serializable{ - @JsonSchema(description="OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies).") - private String scheme; - - @JsonSchema(description="The value for the subject in the selected scheme. When the scheme is 'keyword', it means that the subject is free-text (i.e. not a term from a controlled vocabulary).") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static SubjectSchemeValue newInstance(String scheme, String value) { - SubjectSchemeValue cf = new SubjectSchemeValue(); - - cf.setScheme(scheme); - cf.setValue(value); - - return cf; - } - -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java new file mode 100644 index 0000000..58a6224 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java @@ -0,0 +1,39 @@ +package eu.dnetlib.dhp.schema.dump.oaf; + +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +import java.io.Serializable; + +public class SubjectSchemeValue implements Serializable { + @JsonSchema(description="OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies).") + private String scheme; + + @JsonSchema(description="The value for the subject in the selected scheme. When the scheme is 'keyword', it means that the subject is free-text (i.e. not a term from a controlled vocabulary).") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static SubjectSchemeValue newInstance(String scheme, String value) { + SubjectSchemeValue cf = new SubjectSchemeValue(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } + +} From a222c28fecd20386964143e3cdf9c3d2ce878770 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 11:24:32 +0100 Subject: [PATCH 4/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - refactoring --- .../dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java | 4 ++-- .../dhp/schema/dump/oaf/AuthorPidSchemeValue.java | 4 ++-- .../java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java | 9 +++++---- .../dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java index ca15fe1..e48a564 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AlternateIdentifier.java @@ -1,9 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + public class AlternateIdentifier implements Serializable { @JsonSchema(description="The scheme of the identifier. It can be a persistent identifier (i.e. doi). If it is present in the alternate identifiers " + "it means it has not been forged by an authority for that pid. For example we collect metadata from an institutional repository that provides " + diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java index d2db604..3439514 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java @@ -1,9 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + public class AuthorPidSchemeValue implements Serializable { @JsonSchema(description="The author's pid scheme. OpenAIRE currently supports 'ORCID'") diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java index ebfbf24..4c86001 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Measure.java @@ -1,10 +1,11 @@ package eu.dnetlib.dhp.schema.dump.oaf; +import java.io.Serializable; + +import org.apache.commons.lang3.StringUtils; + import com.fasterxml.jackson.annotation.JsonIgnore; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; -import org.apache.commons.lang3.StringUtils; - -import java.io.Serializable; public class Measure implements Serializable { @JsonSchema(description = "The measure (i.e. popularity)") @@ -41,4 +42,4 @@ public class Measure implements Serializable { return StringUtils.isBlank(key) && StringUtils.isBlank(value); } -} \ No newline at end of file +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java index 58a6224..9228088 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/SubjectSchemeValue.java @@ -1,9 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf; -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - import java.io.Serializable; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + public class SubjectSchemeValue implements Serializable { @JsonSchema(description="OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies).") private String scheme; From 61400f22c2046b9f470f00fee2fac9c5177fb3e1 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 11:49:16 +0100 Subject: [PATCH 5/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - part 4 --- .../dhp/schema/dump/oaf/graph/Datasource.java | 67 ------------------- .../schema/dump/oaf/graph/DatasourcePid.java | 40 +++++++++++ .../dump/oaf/graph/DatasourceSchemeValue.java | 39 +++++++++++ .../schema/dump/oaf/graph/Organization.java | 26 ------- .../dump/oaf/graph/OrganizationPid.java | 31 +++++++++ 5 files changed, 110 insertions(+), 93 deletions(-) create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourcePid.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourceSchemeValue.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java index 5ec2598..7081863 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java @@ -337,71 +337,4 @@ public class Datasource implements Serializable { } } -//TODO change the DatasourceSchemaValue to DatasourceKeyValue. The scheme is always the dnet one. What we show here is the entry in the scheme (the key) and its understandable value -class DatasourceSchemeValue implements Serializable{ - @JsonSchema(description="The scheme used to express the value (i.e. pubsrepository::journal)") - private String scheme; - @JsonSchema(description="The value expressed in the scheme (Journal)") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static DatasourceSchemeValue newInstance(String scheme, String value) { - DatasourceSchemeValue cf = new DatasourceSchemeValue(); - - cf.setScheme(scheme); - cf.setValue(value); - - return cf; - } -} - -class DatasourcePid implements Serializable{ - - @JsonSchema(description="The scheme used to express the value ") - private String scheme; - - @JsonSchema(description="The value expressed in the scheme ") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static DatasourcePid newInstance(String scheme, String value) { - DatasourcePid cf = new DatasourcePid(); - - cf.setScheme(scheme); - cf.setValue(value); - - return cf; - } - -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourcePid.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourcePid.java new file mode 100644 index 0000000..6ecdccc --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourcePid.java @@ -0,0 +1,40 @@ +package eu.dnetlib.dhp.schema.dump.oaf.graph; + +import java.io.Serializable; + +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +public class DatasourcePid implements Serializable { + + @JsonSchema(description="The scheme used to express the value ") + private String scheme; + + @JsonSchema(description="The value expressed in the scheme ") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static DatasourcePid newInstance(String scheme, String value) { + DatasourcePid cf = new DatasourcePid(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } + +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourceSchemeValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourceSchemeValue.java new file mode 100644 index 0000000..8963444 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/DatasourceSchemeValue.java @@ -0,0 +1,39 @@ +package eu.dnetlib.dhp.schema.dump.oaf.graph; + +import java.io.Serializable; + +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +public //TODO change the DatasourceSchemaValue to DatasourceKeyValue. The scheme is always the dnet one. What we show here is the entry in the scheme (the key) and its understandable value +class DatasourceSchemeValue implements Serializable { + @JsonSchema(description="The scheme used to express the value (i.e. pubsrepository::journal)") + private String scheme; + + @JsonSchema(description="The value expressed in the scheme (Journal)") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static DatasourceSchemeValue newInstance(String scheme, String value) { + DatasourceSchemeValue cf = new DatasourceSchemeValue(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Organization.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Organization.java index 13ceac0..36fdff9 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Organization.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Organization.java @@ -94,30 +94,4 @@ public class Organization implements Serializable { } -class OrganizationPid implements Serializable{ - @JsonSchema(description="The scheme of the identifier (i.e. isni)") - private String scheme; - - @JsonSchema(description="The value in the schema (i.e. 0000000090326370)") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} - - - diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java new file mode 100644 index 0000000..cbec156 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java @@ -0,0 +1,31 @@ +package eu.dnetlib.dhp.schema.dump.oaf.graph; + +import java.io.Serializable; + +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +public + +class OrganizationPid implements Serializable { + @JsonSchema(description="The scheme of the identifier (i.e. isni)") + private String scheme; + + @JsonSchema(description="The value in the schema (i.e. 0000000090326370)") + private String value; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} From 823b4cc2100f085a23f4174d5525623eabd7224b Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 11:55:43 +0100 Subject: [PATCH 6/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - part 5 --- .../dhp/schema/dump/oaf/graph/OrganizationPid.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java index cbec156..399daec 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/OrganizationPid.java @@ -28,4 +28,15 @@ class OrganizationPid implements Serializable { public void setValue(String value) { this.value = value; } + + public static OrganizationPid newInstance(String scheme, String value) { + OrganizationPid cf = new OrganizationPid(); + + cf.setScheme(scheme); + cf.setValue(value); + + return cf; + } + + } From 11e062f54c4b9413f4de88e2e5e8daaba1c87a33 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 19 Nov 2021 14:42:12 +0100 Subject: [PATCH 7/8] [Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - part 6 --- pom.xml | 32 ++++++++- .../dhp/schema/dump/ExecCreateSchemas.java | 72 +++++++++++++++++++ .../schema/dump/oaf/AuthorPidSchemeValue.java | 2 +- .../dhp/schema/dump/oaf/ControlledField.java | 43 ----------- .../dnetlib/dhp/schema/dump/oaf/Funder.java | 2 +- .../dnetlib/dhp/schema/dump/oaf/KeyValue.java | 48 ------------- .../dhp/schema/dump/oaf/Qualifier.java | 43 ----------- .../dump/oaf/community/CfHbKeyValue.java | 46 ++++++++++++ .../dump/oaf/community/CommunityInstance.java | 18 +++-- .../dump/oaf/community/CommunityResult.java | 10 +-- .../schema/dump/oaf/community/Context.java | 29 +++++++- .../dhp/schema/dump/oaf/community/Funder.java | 3 + .../schema/dump/oaf/community/Project.java | 3 + .../dhp/schema/dump/oaf/graph/Datasource.java | 1 - .../schema/oaf/dump/GenerateJsonSchema.java | 10 +++ 15 files changed, 211 insertions(+), 151 deletions(-) create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java delete mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java delete mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/KeyValue.java delete mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java create mode 100644 src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CfHbKeyValue.java diff --git a/pom.xml b/pom.xml index 4b499a8..4ceda6a 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,23 @@ maven-dependency-plugin 3.0.0 + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + + + com.fasterxml.jackson.core + jackson-databind + ${dhp.jackson.version} + + + + + + @@ -229,6 +245,19 @@ ${scala.version} + + org.codehaus.mojo + exec-maven-plugin + + true + eu.dnetlib.dhp.schema.dump.ExecCreateSchemas + + eu.dnetlib.dhp.schema.dump.oaf.GraphResult;eu.dnetlib.dhp.schema.dump.oaf.graph.Organization;eu.dnetlib.dhp.schema.dump.oaf.graph.Project + + + + + @@ -364,13 +393,14 @@ com.github.victools jsonschema-generator ${jsonschemagenerator.version} - test + com.github.imifou jsonschema-module-addon 1.2.1 + diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java b/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java new file mode 100644 index 0000000..2b25caf --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java @@ -0,0 +1,72 @@ +package eu.dnetlib.dhp.schema.dump; + +import java.io.*; +import java.lang.reflect.Type; +import java.nio.file.Files; +import java.nio.file.Paths; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.github.imifou.jsonschema.module.addon.AddonModule; +import com.github.victools.jsonschema.generator.*; + +import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityResult; +import eu.dnetlib.dhp.schema.dump.oaf.graph.*; + +public class ExecCreateSchemas { + + SchemaGenerator generator; + + private void init(){ + + AddonModule module = new AddonModule(); + SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder( + new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT), + SchemaVersion.DRAFT_7, + OptionPreset.PLAIN_JSON) + .with(module) + .with(Option.SCHEMA_VERSION_INDICATOR) + .without(Option.NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS); + SchemaGeneratorConfig config = configBuilder.build(); + generator = new SchemaGenerator(config); + } + + private void generate(Type targetType, String directory, String filename) throws IOException { + JsonNode jsonSchema = generator.generateSchema(targetType); + + if(!Files.exists(Paths.get(directory))){ + Files.createDirectories(Paths.get(directory)); + } + + if(!Files.exists(Paths.get(directory + filename))) { + Files.createFile(Paths.get(directory + filename)); + } + + File f = new File(directory + filename); + + try(PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(f)))) { + writer.println(new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema)); + } + + + } + public static void main(String[] args) throws IOException { + + ExecCreateSchemas ecs = new ExecCreateSchemas(); + ecs.init(); + ecs.generate(GraphResult.class, "/tmp/jsonschemas/" , "result_schema.json"); + ecs.generate(ResearchCommunity.class, "/tmp/jsonschemas/" , "community_infrastructure_schema.json"); + ecs.generate(Datasource.class, "/tmp/jsonschemas/" , "datasource_schema.json"); + ecs.generate(Project.class, "/tmp/jsonschemas/" , "project_schema.json"); + ecs.generate(Relation.class, "/tmp/jsonschemas/" , "relation_schema.json"); + ecs.generate(Organization.class, "/tmp/jsonschemas/" , "organization_schema.json"); + + ecs.generate(CommunityResult.class, "/tmp/jsonschemas/" , "community_result_schema.json"); + + + + + + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java index 3439514..3e22c9f 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/AuthorPidSchemeValue.java @@ -9,7 +9,7 @@ public class AuthorPidSchemeValue implements Serializable { @JsonSchema(description="The author's pid scheme. OpenAIRE currently supports 'ORCID'") private String scheme; - @JsonSchema(description="The author's pid value in that scheme (i.e. 0000-1111-2222-3333") + @JsonSchema(description="The author's pid value in that scheme (i.e. 0000-1111-2222-3333)") private String value; public String getScheme() { diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java deleted file mode 100644 index 978171a..0000000 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/ControlledField.java +++ /dev/null @@ -1,43 +0,0 @@ - -package eu.dnetlib.dhp.schema.dump.oaf; - -import java.io.Serializable; - -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - -/** - * To represent the information described by a scheme and a value in that scheme (i.e. doi). It has two parameters: - - * scheme of type String to store the scheme - value of type String to store the value in that scheme - */ -public class ControlledField implements Serializable { - @JsonSchema(description="The scheme used to express the value (i.e. doi)") - private String scheme; - - @JsonSchema(description="The value expressed in the scheme (i.e. 10.1000/182)") - private String value; - - public String getScheme() { - return scheme; - } - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static ControlledField newInstance(String scheme, String value) { - ControlledField cf = new ControlledField(); - - cf.setScheme(scheme); - cf.setValue(value); - - return cf; - } -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java index 06af521..674b8b3 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Funder.java @@ -13,7 +13,7 @@ public class Funder implements Serializable { @JsonSchema(description = "The name of the funder (European Commission)") private String name; - @JsonSchema(description = "The jurisdiction of the funder (i.e. EU)") + @JsonSchema(description = "Geographical jurisdiction (e.g. for European Commission is EU, for Croatian Science Foundation is HR)") private String jurisdiction; public String getJurisdiction() { diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/KeyValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/KeyValue.java deleted file mode 100644 index 849aa4d..0000000 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/KeyValue.java +++ /dev/null @@ -1,48 +0,0 @@ - -package eu.dnetlib.dhp.schema.dump.oaf; - -import java.io.Serializable; - -import org.apache.commons.lang3.StringUtils; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** - * To represent the information described by a key and a value. It has two parameters: - key to store the key (generally - * the OpenAIRE id for some entity) - value to store the value (generally the OpenAIRE name for the key) - */ -public class KeyValue implements Serializable { - - private String key; - - private String value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static KeyValue newInstance(String key, String value) { - KeyValue inst = new KeyValue(); - inst.key = key; - inst.value = value; - return inst; - } - - @JsonIgnore - public boolean isBlank() { - return StringUtils.isBlank(key) && StringUtils.isBlank(value); - } - -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java deleted file mode 100644 index e977ee2..0000000 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/Qualifier.java +++ /dev/null @@ -1,43 +0,0 @@ - -package eu.dnetlib.dhp.schema.dump.oaf; - -import java.io.Serializable; - -import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; - -/** - * To represent the information described by a code and a value It has two parameters: - code to store the code - * (generally the classid of the eu.dnetlib.dhp.schema.oaf.Qualifier element) - label to store the label (generally the - * classname of the eu.dnetlib.dhp.schema.oaf.Qualifier element - */ -public class Qualifier implements Serializable { - - @JsonSchema(description="A code in vocabulary ") - private String code; // the classid in the Qualifier - - @JsonSchema(description="A label for that code ") - private String label; // the classname in the Qualifier - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public static Qualifier newInstance(String code, String value) { - Qualifier qualifier = new Qualifier(); - qualifier.setCode(code); - qualifier.setLabel(value); - return qualifier; - } -} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CfHbKeyValue.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CfHbKeyValue.java new file mode 100644 index 0000000..68bda2d --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CfHbKeyValue.java @@ -0,0 +1,46 @@ +package eu.dnetlib.dhp.schema.dump.oaf.community; + +import java.io.Serializable; + +import org.apache.commons.lang3.StringUtils; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + +public class CfHbKeyValue implements Serializable { + + @JsonSchema(description = "the OpenAIRE identifier of the data source") + private String key; + + @JsonSchema(description = "the name of the data source") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static CfHbKeyValue newInstance(String key, String value) { + CfHbKeyValue inst = new CfHbKeyValue(); + inst.key = key; + inst.value = value; + return inst; + } + + @JsonIgnore + public boolean isBlank() { + return StringUtils.isBlank(key) && StringUtils.isBlank(value); + } + +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityInstance.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityInstance.java index 6a605d7..5e5a87e 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityInstance.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityInstance.java @@ -1,8 +1,9 @@ package eu.dnetlib.dhp.schema.dump.oaf.community; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.Instance; -import eu.dnetlib.dhp.schema.dump.oaf.KeyValue; /** * It extends eu.dnetlib.dhp.dump.oaf.Instance with values related to the community dump. In the Result dump this @@ -15,22 +16,25 @@ import eu.dnetlib.dhp.schema.dump.oaf.KeyValue; * collectedfrom.key - value corresponds to collectedfrom.value */ public class CommunityInstance extends Instance { - private KeyValue hostedby; - private KeyValue collectedfrom; + @JsonSchema(description = "Information about the source from which the instance can be viewed or downloaded.") + private CfHbKeyValue hostedby; - public KeyValue getHostedby() { + @JsonSchema(description = "Information about the source from which the record has been collected") + private CfHbKeyValue collectedfrom; + + public CfHbKeyValue getHostedby() { return hostedby; } - public void setHostedby(KeyValue hostedby) { + public void setHostedby(CfHbKeyValue hostedby) { this.hostedby = hostedby; } - public KeyValue getCollectedfrom() { + public CfHbKeyValue getCollectedfrom() { return collectedfrom; } - public void setCollectedfrom(KeyValue collectedfrom) { + public void setCollectedfrom(CfHbKeyValue collectedfrom) { this.collectedfrom = collectedfrom; } } diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java index d32247f..d24f1e9 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/CommunityResult.java @@ -5,7 +5,6 @@ import java.util.List; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; -import eu.dnetlib.dhp.schema.dump.oaf.KeyValue; import eu.dnetlib.dhp.schema.dump.oaf.Result; /** @@ -22,11 +21,14 @@ import eu.dnetlib.dhp.schema.dump.oaf.Result; */ public class CommunityResult extends Result { + @JsonSchema(description = "List of projects (i.e. grants) that (co-)funded the production ofn the research results") private List projects; + @JsonSchema(description = "Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with OpenAIRE. Please see https://connect.openaire.eu") private List context; - protected List collectedfrom; + @JsonSchema(description = "Information about the sources from which the record has been collected") + protected List collectedfrom; @JsonSchema(description = "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version") private List instance; @@ -39,11 +41,11 @@ public class CommunityResult extends Result { this.instance = instance; } - public List getCollectedfrom() { + public List getCollectedfrom() { return collectedfrom; } - public void setCollectedfrom(List collectedfrom) { + public void setCollectedfrom(List collectedfrom) { this.collectedfrom = collectedfrom; } diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Context.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Context.java index d4c1d40..79c1647 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Context.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Context.java @@ -6,8 +6,9 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.Provenance; -import eu.dnetlib.dhp.schema.dump.oaf.Qualifier; /** * Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with @@ -21,7 +22,14 @@ import eu.dnetlib.dhp.schema.dump.oaf.Qualifier; * instantiated if the element datainfo.provenanceaction is not null. In this case - provenance corresponds to * dataInfo.provenanceaction.classname - trust corresponds to dataInfo.trust */ -public class Context extends Qualifier { +public class Context { + @JsonSchema(description="Code identifying the RI/RC") + private String code; + + @JsonSchema(description="Label of the RI/RC") + private String label; + + @JsonSchema(description = "Why this result is associated to the RI/RC.") private List provenance; public List getProvenance() { @@ -32,6 +40,23 @@ public class Context extends Qualifier { this.provenance = provenance; } + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + @Override public int hashCode() { final String p = Optional.ofNullable(getProvenance()) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Funder.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Funder.java index 5ea0d12..5e17e0c 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Funder.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/community/Funder.java @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.community; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + /** * 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 @@ -9,6 +11,7 @@ package eu.dnetlib.dhp.schema.dump.oaf.community; */ public class Funder extends eu.dnetlib.dhp.schema.dump.oaf.Funder { + @JsonSchema(description = "Stream of funding (e.g. for European Commission can be H2020 or FP7)") private String fundingStream; public String getFundingStream() { 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 eed0ae8..88c5216 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 @@ -1,6 +1,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.community; +import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; + import eu.dnetlib.dhp.schema.dump.oaf.Provenance; /** @@ -13,6 +15,7 @@ import eu.dnetlib.dhp.schema.dump.oaf.Provenance; */ public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project { + @JsonSchema(description = "Information about the funder funding the project") private Funder funder; private Provenance provenance; diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java index 7081863..3c2a7b3 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Datasource.java @@ -7,7 +7,6 @@ import java.util.List; import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema; import eu.dnetlib.dhp.schema.dump.oaf.Container; -import eu.dnetlib.dhp.schema.dump.oaf.ControlledField; /** * To store information about the datasource OpenAIRE collects information from. It contains the following parameters: - diff --git a/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java b/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java index a12f281..cca6d94 100644 --- a/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java +++ b/src/test/java/eu/dnetlib/dhp/schema/oaf/dump/GenerateJsonSchema.java @@ -1,5 +1,7 @@ package eu.dnetlib.dhp.schema.oaf.dump; +import java.io.IOException; + import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -8,6 +10,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.github.imifou.jsonschema.module.addon.AddonModule; import com.github.victools.jsonschema.generator.*; +import eu.dnetlib.dhp.schema.dump.ExecCreateSchemas; import eu.dnetlib.dhp.schema.dump.oaf.graph.*; //@Disabled @@ -42,4 +45,11 @@ class GenerateJsonSchema { System.out.println(jsonSchema.toString()); } + + + @Test + void generateJsonSchema3() throws IOException { + + ExecCreateSchemas.main(new String[]{}); + } } From 593034920a5695e1361c729c908c9d0bbd95d40d Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 19 Nov 2021 15:30:35 +0100 Subject: [PATCH 8/8] [Schema-Dump] added class to automatically generate schemas and save them in /eu/dnetlib/dhp/schema/oaf/dump/jsonschemas/ under target/classes (target/test-classes) directory --- .../dhp/schema/dump/ExecCreateSchemas.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java b/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java index 2b25caf..ca520cc 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java +++ b/src/main/java/eu/dnetlib/dhp/schema/dump/ExecCreateSchemas.java @@ -2,6 +2,7 @@ package eu.dnetlib.dhp.schema.dump; import java.io.*; import java.lang.reflect.Type; +import java.net.URL; import java.nio.file.Files; import java.nio.file.Paths; @@ -15,7 +16,7 @@ import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityResult; import eu.dnetlib.dhp.schema.dump.oaf.graph.*; public class ExecCreateSchemas { - + final static String DIRECTORY = "/eu/dnetlib/dhp/schema/oaf/dump/jsonschemas/"; SchemaGenerator generator; private void init(){ @@ -35,15 +36,17 @@ public class ExecCreateSchemas { private void generate(Type targetType, String directory, String filename) throws IOException { JsonNode jsonSchema = generator.generateSchema(targetType); - if(!Files.exists(Paths.get(directory))){ - Files.createDirectories(Paths.get(directory)); + String dir = Paths.get(Paths.get(getClass().getResource("/").getPath()).toAbsolutePath() + directory).toString(); + + if(!Files.exists(Paths.get(dir))){ + Files.createDirectories(Paths.get(dir)); } - if(!Files.exists(Paths.get(directory + filename))) { - Files.createFile(Paths.get(directory + filename)); + if(!Files.exists(Paths.get(dir + "/" + filename))) { + Files.createFile(Paths.get(dir + "/" + filename)); } - File f = new File(directory + filename); + File f = new File(dir + "/" + filename); try(PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(f)))) { writer.println(new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema)); @@ -55,14 +58,14 @@ public class ExecCreateSchemas { ExecCreateSchemas ecs = new ExecCreateSchemas(); ecs.init(); - ecs.generate(GraphResult.class, "/tmp/jsonschemas/" , "result_schema.json"); - ecs.generate(ResearchCommunity.class, "/tmp/jsonschemas/" , "community_infrastructure_schema.json"); - ecs.generate(Datasource.class, "/tmp/jsonschemas/" , "datasource_schema.json"); - ecs.generate(Project.class, "/tmp/jsonschemas/" , "project_schema.json"); - ecs.generate(Relation.class, "/tmp/jsonschemas/" , "relation_schema.json"); - ecs.generate(Organization.class, "/tmp/jsonschemas/" , "organization_schema.json"); + ecs.generate(GraphResult.class, DIRECTORY , "result_schema.json"); + ecs.generate(ResearchCommunity.class, DIRECTORY , "community_infrastructure_schema.json"); + ecs.generate(Datasource.class, DIRECTORY , "datasource_schema.json"); + ecs.generate(Project.class, DIRECTORY , "project_schema.json"); + ecs.generate(Relation.class, DIRECTORY , "relation_schema.json"); + ecs.generate(Organization.class, DIRECTORY , "organization_schema.json"); - ecs.generate(CommunityResult.class, "/tmp/jsonschemas/" , "community_result_schema.json"); + ecs.generate(CommunityResult.class, DIRECTORY , "community_result_schema.json");