[Schema-Dump] changed the model to allow to change the description annotation w.r.t. the specific semantics of the field - part 2

This commit is contained in:
Miriam Baglioni 2021-11-18 10:36:00 +01:00
parent 9c2aadac92
commit 9e8abe59f8
11 changed files with 164 additions and 47 deletions

View File

@ -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")

View File

@ -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() {

View File

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

View File

@ -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<String> originalId; // list string
private List<ControlledField> pid; // list<String>
@JsonSchema(description = "Persistent identifiers of the datasource")
private List<DatasourcePid> pid; // list<String>
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<String> subjects; // List<String>
// opendoar specific fields (od*)
@JsonSchema(description = "The languages present in the data source's content, as defined by OpenDOAR.")
private List<String> languages; // odlanguages List<String>
@JsonSchema(description = "Types of content in the data source, as defined by OpenDOAR")
private List<String> contenttypes; // odcontent types List<String>
// 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<String> 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<ControlledField> getPid() {
public List<DatasourcePid> getPid() {
return pid;
}
public void setPid(List<ControlledField> pid) {
public void setPid(List<DatasourcePid> 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;
}
}

View File

@ -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() {

View File

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

View File

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

View File

@ -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() {

View File

@ -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<String> subject;
@JsonSchema(description = "Funding information for the project")
private List<Funder> 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<Programme> 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;
}
}

View File

@ -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<String> subject;
public List<String> getSubject() {

View File

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