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; } } +