diff --git a/CHANGES.md b/CHANGES.md index f6e6283..695c624 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,8 @@ | **Version** | **Changes** | **Readiness** | |-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| -| 6.1.3 | [Graph model]
| beta | +| 7.0.0 | [Graph model]
| beta | +| 6.1.3 | [Graph model]
| production | | 6.1.1 | [Graph model]
| production | | 6.1.0 | [Graph model]
| production | | 5.17.3 | [Graph model]
| production | diff --git a/src/main/java/eu/dnetlib/dhp/schema/action/AtomicAction.java b/src/main/java/eu/dnetlib/dhp/schema/action/AtomicAction.java index 84b22c8..5e98976 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/action/AtomicAction.java +++ b/src/main/java/eu/dnetlib/dhp/schema/action/AtomicAction.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import eu.dnetlib.dhp.schema.oaf.Oaf; @JsonDeserialize(using = AtomicActionDeserializer.class) -public class AtomicAction implements Serializable { +public class AtomicAction implements Serializable { private Class clazz; diff --git a/src/main/java/eu/dnetlib/dhp/schema/action/AtomicActionDeserializer.java b/src/main/java/eu/dnetlib/dhp/schema/action/AtomicActionDeserializer.java index 628d8fe..ab04e92 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/action/AtomicActionDeserializer.java +++ b/src/main/java/eu/dnetlib/dhp/schema/action/AtomicActionDeserializer.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import eu.dnetlib.dhp.schema.oaf.Oaf; -public class AtomicActionDeserializer extends JsonDeserializer> { +public class AtomicActionDeserializer extends JsonDeserializer> { @Override @SuppressWarnings("unchecked") diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/EntityType.java b/src/main/java/eu/dnetlib/dhp/schema/common/EntityType.java index 54f30cf..a7628a5 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/EntityType.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/EntityType.java @@ -1,11 +1,9 @@ package eu.dnetlib.dhp.schema.common; -import eu.dnetlib.dhp.schema.oaf.OafEntity; - /** Actual entity types in the Graph */ public enum EntityType { - publication, dataset, otherresearchproduct, software, datasource, organization, project; + publication, dataset, otherresearchproduct, software, datasource, organization, project, person; /** * Resolves the EntityType, given the relative class name @@ -14,7 +12,7 @@ public enum EntityType { * @param actual OafEntity subclass * @return the EntityType associated to the given class */ - public static EntityType fromClass(Class clazz) { + public static EntityType fromClass(Class clazz) { return EntityType.valueOf(clazz.getSimpleName().toLowerCase()); } diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/MainEntityType.java b/src/main/java/eu/dnetlib/dhp/schema/common/MainEntityType.java index cda8ba4..36f355c 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/MainEntityType.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/MainEntityType.java @@ -3,5 +3,5 @@ package eu.dnetlib.dhp.schema.common; /** Main entity types in the Graph */ public enum MainEntityType { - result, datasource, organization, project + result, datasource, organization, project, person } diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/ModelConstants.java b/src/main/java/eu/dnetlib/dhp/schema/common/ModelConstants.java index 5373015..ff7c7c7 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/ModelConstants.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/ModelConstants.java @@ -190,6 +190,23 @@ public class ModelConstants { public static final String UNKNOWN = "UNKNOWN"; public static final String NOT_AVAILABLE = "not available"; + public static final String RESULT_PERSON_RELTYPE = "resultPerson"; // relType + public static final String RESULT_PERSON_SUBRELTYPE = "authorship"; // subreltype + public static final String RESULT_PERSON_HASAUTHORED = "hasAuthored"; // relclass + + public static final String PERSON_PERSON_RELTYPE = "personPerson"; // relType + public static final String PERSON_PERSON_SUBRELTYPE = "coAuthorship"; // subreltype + public static final String PERSON_PERSON_HASCOAUTHORED = "hasCoAuthor"; // relclass + + public static final String PROJECT_PERSON_RELTYPE = "projectPerson"; // relType + public static final String PROJECT_PERSON_SUBRELTYPE = "participation"; // subreltype + public static final String PROJECT_PERSON_PARTICIPATES = "participatesToProject"; // relclass + + // author affiliations are intended to be characterised by a start and an end date + public static final String ORG_PERSON_RELTYPE = "organizationPerson"; // relType + public static final String ORG_PERSON_SUBRELTYPE = "affiliation"; // subreltype + public static final String ORG_PERSON_PARTICIPATES = "isAffiliatedWith"; // relclass + public static final Qualifier PUBLICATION_DEFAULT_RESULTTYPE = qualifier( PUBLICATION_RESULTTYPE_CLASSID, PUBLICATION_RESULTTYPE_CLASSID, DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES); diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java index c7a24b6..e00ef19 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java @@ -36,6 +36,7 @@ public class ModelSupport { entityMapping.put(EntityType.datasource, MainEntityType.datasource); entityMapping.put(EntityType.organization, MainEntityType.organization); entityMapping.put(EntityType.project, MainEntityType.project); + entityMapping.put(EntityType.person, MainEntityType.person); } /** @@ -51,6 +52,7 @@ public class ModelSupport { entityTypes.put(EntityType.otherresearchproduct, OtherResearchProduct.class); entityTypes.put(EntityType.software, Software.class); entityTypes.put(EntityType.publication, Publication.class); + entityTypes.put(EntityType.person, Person.class); } public static final Map oafTypes = Maps.newHashMap(); @@ -64,6 +66,7 @@ public class ModelSupport { oafTypes.put("software", Software.class); oafTypes.put("publication", Publication.class); oafTypes.put("relation", Relation.class); + oafTypes.put("person", Person.class); } public static final Map idPrefixMap = Maps.newHashMap(); @@ -76,6 +79,7 @@ public class ModelSupport { idPrefixMap.put(OtherResearchProduct.class, "50"); idPrefixMap.put(Software.class, "50"); idPrefixMap.put(Publication.class, "50"); + idPrefixMap.put(Person.class, "30"); } public static final Map entityIdPrefix = Maps.newHashMap(); @@ -85,6 +89,7 @@ public class ModelSupport { entityIdPrefix.put("organization", "20"); entityIdPrefix.put("project", "40"); entityIdPrefix.put("result", "50"); + entityIdPrefix.put("person", "30"); } public static final Map idPrefixEntity = Maps.newHashMap(); @@ -92,6 +97,7 @@ public class ModelSupport { static { idPrefixEntity.put("10", "datasource"); idPrefixEntity.put("20", "organization"); + idPrefixEntity.put("30", "person"); idPrefixEntity.put("40", "project"); idPrefixEntity.put("50", "result"); } @@ -206,7 +212,7 @@ public class ModelSupport { private ModelSupport() { } - public static String getIdPrefix(Class clazz) { + public static String getIdPrefix(Class clazz) { return idPrefixMap.get(clazz); } diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/Person.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/Person.java new file mode 100644 index 0000000..1538f04 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/Person.java @@ -0,0 +1,149 @@ +package eu.dnetlib.dhp.schema.oaf; + +import java.io.Serializable; +import java.util.List; + +public class Person implements Serializable { + + private static final long serialVersionUID = -2366333710489222265L; + + private String id; + + private List originalId; + + private String givenName; + + private String familyName; + + private List alternativeNames; + + private String biography; + + private List subject; + + private List collectedfrom; + + private List pid; + + private String dateofcollection; + + /** + * The Measures. + */ + private List indicator; + + /** + * The Context. + */ + private List context; + + private Boolean consent; + + public Person() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public List getOriginalId() { + return originalId; + } + + public void setOriginalId(List originalId) { + this.originalId = originalId; + } + + public String getGivenName() { + return givenName; + } + + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + public String getFamilyName() { + return familyName; + } + + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + public List getAlternativeNames() { + return alternativeNames; + } + + public void setAlternativeNames(List alternativeNames) { + this.alternativeNames = alternativeNames; + } + + public String getBiography() { + return biography; + } + + public void setBiography(String biography) { + this.biography = biography; + } + + public List getSubject() { + return subject; + } + + public void setSubject(List subject) { + this.subject = subject; + } + + public List getCollectedfrom() { + return collectedfrom; + } + + public void setCollectedfrom(List collectedfrom) { + this.collectedfrom = collectedfrom; + } + + + public List getPid() { + return pid; + } + + public void setPid(List pid) { + this.pid = pid; + } + + public String getDateofcollection() { + return dateofcollection; + } + + public void setDateofcollection(String dateofcollection) { + this.dateofcollection = dateofcollection; + } + + public List getIndicator() { + return indicator; + } + + public void setIndicator(List indicator) { + this.indicator = indicator; + } + + public List getContext() { + return context; + } + + public void setContext(List context) { + this.context = context; + } + + public Boolean getConsent() { + return consent; + } + + public void setConsent(Boolean consent) { + this.consent = consent; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/PersonTopic.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/PersonTopic.java new file mode 100644 index 0000000..ac9dbac --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/PersonTopic.java @@ -0,0 +1,52 @@ +package eu.dnetlib.dhp.schema.oaf; + +import java.io.Serializable; +import java.time.Year; + +public class PersonTopic implements Serializable { + + private static final long serialVersionUID = 102011326860637199L; + + private String value; + + private String schema; + + private Year fromYear; + + private Year toYear; + + public PersonTopic() { + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public Year getFromYear() { + return fromYear; + } + + public void setFromYear(Year fromYear) { + this.fromYear = fromYear; + } + + public Year getToYear() { + return toYear; + } + + public void setToYear(Year toYear) { + this.toYear = toYear; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/oaf/Pid.java b/src/main/java/eu/dnetlib/dhp/schema/oaf/Pid.java new file mode 100644 index 0000000..d2ef428 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/oaf/Pid.java @@ -0,0 +1,31 @@ +package eu.dnetlib.dhp.schema.oaf; + +import java.io.Serializable; + +public class Pid implements Serializable { + private String schema; + private String value; + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static Pid newInstance(String schema, String value){ + Pid pid = new Pid(); + pid.schema = schema; + pid.value = value; + return pid; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/solr/Person.java b/src/main/java/eu/dnetlib/dhp/schema/solr/Person.java new file mode 100644 index 0000000..e4d1c57 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/solr/Person.java @@ -0,0 +1,113 @@ +package eu.dnetlib.dhp.schema.solr; + +import java.io.Serializable; +import java.util.List; + +public class Person implements Serializable { + + private static final long serialVersionUID = 3923041787040187202L; + + private String givenName; + + private String familyName; + + private List alternativeNames; + + private String biography; + + private List subject; + + /** + * The Measures. + */ + private List indicator; + + /** + * The Context. + */ + private List context; + + private Boolean consent; + + public static Person newInstance(String givenName, String familyName, List alternativeNames, String biography, List subject, List indicator, List context, Boolean consent) { + final Person p = new Person(); + + p.setGivenName(givenName); + p.setFamilyName(familyName); + p.setAlternativeNames(alternativeNames); + p.setBiography(biography); + p.setSubject(subject); + p.setIndicator(indicator); + p.setContext(context); + p.setConsent(consent); + + return p; + } + + public Person() { + } + + public String getGivenName() { + return givenName; + } + + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + public String getFamilyName() { + return familyName; + } + + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + public List getAlternativeNames() { + return alternativeNames; + } + + public void setAlternativeNames(List alternativeNames) { + this.alternativeNames = alternativeNames; + } + + public String getBiography() { + return biography; + } + + public void setBiography(String biography) { + this.biography = biography; + } + + public List getSubject() { + return subject; + } + + public void setSubject(List subject) { + this.subject = subject; + } + + public List getIndicator() { + return indicator; + } + + public void setIndicator(List indicator) { + this.indicator = indicator; + } + + public List getContext() { + return context; + } + + public void setContext(List context) { + this.context = context; + } + + public Boolean getConsent() { + return consent; + } + + public void setConsent(Boolean consent) { + this.consent = consent; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/solr/PersonTopic.java b/src/main/java/eu/dnetlib/dhp/schema/solr/PersonTopic.java new file mode 100644 index 0000000..2115e34 --- /dev/null +++ b/src/main/java/eu/dnetlib/dhp/schema/solr/PersonTopic.java @@ -0,0 +1,61 @@ +package eu.dnetlib.dhp.schema.solr; + +import java.io.Serializable; +import java.time.Year; + +public class PersonTopic implements Serializable { + + private static final long serialVersionUID = 6866697695308782412L; + + private String value; + + private String schema; + + private Year fromYear; + + private Year toYear; + + public static PersonTopic newInstance(String value, String schema, Year fromYear, Year toYear) { + final PersonTopic personTopic = new PersonTopic(); + personTopic.setValue(value); + personTopic.setSchema(schema); + personTopic.setFromYear(fromYear); + personTopic.setToYear(toYear); + return personTopic; + } + + public PersonTopic() { + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public Year getFromYear() { + return fromYear; + } + + public void setFromYear(Year fromYear) { + this.fromYear = fromYear; + } + + public Year getToYear() { + return toYear; + } + + public void setToYear(Year toYear) { + this.toYear = toYear; + } +} diff --git a/src/main/java/eu/dnetlib/dhp/schema/solr/RecordType.java b/src/main/java/eu/dnetlib/dhp/schema/solr/RecordType.java index 1f4b13e..39900b3 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/solr/RecordType.java +++ b/src/main/java/eu/dnetlib/dhp/schema/solr/RecordType.java @@ -9,6 +9,7 @@ public enum RecordType implements Serializable { software, datasource, organization, - project; + project, + person; } diff --git a/src/main/java/eu/dnetlib/dhp/schema/solr/SolrRecord.java b/src/main/java/eu/dnetlib/dhp/schema/solr/SolrRecord.java index df1c295..52351cf 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/solr/SolrRecord.java +++ b/src/main/java/eu/dnetlib/dhp/schema/solr/SolrRecord.java @@ -28,6 +28,8 @@ public class SolrRecord implements Serializable { private Organization organization; + private Person person; + private List links; public SolrRecordHeader getHeader() { @@ -102,6 +104,14 @@ public class SolrRecord implements Serializable { this.organization = organization; } + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + public List getLinks() { return links; }