From 61400f22c2046b9f470f00fee2fac9c5177fb3e1 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 18 Nov 2021 11:49:16 +0100 Subject: [PATCH] [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; + } +}