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

This commit is contained in:
Miriam Baglioni 2021-11-18 11:01:44 +01:00
parent 9e8abe59f8
commit fd0f1d5068
29 changed files with 54 additions and 69 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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:

View File

@ -1,6 +1,5 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
/**

View File

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

View File

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

View File

@ -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.*;