Merge branch 'master' into datasource_model_eosc

This commit is contained in:
Claudio Atzori 2022-04-22 09:34:16 +02:00
commit 0d7a3ea4b9
99 changed files with 6293 additions and 569 deletions

View File

@ -2,18 +2,34 @@
## Changelog
| **Version** | **Changes** | **Readiness** |
|---|---|---|
| 2.7.17 | [Dump model]<br>aligned the graph dump schema to mirror the changes in the model<br>1. Added openaccessroute at the level of the instance inside the AccessRight element;<br>2. Added pid and the alternate identifiers at the level of the instance;<br>3. Added the bipFinder measures | beta |
| 2.7.16 | [Graph model]<br>Updated the casing of the following terms (`relation.relClass`):<br>1. `isRelatedTo -> IsRelatedTo`<br>Added the following `relClass` terms:<br>1. `IsAmongTopNSimilarDocuments`<br>2. `HasAmongTopNSimilarDocuments` | beta |
| 2.7.15 | 1. added support for delegated authorities<br>2. fixed regex for DOI cleaning | beta |
| 2.7.14 | [Graph model]<br>Relation types are now inspired by the Datacite definitions https://schema.datacite.org/meta/kernel-4.4/doc/DataCite-MetadataKernel_v4.4.pdf <br>The changes involve the values stored in `relation.subRelType` and `relation.relClass`:<br>Updated the casing of the following terms (`relation.relClass`):<br>1. `isSupplementTo -> IsSupplementTo` / `isSupplementedBy -> IsSupplementedBy`<br>2. `isPartOf -> IsPartOf` / `hasPart -> HasPart`<br>3. `cites -> Cites` / `isCitedBy -> IsCitedBy`<br>4. `reviews -> Reviews` / `isReviewedBy -> IsReviewedBy`<br>Added the following terms [`subRelType: relClass / relClass (inverse)`]:<br>1. `relationship: References / IsReferencedBy`<br>2. `relationship: IsIdenticalTo`<br>3. `relationship: IsContinuedBy / Continues`<br>4. `relationship: IsDocumentedBy / Documents`<br>5. `relationship: Documents / IsDocumentedBy`<br>6. `relationship: IsCompiledBy / Compiles`<br>7. `version: IsPreviousVersionOf / IsNewVersionOf`<br>8. `version: IsSourceOf / IsDerivedFrom`<br>9. `version: IsVariantFormOf / IsOriginalFormOf`<br>10. `version: IsObsoletedBy / Obsoletes`<br>11. `version: IsVersionOf / HasVersion` | beta |
| 2.6.14 | [Scholexplorer]<br>1. Added model classes for Scholexplorer, package `eu.dnetlib.dhp.schema.sx` | production |
| 2.6.13 | 1. `Result.mergeFrom` handles field `dateOfAcceptance` | production |
| 2.5.12 | 1. delegating the date parsing to https://github.com/sisyphsu/dateparser | production |
| 2.5.[11-9] | 1. support for more date formats<br>2. enable the possibility to extend the date formats used to parse `Relation.validationDate` | production |
| 2.4.8 | 1. added constant for ORCID datasource name | production |
| 2.4.7 | refactoring | production |
| 2.3.6 | [Aggregation]<br>1. introduced MetadataStoreManager (MdSM) model classes| production |
| 2.2.5 | [Graph model]<br>1. introduced fields `Instance.pid` and `Instance.alternateIdentifier`<br>2. `LicenseComparator` renamed as `AccessRightComparator`<br>3. introduced `AccessRight` model class defining the `OpenAccessRoute` field to keep track of the OpenAccess color at the `Instance` level<br>4. `ExternalReference` cleanup (removed description, added alternateLabel(s))<br>5. added several ModelConstants<br>[Aggregation]<br>7. introduced MDStore record model classes<br>8. Introduced ORCID specific model classes | production |
| 2.2.4 | 1. ORCID specific model classes backported in the version used in PROD<br>2. added constant for dnet:externalReference_typologies<br>3. added constant for ORCID datasource name<br>4. `Result.mergeFrom` handles field `dateOfAcceptance` | production |
| **Version** | **Changes** | **Readiness** |
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| 2.11.33 | [Scholexplorer] </br> <ul><li>Moved Scholix API Data model into dhp-schemas</li><li>implementation of the compareTo method on Scholix objects and all model properties</li> <li>Unit Test to verify that compareTo works on different case</li> <ul> | beta |
| 2.10.31 | [Minor] </br>NPE checks | beta |
| 2.10.30 | [Minor] </br>added comparator for refereed field instances | beta |
| 2.10.29 | [Merge Result] </br>merge logics changed to consider invisble in dataInfo | beta |
| 2.10.28 | [Graph Model] </br> Added APC information at the level of the result | beta |
| 2.10.27 | [Graph Model] </br> change name and id of OpenAPC datasource | beta |
| 2.10.26 | [Graph Model] </br> OpenAIRE ids of the delegated authorities and enrichment providers in the identifier creation strategy | beta |
| 2.10.25 | [Graph model]</br>implemented enrichment on Result specializing in the method mergefrom. | beta |
| 2.10.24 | [Graph model]</br>added utility method and constants for checking weather is an OafEntity represents an enrichment. | beta |
| 2.9.24 | [Dump model]</br>change the names of the classes to be able to automatically create the json schema with specific descriptions | beta |
| 2.9.23 | [Graph model]<br>Added Instance.measures field, allowing to maintain the association between them and the individual result instance</br>[Dump model]</br>added json schemas | beta |
| 2.8.22 | [Graph model]<br>minor: added serializable to the Measures model class</br>[Dump model]</br>added dedicated BestAccessRight class, used at the result level instead of AccessRight | production |
| 2.8.21 | [Graph model]<br>added the following relation terms Describes/IsDescribedBy, IsMetadataFor/IsMetadataOf, HasAssociationWith/HasAssociationWith, IsRequiredBy/Requires. All these are used in combination with the relation subRelType "relationship" | production |
| 2.8.20 | [Graph model]<br>added constants declaring the values used for hierarchical relationships among the organizations IsParentOf / IsChildOf | production |
| 2.7.18-19 | [Dump model]<br>include validation info in relations<br>[Graph model]<br>added constants declaring vocabulary names for relation fields | production |
| 2.7.17 | [Dump model]<br>aligned the graph dump schema to mirror the changes in the model<br>1. Added openaccessroute at the level of the instance inside the AccessRight element;<br>2. Added pid and the alternate identifiers at the level of the instance;<br>3. Added the bipFinder measures | production |
| 2.7.16 | [Graph model]<br>Updated the casing of the following terms (`relation.relClass`):<br>1. `isRelatedTo -> IsRelatedTo`<br>Added the following `relClass` terms:<br>1. `IsAmongTopNSimilarDocuments`<br>2. `HasAmongTopNSimilarDocuments` | production |
| 2.7.15 | 1. added support for delegated authorities<br>2. fixed regex for DOI cleaning | production |
| 2.7.14 | [Graph model]<br>Relation types are now inspired by the Datacite definitions https://schema.datacite.org/meta/kernel-4.4/doc/DataCite-MetadataKernel_v4.4.pdf <br>The changes involve the values stored in `relation.subRelType` and `relation.relClass`:<br>Updated the casing of the following terms (`relation.relClass`):<br>1. `isSupplementTo -> IsSupplementTo` / `isSupplementedBy -> IsSupplementedBy`<br>2. `isPartOf -> IsPartOf` / `hasPart -> HasPart`<br>3. `cites -> Cites` / `isCitedBy -> IsCitedBy`<br>4. `reviews -> Reviews` / `isReviewedBy -> IsReviewedBy`<br>Added the following terms [`subRelType: relClass / relClass (inverse)`]:<br>1. `relationship: References / IsReferencedBy`<br>2. `relationship: IsIdenticalTo`<br>3. `relationship: IsContinuedBy / Continues`<br>4. `relationship: IsDocumentedBy / Documents`<br>5. `relationship: Documents / IsDocumentedBy`<br>6. `relationship: IsCompiledBy / Compiles`<br>7. `version: IsPreviousVersionOf / IsNewVersionOf`<br>8. `version: IsSourceOf / IsDerivedFrom`<br>9. `version: IsVariantFormOf / IsOriginalFormOf`<br>10. `version: IsObsoletedBy / Obsoletes`<br>11. `version: IsVersionOf / HasVersion` | production |
| 2.6.14 | [Scholexplorer]<br>1. Added model classes for Scholexplorer, package `eu.dnetlib.dhp.schema.sx` | production |
| 2.6.13 | 1. `Result.mergeFrom` handles field `dateOfAcceptance` | production |
| 2.5.12 | 1. delegating the date parsing to https://github.com/sisyphsu/dateparser | production |
| 2.5.[11-9] | 1. support for more date formats<br>2. enable the possibility to extend the date formats used to parse `Relation.validationDate` | production |
| 2.4.8 | 1. added constant for ORCID datasource name | production |
| 2.4.7 | refactoring | production |
| 2.3.6 | [Aggregation]<br>1. introduced MetadataStoreManager (MdSM) model classes | production |
| 2.2.5 | [Graph model]<br>1. introduced fields `Instance.pid` and `Instance.alternateIdentifier`<br>2. `LicenseComparator` renamed as `AccessRightComparator`<br>3. introduced `AccessRight` model class defining the `OpenAccessRoute` field to keep track of the OpenAccess color at the `Instance` level<br>4. `ExternalReference` cleanup (removed description, added alternateLabel(s))<br>5. added several ModelConstants<br>[Aggregation]<br>7. introduced MDStore record model classes<br>8. Introduced ORCID specific model classes | production |
| 2.2.4 | 1. ORCID specific model classes backported in the version used in PROD<br>2. added constant for dnet:externalReference_typologies<br>3. added constant for ORCID datasource name<br>4. `Result.mergeFrom` handles field `dateOfAcceptance` | production |

149
pom.xml
View File

@ -5,7 +5,8 @@
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-schemas</artifactId>
<packaging>jar</packaging>
<version>2.7.17-SNAPSHOT</version>
<version>2.11.34-SNAPSHOT</version>
<licenses>
<license>
@ -20,7 +21,7 @@
<issueManagement>
<system>Redmine</system>
<url>https://issue.openaire.research-infrastructures.eu/projects/openaire</url>
<url>https://support.openaire.eu/projects/openaire</url>
</issueManagement>
<ciManagement>
@ -32,7 +33,7 @@
<connection>scm:git:gitea@code-repo.d4science.org:D-Net/dhp-schemas.git</connection>
<developerConnection>scm:git:gitea@code-repo.d4science.org:D-Net/dhp-schemas.git</developerConnection>
<url>https://code-repo.d4science.org/D-Net/dhp-schemas/</url>
<tag>dhp-schemas-2.6.13</tag>
<tag>dhp-schemas-2.10.30</tag>
</scm>
<description>This module contains common schema classes meant to be used across the dnet-hadoop submodules</description>
@ -137,7 +138,26 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${dhp.jackson.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
@ -229,6 +249,19 @@
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<includePluginDependencies>true</includePluginDependencies>
<mainClass>eu.dnetlib.dhp.schema.dump.ExecCreateSchemas</mainClass>
<arguments>
<argument>eu.dnetlib.dhp.schema.dump.oaf.GraphResult;eu.dnetlib.dhp.schema.dump.oaf.graph.Organization;eu.dnetlib.dhp.schema.dump.oaf.graph.Project</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
@ -249,10 +282,16 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>me.xuender</groupId>
<artifactId>unidecode</artifactId>
<version>${dhp.unidecode.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.25</version>
<version>${dhp.slf4j.version}</version>
<scope>provided</scope>
</dependency>
@ -265,7 +304,7 @@
<dependency>
<groupId>com.github.sisyphsu</groupId>
<artifactId>dateparser</artifactId>
<version>1.0.7</version>
<version>${dhp.dateparser.version}</version>
</dependency>
<dependency>
@ -277,15 +316,16 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
<version>${dhp.commons.codec.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<version>${dhp.commons.io.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
@ -296,34 +336,95 @@
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
<version>${dhp.javax.persistence.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${dhp.swagger-annotations-version}</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${dhp.swagger.annotations.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${dhp.validation.api.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator</artifactId>
<version>${jsonschemagenerator.version}</version>
</dependency>
<dependency>
<groupId>com.github.imifou</groupId>
<artifactId>jsonschema-module-addon</artifactId>
<version>${dhp.jsonschema.module.addon.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>me.xuender</groupId>
<artifactId>unidecode</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -360,10 +461,27 @@
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator</artifactId>
</dependency>
<dependency>
<groupId>com.github.imifou</groupId>
<artifactId>jsonschema-module-addon</artifactId>
</dependency>
</dependencies>
<properties>
<dhp.dateparser.version>1.0.7</dhp.dateparser.version>
<dhp.jsonschema.module.addon.version>1.2.1</dhp.jsonschema.module.addon.version>
<dhp.validation.api.version>2.0.1.Final</dhp.validation.api.version>
<dhp.swagger.annotations.version>2.1.12</dhp.swagger.annotations.version>
<dhp.javax.persistence.api.version>2.2</dhp.javax.persistence.api.version>
<dhp.commons.codec.version>1.9</dhp.commons.codec.version>
<dhp.commons.io.version>2.4</dhp.commons.io.version>
<dhp.slf4j.version>1.7.25</dhp.slf4j.version>
<dhp.unidecode.version>0.0.7</dhp.unidecode.version>
<dhp.swagger-annotations-version>1.5.20</dhp.swagger-annotations-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.plugin.version>3.6.0</maven.compiler.plugin.version>
@ -377,6 +495,7 @@
<scala.version>2.11.12</scala.version>
<junit-jupiter.version>5.6.1</junit-jupiter.version>
<mockito-core.version>3.3.3</mockito-core.version>
<jsonschemagenerator.version>4.13.0</jsonschemagenerator.version>
</properties>

View File

@ -27,6 +27,12 @@ public class ModelConstants {
public static final String OPENORGS_NAME = "OpenOrgs Database";
public static final String OPENOCITATIONS_NAME = "OpenCitations";
public static final String OPENOCITATIONS_ID = "10|openaire____::c06df618c5de1c786535ccf3f8b7b059";
public static final String OPEN_APC_NAME = "OpenAPC Global Initiative";
public static final String OPEN_APC_ID = "10|apc_________::e2b1600b229fc30663c8a1f662debddf";
// VOCABULARY VALUE
public static final String ACCESS_RIGHT_OPEN = "OPEN";
public static final String ACCESS_RIGHT_EMBARGO = "EMBARGO";
@ -47,6 +53,14 @@ public class ModelConstants {
public static final String DNET_REVIEW_LEVELS = "dnet:review_levels";
public static final String DNET_PROGRAMMING_LANGUAGES = "dnet:programming_languages";
public static final String DNET_EXTERNAL_REFERENCE_TYPE = "dnet:externalReference_typologies";
public static final String DNET_RELATION_RELTYPE = "dnet:relation_relType";
public static final String DNET_RELATION_SUBRELTYPE = "dnet:relation_subRelType";
public static final String DNET_RELATION_RELCLASS = "dnet:relation_relClass";
public static final String PEER_REVIEWED_CLASSNAME = "nonPeerReviewed";
public static final String NON_PEER_REVIEWED_CLASSNAME = "nonPeerReviewed";
public static final String PEER_REVIEWED_CLASSID = "0001";
public static final String NON_PEER_REVIEWED_CLASSID = "0002";
public static final String SYSIMPORT_CROSSWALK_REPOSITORY = "sysimport:crosswalk:repository";
public static final String SYSIMPORT_CROSSWALK_ENTITYREGISTRY = "sysimport:crosswalk:entityregistry";
@ -57,6 +71,8 @@ public class ModelConstants {
public static final String HARVESTED = "Harvested";
public static final String PROVENANCE_DEDUP = "sysimport:dedup";
public static final String PROVENANCE_ENRICH = "sysimport:enrich";
public static final Qualifier PROVENANCE_ACTION_SET_QUALIFIER = qualifier(
SYSIMPORT_ACTIONSET, SYSIMPORT_ACTIONSET, DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS);
@ -96,6 +112,15 @@ public class ModelConstants {
public static final String IS_DERIVED_FROM = "IsDerivedFrom";
public static final String COMPILES = "Compiles";
public static final String IS_COMPILED_BY = "IsCompiledBy";
public static final String DESCRIBES = "Describes";
public static final String IS_DESCRIBE_DBY = "IsDescribedBy";
public static final String IS_METADATA_FOR = "IsMetadataFor";
public static final String IS_METADATA_OF = "IsMetadataOf";
public static final String HAS_ASSOCIATION_WITH = "HasAssociationWith";
public static final String IS_REQUIRED_BY = "IsRequiredBy";
public static final String REQUIRES = "Requires";
public static final String CITATION = "citation"; // subreltype
public static final String CITES = "Cites";
@ -136,6 +161,8 @@ public class ModelConstants {
public static final String HAS_AUTHOR_INSTITUTION = "hasAuthorInstitution";
public static final String ORG_ORG_RELTYPE = "organizationOrganization"; // relType
public static final String IS_PARENT_OF = "IsParentOf";
public static final String IS_CHILD_OF = "IsChildOf";
public static final String DEDUP = "dedup"; // subreltype
public static final String MERGES = "merges";

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.common;
import static com.google.common.base.Preconditions.checkArgument;
import static eu.dnetlib.dhp.schema.common.ModelConstants.*;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
@ -98,211 +99,104 @@ public class ModelSupport {
public static final Map<String, RelationInverse> relationInverseMap = Maps.newHashMap();
static {
relationInverseMap
.put(
"personResult_authorship_isAuthorOf", new RelationInverse()
.setRelation("isAuthorOf")
.setInverse("hasAuthor")
.setRelType("personResult")
.setSubReltype("authorship"));
relationInverseMap
.put(
"personResult_authorship_hasAuthor", new RelationInverse()
.setInverse("isAuthorOf")
.setRelation("hasAuthor")
.setRelType("personResult")
.setSubReltype("authorship"));
relationInverseMap
.put(
"projectOrganization_participation_isParticipant", new RelationInverse()
.setRelation(ModelConstants.IS_PARTICIPANT)
.setInverse(ModelConstants.HAS_PARTICIPANT)
.setRelType(ModelConstants.PROJECT_ORGANIZATION)
.setSubReltype(ModelConstants.PARTICIPATION));
relationInverseMap
.put(
"projectOrganization_participation_hasParticipant", new RelationInverse()
.setInverse(ModelConstants.IS_PARTICIPANT)
.setRelation(ModelConstants.HAS_PARTICIPANT)
.setRelType(ModelConstants.PROJECT_ORGANIZATION)
.setSubReltype(ModelConstants.PARTICIPATION));
relationInverseMap
.put(
"resultOrganization_affiliation_hasAuthorInstitution", new RelationInverse()
.setRelation(ModelConstants.HAS_AUTHOR_INSTITUTION)
.setInverse(ModelConstants.IS_AUTHOR_INSTITUTION_OF)
.setRelType(ModelConstants.RESULT_ORGANIZATION)
.setSubReltype(ModelConstants.AFFILIATION));
relationInverseMap
.put(
"resultOrganization_affiliation_isAuthorInstitutionOf", new RelationInverse()
.setInverse(ModelConstants.HAS_AUTHOR_INSTITUTION)
.setRelation(ModelConstants.IS_AUTHOR_INSTITUTION_OF)
.setRelType(ModelConstants.RESULT_ORGANIZATION)
.setSubReltype(ModelConstants.AFFILIATION));
relationInverseMap
.put(
"organizationOrganization_dedup_merges", new RelationInverse()
.setRelation(ModelConstants.MERGES)
.setInverse(ModelConstants.IS_MERGED_IN)
.setRelType(ModelConstants.ORG_ORG_RELTYPE)
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"organizationOrganization_dedup_isMergedIn", new RelationInverse()
.setInverse(ModelConstants.MERGES)
.setRelation(ModelConstants.IS_MERGED_IN)
.setRelType(ModelConstants.ORG_ORG_RELTYPE)
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"organizationOrganization_dedupSimilarity_isSimilarTo", new RelationInverse()
.setInverse(ModelConstants.IS_SIMILAR_TO)
.setRelation(ModelConstants.IS_SIMILAR_TO)
.setRelType(ModelConstants.ORG_ORG_RELTYPE)
.setSubReltype(ModelConstants.DEDUP));
set(relationInverseMap, PROJECT_ORGANIZATION, PARTICIPATION, IS_PARTICIPANT, HAS_PARTICIPANT);
relationInverseMap
.put(
"resultProject_outcome_isProducedBy", new RelationInverse()
.setRelation(ModelConstants.IS_PRODUCED_BY)
.setInverse(ModelConstants.PRODUCES)
.setRelType(ModelConstants.RESULT_PROJECT)
.setSubReltype(ModelConstants.OUTCOME));
relationInverseMap
.put(
"resultProject_outcome_produces", new RelationInverse()
.setInverse(ModelConstants.IS_PRODUCED_BY)
.setRelation(ModelConstants.PRODUCES)
.setRelType(ModelConstants.RESULT_PROJECT)
.setSubReltype(ModelConstants.OUTCOME));
relationInverseMap
.put(
"projectPerson_contactPerson_isContact", new RelationInverse()
.setRelation("isContact")
.setInverse("hasContact")
.setRelType("projectPerson")
.setSubReltype("contactPerson"));
relationInverseMap
.put(
"projectPerson_contactPerson_hasContact", new RelationInverse()
.setInverse("isContact")
.setRelation("hasContact")
.setRelType("personPerson")
.setSubReltype("coAuthorship"));
relationInverseMap
.put(
"personPerson_coAuthorship_isCoauthorOf", new RelationInverse()
.setInverse("isCoAuthorOf")
.setRelation("isCoAuthorOf")
.setRelType("personPerson")
.setSubReltype("coAuthorship"));
relationInverseMap
.put(
"personPerson_dedup_merges", new RelationInverse()
.setInverse(ModelConstants.IS_MERGED_IN)
.setRelation(ModelConstants.MERGES)
.setRelType("personPerson")
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"personPerson_dedup_isMergedIn", new RelationInverse()
.setInverse(ModelConstants.MERGES)
.setRelation(ModelConstants.IS_MERGED_IN)
.setRelType("personPerson")
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"personPerson_dedupSimilarity_isSimilarTo", new RelationInverse()
.setInverse(ModelConstants.IS_SIMILAR_TO)
.setRelation(ModelConstants.IS_SIMILAR_TO)
.setRelType("personPerson")
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"datasourceOrganization_provision_isProvidedBy", new RelationInverse()
.setInverse(ModelConstants.PROVIDES)
.setRelation(ModelConstants.IS_PROVIDED_BY)
.setRelType(ModelConstants.DATASOURCE_ORGANIZATION)
.setSubReltype(ModelConstants.PROVISION));
relationInverseMap
.put(
"datasourceOrganization_provision_provides", new RelationInverse()
.setInverse(ModelConstants.IS_PROVIDED_BY)
.setRelation(ModelConstants.PROVIDES)
.setRelType(ModelConstants.DATASOURCE_ORGANIZATION)
.setSubReltype(ModelConstants.PROVISION));
relationInverseMap
.put(
"resultResult_similarity_hasAmongTopNSimilarDocuments", new RelationInverse()
.setInverse("isAmongTopNSimilarDocuments")
.setRelation("hasAmongTopNSimilarDocuments")
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.SIMILARITY));
relationInverseMap
.put(
"resultResult_similarity_isAmongTopNSimilarDocuments", new RelationInverse()
.setInverse("hasAmongTopNSimilarDocuments")
.setRelation("isAmongTopNSimilarDocuments")
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.SIMILARITY));
relationInverseMap
.put(
"resultResult_relationship_isRelatedTo", new RelationInverse()
.setInverse(ModelConstants.IS_RELATED_TO)
.setRelation(ModelConstants.IS_RELATED_TO)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.RELATIONSHIP));
relationInverseMap
.put(
"resultResult_supplement_isSupplementTo", new RelationInverse()
.setInverse(ModelConstants.IS_SUPPLEMENTED_BY)
.setRelation(ModelConstants.IS_SUPPLEMENT_TO)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.SUPPLEMENT));
relationInverseMap
.put(
"resultResult_supplement_isSupplementedBy", new RelationInverse()
.setInverse(ModelConstants.IS_SUPPLEMENT_TO)
.setRelation(ModelConstants.IS_SUPPLEMENTED_BY)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.SUPPLEMENT));
relationInverseMap
.put(
"resultResult_part_isPartOf", new RelationInverse()
.setInverse(ModelConstants.HAS_PART)
.setRelation(ModelConstants.IS_PART_OF)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.PART));
relationInverseMap
.put(
"resultResult_part_hasPart", new RelationInverse()
.setInverse(ModelConstants.IS_PART_OF)
.setRelation(ModelConstants.HAS_PART)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.PART));
relationInverseMap
.put(
"resultResult_dedup_merges", new RelationInverse()
.setInverse(ModelConstants.IS_MERGED_IN)
.setRelation(ModelConstants.MERGES)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"resultResult_dedup_isMergedIn", new RelationInverse()
.setInverse(ModelConstants.MERGES)
.setRelation(ModelConstants.IS_MERGED_IN)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.DEDUP));
relationInverseMap
.put(
"resultResult_dedupSimilarity_isSimilarTo", new RelationInverse()
.setInverse(ModelConstants.IS_SIMILAR_TO)
.setRelation(ModelConstants.IS_SIMILAR_TO)
.setRelType(ModelConstants.RESULT_RESULT)
.setSubReltype(ModelConstants.DEDUP));
set(relationInverseMap, RESULT_ORGANIZATION, AFFILIATION, IS_AUTHOR_INSTITUTION_OF, HAS_AUTHOR_INSTITUTION);
set(relationInverseMap, ORG_ORG_RELTYPE, DEDUP, IS_MERGED_IN, MERGES);
set(relationInverseMap, ORG_ORG_RELTYPE, DEDUP, IS_SIMILAR_TO, IS_SIMILAR_TO);
set(relationInverseMap, RESULT_PROJECT, OUTCOME, IS_PRODUCED_BY, PRODUCES);
set(relationInverseMap, DATASOURCE_ORGANIZATION, PROVISION, IS_PROVIDED_BY, PROVIDES);
set(relationInverseMap, RESULT_RESULT, SIMILARITY, IS_AMONG_TOP_N_SIMILAR_DOCS, HAS_AMONG_TOP_N_SIMILAR_DOCS);
set(relationInverseMap, RESULT_RESULT, SUPPLEMENT, IS_SUPPLEMENT_TO, IS_SUPPLEMENTED_BY);
set(relationInverseMap, RESULT_RESULT, PART, IS_PART_OF, HAS_PART);
set(relationInverseMap, RESULT_RESULT, DEDUP, IS_MERGED_IN, MERGES);
set(relationInverseMap, RESULT_RESULT, DEDUP, IS_SIMILAR_TO, IS_SIMILAR_TO);
set(relationInverseMap, RESULT_RESULT, CITATION, IS_CITED_BY, CITES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_IDENTICAL_TO, IS_IDENTICAL_TO);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_REFERENCED_BY, REFERENCES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_CONTINUED_BY, CONTINUES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_DOCUMENTED_BY, DOCUMENTS);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_DERIVED_FROM, IS_SOURCE_OF);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_RELATED_TO, IS_RELATED_TO);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_COMPILED_BY, COMPILES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_DESCRIBE_DBY, DESCRIBES);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_METADATA_FOR, IS_METADATA_OF);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, HAS_ASSOCIATION_WITH, HAS_ASSOCIATION_WITH);
set(relationInverseMap, RESULT_RESULT, RELATIONSHIP, IS_REQUIRED_BY, REQUIRES);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_PREVIOUS_VERSION_OF, IS_NEW_VERSION_OF);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_VARIANT_FORM_OF, IS_ORIGINAL_FORM_OF);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_OBSOLETED_BY, OBSOLETES);
set(relationInverseMap, RESULT_RESULT, VERSION, IS_VERSION_OF, HAS_VERSION);
set(relationInverseMap, RESULT_RESULT, REVIEW, IS_REVIEWED_BY, REVIEWS);
}
private static void set(Map<String, RelationInverse> relationInverseMap, String relType, String subRelType, String relClass, String inverseRelClass) {
relationInverseMap
.put(
rel(relType, subRelType, relClass), new RelationInverse()
.setInverseRelClass(inverseRelClass)
.setRelClass(relClass)
.setRelType(relType)
.setSubReltype(subRelType));
if (!relClass.equals(inverseRelClass)) {
relationInverseMap
.put(
rel(relType, subRelType, inverseRelClass), new RelationInverse()
.setInverseRelClass(relClass)
.setRelClass(inverseRelClass)
.setRelType(relType)
.setSubReltype(subRelType));
}
}
/**
* Helper method: lookup relation inverse, given the direct relation encoding (case insensitive)
* @param encoding
* @return the relation inverse descriptor, throws @IllegalArgumentException when not found.
*/
public static RelationInverse findInverse(String encoding) {
return ModelSupport.relationInverseMap
.entrySet()
.stream()
.filter(r -> encoding.equalsIgnoreCase(r.getKey()))
.findFirst()
.map(r -> r.getValue())
.orElseThrow(() -> new IllegalArgumentException("invalid relationship: " + encoding));
}
/**
* Helper method: fina a relation filtering by a relation name
* @param relationName
* @return
*/
public static RelationInverse findRelation(final String relationName) {
return relationInverseMap.values()
.stream()
.filter(r -> relationName.equalsIgnoreCase(r.getRelClass()))
.findFirst()
.orElse(null);
}
/**
* Helper method: combines the relation attributes
* @param relType
* @param subRelType
* @param relClass
* @return
*/
public static String rel(String relType, String subRelType, String relClass) {
return String.format("%s_%s_%s", relType, subRelType, relClass);
}
private static final String schemeTemplate = "dnet:%s_%s_relations";

View File

@ -0,0 +1,44 @@
package eu.dnetlib.dhp.schema.common;
import java.util.Comparator;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
public class RefereedComparator implements Comparator<Qualifier> {
@Override
public int compare(Qualifier left, Qualifier right) {
if (left == null && right == null)
return 0;
if (left == null)
return 1;
if (right == null)
return -1;
String lClass = left.getClassid();
String rClass = right.getClassid();
if (lClass.equals(rClass))
return 0;
if (lClass.equals(ModelConstants.PEER_REVIEWED_CLASSID))
return -1;
if (rClass.equals(ModelConstants.PEER_REVIEWED_CLASSID))
return 1;
if (lClass.equals(ModelConstants.NON_PEER_REVIEWED_CLASSID))
return -1;
if (rClass.equals(ModelConstants.NON_PEER_REVIEWED_CLASSID))
return 1;
if (lClass.equals(ModelConstants.UNKNOWN))
return -1;
if (rClass.equals(ModelConstants.UNKNOWN))
return 1;
// Else (but unlikely), lexicographical ordering will do.
return lClass.compareTo(rClass);
}
}

View File

@ -2,8 +2,8 @@
package eu.dnetlib.dhp.schema.common;
public class RelationInverse {
private String relation;
private String inverse;
private String relClass;
private String inverseRelClass;
private String relType;
private String subReltype;
@ -25,21 +25,21 @@ public class RelationInverse {
return this;
}
public String getRelation() {
return relation;
public String getRelClass() {
return relClass;
}
public RelationInverse setRelation(String relation) {
this.relation = relation;
public RelationInverse setRelClass(String relClass) {
this.relClass = relClass;
return this;
}
public String getInverse() {
return inverse;
public String getInverseRelClass() {
return inverseRelClass;
}
public RelationInverse setInverse(String inverse) {
this.inverse = inverse;
public RelationInverse setInverseRelClass(String inverseRelClass) {
this.inverseRelClass = inverseRelClass;
return this;
}

View File

@ -0,0 +1,75 @@
package eu.dnetlib.dhp.schema.dump;
import java.io.*;
import java.lang.reflect.Type;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.github.imifou.jsonschema.module.addon.AddonModule;
import com.github.victools.jsonschema.generator.*;
import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityResult;
import eu.dnetlib.dhp.schema.dump.oaf.graph.*;
public class ExecCreateSchemas {
final static String DIRECTORY = "/eu/dnetlib/dhp/schema/oaf/dump/jsonschemas/";
SchemaGenerator generator;
private void init(){
AddonModule module = new AddonModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(
new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT),
SchemaVersion.DRAFT_7,
OptionPreset.PLAIN_JSON)
.with(module)
.with(Option.SCHEMA_VERSION_INDICATOR)
.without(Option.NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS);
SchemaGeneratorConfig config = configBuilder.build();
generator = new SchemaGenerator(config);
}
private void generate(Type targetType, String directory, String filename) throws IOException {
JsonNode jsonSchema = generator.generateSchema(targetType);
String dir = Paths.get(Paths.get(getClass().getResource("/").getPath()).toAbsolutePath() + directory).toString();
if(!Files.exists(Paths.get(dir))){
Files.createDirectories(Paths.get(dir));
}
if(!Files.exists(Paths.get(dir + "/" + filename))) {
Files.createFile(Paths.get(dir + "/" + filename));
}
File f = new File(dir + "/" + filename);
try(PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(f)))) {
writer.println(new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema));
}
}
public static void main(String[] args) throws IOException {
ExecCreateSchemas ecs = new ExecCreateSchemas();
ecs.init();
ecs.generate(GraphResult.class, DIRECTORY , "result_schema.json");
ecs.generate(ResearchCommunity.class, DIRECTORY , "community_infrastructure_schema.json");
ecs.generate(Datasource.class, DIRECTORY , "datasource_schema.json");
ecs.generate(Project.class, DIRECTORY , "project_schema.json");
ecs.generate(Relation.class, DIRECTORY , "relation_schema.json");
ecs.generate(Organization.class, DIRECTORY , "organization_schema.json");
ecs.generate(CommunityResult.class, DIRECTORY , "community_result_schema.json");
}
}

View File

@ -2,26 +2,15 @@
package eu.dnetlib.dhp.schema.dump.oaf;
/**
* AccessRight. Used to represent the result access rights. It extends the eu.dnet.lib.dhp.schema.dump.oaf.Qualifier
* element with a parameter scheme of type String to store the scheme. 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
* the COAR corresponding code whose value will be used to set the code parameter. The COAR label corresponding to the
* COAR code will be used to set the label parameter. The scheme value will always be the one referring to the COAR
* access right scheme
* AccessRight. Used to represent the result access rights. It extends the eu.dnet.lib.dhp.schema.dump.oaf.BestAccessRight
* element with value for the openaccess route
*/
public class AccessRight extends Qualifier {
public class AccessRight extends BestAccessRight {
private String scheme;
private OpenAccessRoute openAccessRoute ;
public String getScheme() {
return scheme;
}
public void setScheme(String scheme) {
this.scheme = scheme;
}
public static AccessRight newInstance(String code, String label, String scheme) {
AccessRight ar = new AccessRight();

View File

@ -0,0 +1,40 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
public class AlternateIdentifier implements Serializable {
@JsonSchema(description="The scheme of the identifier. It can be a persistent identifier (i.e. doi). If it is present in the alternate identifiers " +
"it means it has not been forged by an authority for that pid. For example we collect metadata from an institutional repository that provides " +
"as identifier for the result also the doi")
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 AlternateIdentifier newInstance(String scheme, String value) {
AlternateIdentifier cf = new AlternateIdentifier();
cf.setScheme(scheme);
cf.setValue(value);
return cf;
}
}

View File

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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
@ -27,7 +29,8 @@ public class Author implements Serializable {
private Integer rank;
private Pid pid;
@JsonSchema(description="The author's persistent identifiers")
private AuthorPid pid;
public String getFullname() {
return fullname;
@ -61,11 +64,11 @@ public class Author implements Serializable {
this.rank = rank;
}
public Pid getPid() {
public AuthorPid getPid() {
return pid;
}
public void setPid(Pid pid) {
public void setPid(AuthorPid pid) {
this.pid = pid;
}

View File

@ -0,0 +1,54 @@
package eu.dnetlib.dhp.schema.dump.oaf;
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
* eu.dnetlib.dhp.schema.dump.oaf.AuthorPidSchemeValue to store the scheme and value of the Persistent Identifier.
* - provenance of type eu.dnetlib.dhp.schema.dump.oaf.Provenance to store the provenance and trust of the information
*/
public class AuthorPid implements Serializable {
private AuthorPidSchemeValue id;
@JsonSchema(description="The reason why the pid was associated to the author")
private Provenance provenance;
public AuthorPidSchemeValue getId() {
return id;
}
public void setId(AuthorPidSchemeValue pid) {
this.id = pid;
}
public Provenance getProvenance() {
return provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
public static AuthorPid newInstance(AuthorPidSchemeValue pid, Provenance provenance) {
AuthorPid p = new AuthorPid();
p.id = pid;
p.provenance = provenance;
return p;
}
public static AuthorPid newInstance(AuthorPidSchemeValue pid) {
AuthorPid p = new AuthorPid();
p.id = pid;
return p;
}
}

View File

@ -0,0 +1,39 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
public class AuthorPidSchemeValue implements Serializable {
@JsonSchema(description="The author's pid scheme. OpenAIRE currently supports 'ORCID'")
private String scheme;
@JsonSchema(description="The author's pid value in that scheme (i.e. 0000-1111-2222-3333)")
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 AuthorPidSchemeValue newInstance(String scheme, String value) {
AuthorPidSchemeValue cf = new AuthorPidSchemeValue();
cf.setScheme(scheme);
cf.setValue(value);
return cf;
}
}

View File

@ -0,0 +1,59 @@
package eu.dnetlib.dhp.schema.dump.oaf;
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
* the COAR corresponding code whose value will be used to set the code parameter. The COAR label corresponding to the
* COAR code will be used to set the label parameter. The scheme value will always be the one referring to the COAR
* access right scheme
*/
public class BestAccessRight implements Serializable {
@JsonSchema(description="COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/")
private String code; // the classid in the Qualifier
@JsonSchema(description="Label for the access mode")
private String label; // the classname in the Qualifier
@JsonSchema(description="Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/")
private String scheme;
public String getScheme() {
return scheme;
}
public void setScheme(String scheme) {
this.scheme = scheme;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public static BestAccessRight newInstance(String code, String label, String scheme) {
BestAccessRight ar = new BestAccessRight();
ar.code = code ;
ar.label = label;
ar.scheme = scheme;
return ar;
}
}

View File

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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
@ -22,6 +24,7 @@ import java.io.Serializable;
*/
public class Container implements Serializable {
@JsonSchema(description="Name of the journal or conference")
private String name;
private String issnPrinted;
@ -30,14 +33,19 @@ public class Container implements Serializable {
private String issnLinking;
@JsonSchema(description="End page")
private String ep;
@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")
private String edition;
private String conferenceplace;

View File

@ -1,38 +0,0 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
/**
* To represent the information described by a scheme and a value in that scheme (i.e. pid). It has two parameters: -
* scheme of type String to store the scheme - value of type String to store the value in that scheme
*/
public class ControlledField implements Serializable {
private String 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 ControlledField newInstance(String scheme, String value) {
ControlledField cf = new ControlledField();
cf.setScheme(scheme);
cf.setValue(value);
return cf;
}
}

View File

@ -1,8 +1,12 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
/**
* Represents the country associated to this result. It extends eu.dnetlib.dhp.schema.dump.oaf.Qualifier with a
* 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
* result reprensented in the internal format is Unknown. The value for this element correspond to: - code corresponds
* to the classid of eu.dnetlib.dhp.schema.oaf.Country - label corresponds to the classname of
@ -10,28 +14,36 @@ package eu.dnetlib.dhp.schema.dump.oaf;
* dumped is not null. In this case : - provenance corresponds to dataInfo.provenanceaction.classid (to be modified with
* datainfo.provenanceaction.classname) - trust corresponds to dataInfo.trust
*/
public class Country extends Qualifier {
public class Country implements Serializable {
@JsonSchema(description="ISO 3166-1 alpha-2 country code (i.e. IT)")
private String code; // the classid in the Qualifier
private Provenance provenance;
@JsonSchema(description="The label for that code (i.e. Italy)")
private String label; // the classname in the Qualifier
public Provenance getProvenance() {
return provenance;
public String getCode() {
return code;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
public void setCode(String code) {
this.code = code;
}
public static Country newInstance(String code, String label, Provenance provenance) {
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public static Country newInstance(String code, String label) {
Country c = new Country();
c.setProvenance(provenance);
c.setCode(code);
c.setLabel(label);
return c;
}
public static Country newInstance(String code, String label, String provenance, String trust) {
return newInstance(code, label, Provenance.newInstance(provenance, trust));
}
}

View File

@ -3,11 +3,17 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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)")
private String shortName;
@JsonSchema(description = "The name of the funder (European Commission)")
private String name;
@JsonSchema(description = "Geographical jurisdiction (e.g. for European Commission is EU, for Croatian Science Foundation is HR)")
private String jurisdiction;
public String getJurisdiction() {

View File

@ -4,6 +4,11 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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
@ -19,27 +24,41 @@ import java.util.List;
* -pid of type List<ControlledField> that is the list of pids associated to the result coming from authoritative sources for that pid
* -alternateIdentifier of type List<ControlledField> that is the list of pids associated to the result coming from NON authoritative
* sources for that pid
* -measure list<KeyValue> to represent the measure computed for this instance (for example the Bip!Finder ones). It corresponds to measures in the model
*/
public class Instance implements Serializable {
private List<ControlledField> pid;
@JsonSchema(description = "Measures computed for this instance, for example Bip!Finder ones")
private List<Measure> measures;
private List<ControlledField> alternateIdentifier;
private List<ResultPid> pid;
@JsonSchema(description = "All the identifiers other than pids forged by an authorithy for the pid type (i.e. Crossref for DOIs")
private List<AlternateIdentifier> alternateIdentifier;
private String license;
@JsonSchema(description = "The accessRights for this materialization of the result")
private AccessRight accessright;
@JsonSchema(description = "The specific sub-type of this instance (see https://api.openaire.eu/vocabularies/dnet:result_typologies following the links)")
private String type;
@JsonSchema(description = "URLs to the instance. They may link to the actual full-text or to the landing page at the hosting source. ")
private List<String> url;
@JsonSchema(description = "The money spent to make this book or article available in Open Access. Source for this information is the OpenAPC initiative.")
private APC articleprocessingcharge;
@JsonSchema(description = "Date of the research product")
private String publicationdate;// dateofacceptance;
@JsonSchema(description = "If this instance has been peer-reviewed or not. Allowed values are peerReviewed, " +
"nonPeerReviewed, UNKNOWN (as defined in https://api.openaire.eu/vocabularies/dnet:review_levels)")
private String refereed; // peer-review status
public String getLicense() {
return license;
}
@ -96,19 +115,30 @@ public class Instance implements Serializable {
this.articleprocessingcharge = articleprocessingcharge;
}
public List<ControlledField> getPid() {
public List<ResultPid> getPid() {
return pid;
}
public void setPid(List<ControlledField> pid) {
public void setPid(List<ResultPid> pid) {
this.pid = pid;
}
public List<ControlledField> getAlternateIdentifier() {
public List<AlternateIdentifier> getAlternateIdentifier() {
return alternateIdentifier;
}
public void setAlternateIdentifier(List<ControlledField> alternateIdentifier) {
public void setAlternateIdentifier(List<AlternateIdentifier> alternateIdentifier) {
this.alternateIdentifier = alternateIdentifier;
}
public List<Measure> getMeasures() {
return measures;
}
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
}

View File

@ -1,48 +0,0 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* To represent the information described by a key and a value. It has two parameters: - key to store the key (generally
* the OpenAIRE id for some entity) - value to store the value (generally the OpenAIRE name for the key)
*/
public class KeyValue implements Serializable {
private String key;
private String value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static KeyValue newInstance(String key, String value) {
KeyValue inst = new KeyValue();
inst.key = key;
inst.value = value;
return inst;
}
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
}
}

View File

@ -0,0 +1,37 @@
package eu.dnetlib.dhp.schema.dump.oaf;
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")
private String code; // the classid in the Qualifier
@JsonSchema(description="Language label in English")
private String label; // the classname in the Qualifier
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public static Language newInstance(String code, String value) {
Language qualifier = new Language();
qualifier.setCode(code);
qualifier.setLabel(value);
return qualifier;
}
}

View File

@ -0,0 +1,45 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
public class Measure implements Serializable {
@JsonSchema(description = "The measure (i.e. popularity)")
private String key;
@JsonSchema(description = "The value for that measure")
private String value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static Measure newInstance(String key, String value) {
Measure inst = new Measure();
inst.key = key;
inst.value = value;
return inst;
}
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
}
}

View File

@ -1,45 +0,0 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
/**
* To represent the generic persistent identifier. It has two parameters: - id of type
* eu.dnetlib.dhp.schema.dump.oaf.ControlledField to store the scheme and value of the Persistent Identifier. -
* provenance of type eu.dnetlib.dhp.schema.dump.oaf.Provenance to store the provenance and trust of the information
*/
public class Pid implements Serializable {
private ControlledField id;
private Provenance provenance;
public ControlledField getId() {
return id;
}
public void setId(ControlledField pid) {
this.id = pid;
}
public Provenance getProvenance() {
return provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
public static Pid newInstance(ControlledField pid, Provenance provenance) {
Pid p = new Pid();
p.id = pid;
p.provenance = provenance;
return p;
}
public static Pid newInstance(ControlledField pid) {
Pid p = new Pid();
p.id = pid;
return p;
}
}

View File

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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
@ -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;

View File

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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,38 +0,0 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
/**
* 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
* classname of the eu.dnetlib.dhp.schema.oaf.Qualifier element
*/
public class Qualifier implements Serializable {
private String code; // the classid in the Qualifier
private String label; // the classname in the Qualifier
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public static Qualifier newInstance(String code, String value) {
Qualifier qualifier = new Qualifier();
qualifier.setCode(code);
qualifier.setLabel(value);
return qualifier;
}
}

View File

@ -4,15 +4,21 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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: - author of type
* Initiative/Infrastructures. It has the following parameters:
* - author of type
* List<eu.dnetlib.dhpschema.dump.oaf.Author> to describe the authors of a result. For each author in the result
* represented in the internal model one author in the esternal model is produced. - type of type String to represent
* represented in the internal model one author in the esternal model is produced.
* - type of type String to represent
* the category of the result. Possible values are publication, dataset, software, other. It corresponds to
* resulttype.classname of the dumped result - language of type eu.dnetlib.dhp.schema.dump.oaf.Qualifier to store
* resulttype.classname of the dumped result
* - language of type eu.dnetlib.dhp.schema.dump.oaf.Language to store
* information about the language of the result. It is dumped as - code corresponds to language.classid - value
* corresponds to language.classname - country of type List<eu.dnetlib.dhp.schema.dump.oaf.Country> to store the country
* corresponds to language.classname
* - country of type List<eu.dnetlib.dhp.schema.dump.oaf.Country> to store the country
* list to which the result is associated. For each country in the result respresented in the internal model one country
* in the external model is produces - subjects of type List<eu.dnetlib.dhp.dump.oaf.Subject> to store the subjects for
* the result. For each subject in the result represented in the internal model one subject in the external model is
@ -60,76 +66,101 @@ import java.util.List;
* to store information about the time OpenAIRE collected the record. It corresponds to dateofcollection of the result
* represented in the internal model - lasteupdatetimestamp of type String to store the timestamp of the last update of
* the record. It corresponds to lastupdatetimestamp of the resord represented in the internal model
* -measure list<KeyValue> to represent the measure of beepFinder. It corresponds to measures in the model
*
*/
public class Result implements Serializable {
private List<KeyValue> measures;
private List<Author> author;
// resulttype allows subclassing results into publications | datasets | software
@JsonSchema(description = "Type of the result: one of 'publication', 'dataset', 'software', 'other' (see also https://api.openaire.eu/vocabularies/dnet:result_typologies)")
private String type; // resulttype
// common fields
private Qualifier language;
private Language language;
private List<Country> country;
@JsonSchema(description="The list of countries associated to this result")
private List<ResultCountry> country;
@JsonSchema(description="Keywords associated to the result")
private List<Subject> subjects;
@JsonSchema(description = "A name or title by which a scientific result is known. May be the title of a publication, of a dataset or the name of a piece of software.")
private String maintitle;
@JsonSchema(description = "Explanatory or alternative name by which a scientific result is known.")
private String subtitle;
private List<String> description;
@JsonSchema(description = "Main date of the research product: typically the publication or issued date. In case of a research result with different versions with different dates, the date of the result is selected as the most frequent well-formatted date. If not available, then the most recent and complete date among those that are well-formatted. For statistics, the year is extracted and the result is counted only among the result of that year. Example: Pre-print date: 2019-02-03, Article date provided by repository: 2020-02, Article date provided by Crossref: 2020, OpenAIRE will set as date 2019-02-03, because its the most recent among the complete and well-formed dates. If then the repository updates the metadata and set a complete date (e.g. 2020-02-12), then this will be the new date for the result because it becomes the most recent most complete date. However, if OpenAIRE then collects the pre-print from another repository with date 2019-02-03, then this will be the “winning date” because it becomes the most frequent well-formatted date.")
private String publicationdate; // dateofacceptance;
@JsonSchema(description = "The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource.")
private String publisher;
@JsonSchema(description = "Date when the embargo ends and this result turns Open Access")
private String embargoenddate;
@JsonSchema(description = "See definition of Dublin Core field dc:source")
private List<String> source;
private List<String> format;
@JsonSchema(description="Contributors for the result")
private List<String> contributor;
private List<String> coverage;
private AccessRight bestaccessright;
@JsonSchema(description="The openest of the access rights of this result.")
private BestAccessRight bestaccessright;
@JsonSchema(description="Container has information about the conference or journal where the result has been presented or published")
private Container container;// Journal
@JsonSchema(description = "Only for results with type 'software': URL to the software documentation")
private List<String> documentationUrl; // software
@JsonSchema(description="Only for results with type 'software': the URL to the repository with the source code")
private String codeRepositoryUrl; // software
@JsonSchema(description = "Only for results with type 'software': the programming language")
private String programmingLanguage; // software
@JsonSchema(description="Only for results with type 'software': Information on the person responsible for providing further information regarding the resource")
private List<String> contactperson; // orp
@JsonSchema(description="Only for results with type 'software': Information on the group responsible for providing further information regarding the resource")
private List<String> contactgroup; // orp
@JsonSchema(description = "Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product")
private List<String> tool; // orp
@JsonSchema(description = "Only for results with type 'dataset': the declared size of the dataset")
private String size; // dataset
@JsonSchema(description = "Version of the result")
private String version; // dataset
@JsonSchema(description = "Geolocation information")
private List<GeoLocation> geolocation; // dataset
@JsonSchema(description = "The OpenAIRE identifiers for this result")
private String id;
@JsonSchema(description = "Identifiers of the record at the original sources")
private List<String> originalId;
private List<ControlledField> pid;
@JsonSchema(description = "Persistent identifiers of the result")
private List<ResultPid> pid;
@JsonSchema(description="When OpenAIRE collected the record the last time")
private String dateofcollection;
@JsonSchema(description = "Timestamp of last update of the record in OpenAIRE")
private Long lastupdatetimestamp;
public Long getLastupdatetimestamp() {
return lastupdatetimestamp;
}
@ -154,11 +185,11 @@ public class Result implements Serializable {
this.originalId = originalId;
}
public List<ControlledField> getPid() {
public List<ResultPid> getPid() {
return pid;
}
public void setPid(List<ControlledField> pid) {
public void setPid(List<ResultPid> pid) {
this.pid = pid;
}
@ -194,19 +225,19 @@ public class Result implements Serializable {
this.author = author;
}
public Qualifier getLanguage() {
public Language getLanguage() {
return language;
}
public void setLanguage(Qualifier language) {
public void setLanguage(Language language) {
this.language = language;
}
public List<Country> getCountry() {
public List<ResultCountry> getCountry() {
return country;
}
public void setCountry(List<Country> country) {
public void setCountry(List<ResultCountry> country) {
this.country = country;
}
@ -298,11 +329,11 @@ public class Result implements Serializable {
this.coverage = coverage;
}
public AccessRight getBestaccessright() {
public BestAccessRight getBestaccessright() {
return bestaccessright;
}
public void setBestaccessright(AccessRight bestaccessright) {
public void setBestaccessright(BestAccessRight bestaccessright) {
this.bestaccessright = bestaccessright;
}
@ -378,11 +409,5 @@ public class Result implements Serializable {
this.geolocation = geolocation;
}
public List<KeyValue> getMeasures() {
return measures;
}
public void setMeasures(List<KeyValue> measures) {
this.measures = measures;
}
}

View File

@ -0,0 +1,40 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
/**
* Represents the country associated to the generic result. It extends eu.dnetlib.dhp.schema.dump.oaf.Country with a
* provenance parameter of type eu.dnetlib.dhp.schema.dumo.oaf.Provenance. The country is not mapped if its value in the
* result reprensented in the internal format is Unknown. The value for this element correspond to:
* - code corresponds to the classid of eu.dnetlib.dhp.schema.oaf.Country
* - label corresponds to the classname of eu.dnetlib.dhp.schema.oaf.Country
* - provenance set only if the dataInfo associated to the Country of the result to be dumped is not null. In this case:
* - provenance corresponds to dataInfo.provenanceaction.classid (to be modified with datainfo.provenanceaction.classname)
* - trust corresponds to dataInfo.trust
*/
public class ResultCountry extends Country {
@JsonSchema(description="Why this result is associated to the country.")
private Provenance provenance;
public Provenance getProvenance() {
return provenance;
}
public void setProvenance(Provenance provenance) {
this.provenance = provenance;
}
public static ResultCountry newInstance(String code, String label, Provenance provenance) {
ResultCountry c = new ResultCountry();
c.setProvenance(provenance);
c.setCode(code);
c.setLabel(label);
return c;
}
public static ResultCountry newInstance(String code, String label, String provenance, String trust) {
return newInstance(code, label, Provenance.newInstance(provenance, trust));
}
}

View File

@ -0,0 +1,41 @@
package eu.dnetlib.dhp.schema.dump.oaf;
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 " +
"that pid type (i.e. Crossref/Datacite for doi). The set of authoritative pid is: doi when collected from Crossref or Datacite " +
"pmid when collected from EuroPubmed, arxiv when collected from arXiv, handle from the repositories")
private String scheme;
@JsonSchema(description="The value expressed in the scheme (i.e. 10.1000/182)")
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 ResultPid newInstance(String scheme, String value) {
ResultPid cf = new ResultPid();
cf.setScheme(scheme);
cf.setValue(value);
return cf;
}
}

View File

@ -3,23 +3,29 @@ package eu.dnetlib.dhp.schema.dump.oaf;
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.ControlledField to describe the subject. It mapped as: - schema it corresponds to
* qualifier.classid of the dumped subject - value it corresponds to the subject value - provenance of type
* eu.dnetlib.dhp.schema.dump.oaf.Provenance to represent the provenance of the subject. It is dumped only if dataInfo
* is not null. In this case: - provenance corresponds to dataInfo.provenanceaction.classname - trust corresponds to
* dataInfo.trust
* 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:
* - schema it corresponds to qualifier.classid of the dumped subject
* - value it corresponds to the subject value
* - provenance of type eu.dnetlib.dhp.schema.dump.oaf.Provenance to represent the provenance of the subject. It is dumped only if dataInfo
* is not null. In this case:
* - provenance corresponds to dataInfo.provenanceaction.classname
* - trust corresponds to dataInfo.trust
*/
public class Subject implements Serializable {
private ControlledField subject;
private SubjectSchemeValue subject;
@JsonSchema(description = "Why this subject is associated to the result")
private Provenance provenance;
public ControlledField getSubject() {
public SubjectSchemeValue getSubject() {
return subject;
}
public void setSubject(ControlledField subject) {
public void setSubject(SubjectSchemeValue subject) {
this.subject = subject;
}

View File

@ -0,0 +1,39 @@
package eu.dnetlib.dhp.schema.dump.oaf;
import java.io.Serializable;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
public class SubjectSchemeValue implements Serializable {
@JsonSchema(description="OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies).")
private String scheme;
@JsonSchema(description="The value for the subject in the selected scheme. When the scheme is 'keyword', it means that the subject is free-text (i.e. not a term from a controlled vocabulary).")
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 SubjectSchemeValue newInstance(String scheme, String value) {
SubjectSchemeValue cf = new SubjectSchemeValue();
cf.setScheme(scheme);
cf.setValue(value);
return cf;
}
}

View File

@ -0,0 +1,46 @@
package eu.dnetlib.dhp.schema.dump.oaf.community;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
public class CfHbKeyValue implements Serializable {
@JsonSchema(description = "the OpenAIRE identifier of the data source")
private String key;
@JsonSchema(description = "the name of the data source")
private String value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static CfHbKeyValue newInstance(String key, String value) {
CfHbKeyValue inst = new CfHbKeyValue();
inst.key = key;
inst.value = value;
return inst;
}
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
}
}

View File

@ -1,8 +1,9 @@
package eu.dnetlib.dhp.schema.dump.oaf.community;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
import eu.dnetlib.dhp.schema.dump.oaf.Instance;
import eu.dnetlib.dhp.schema.dump.oaf.KeyValue;
/**
* It extends eu.dnetlib.dhp.dump.oaf.Instance with values related to the community dump. In the Result dump this
@ -15,22 +16,25 @@ import eu.dnetlib.dhp.schema.dump.oaf.KeyValue;
* collectedfrom.key - value corresponds to collectedfrom.value
*/
public class CommunityInstance extends Instance {
private KeyValue hostedby;
private KeyValue collectedfrom;
@JsonSchema(description = "Information about the source from which the instance can be viewed or downloaded.")
private CfHbKeyValue hostedby;
public KeyValue getHostedby() {
@JsonSchema(description = "Information about the source from which the record has been collected")
private CfHbKeyValue collectedfrom;
public CfHbKeyValue getHostedby() {
return hostedby;
}
public void setHostedby(KeyValue hostedby) {
public void setHostedby(CfHbKeyValue hostedby) {
this.hostedby = hostedby;
}
public KeyValue getCollectedfrom() {
public CfHbKeyValue getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(KeyValue collectedfrom) {
public void setCollectedfrom(CfHbKeyValue collectedfrom) {
this.collectedfrom = collectedfrom;
}
}

View File

@ -3,7 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.community;
import java.util.List;
import eu.dnetlib.dhp.schema.dump.oaf.KeyValue;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
import eu.dnetlib.dhp.schema.dump.oaf.Result;
/**
@ -20,12 +21,16 @@ import eu.dnetlib.dhp.schema.dump.oaf.Result;
*/
public class CommunityResult extends Result {
@JsonSchema(description = "List of projects (i.e. grants) that (co-)funded the production ofn the research results")
private List<Project> projects;
@JsonSchema(description = "Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with OpenAIRE. Please see https://connect.openaire.eu")
private List<Context> context;
protected List<KeyValue> collectedfrom;
@JsonSchema(description = "Information about the sources from which the record has been collected")
protected List<CfHbKeyValue> collectedfrom;
@JsonSchema(description = "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version")
private List<CommunityInstance> instance;
public List<CommunityInstance> getInstance() {
@ -36,11 +41,11 @@ public class CommunityResult extends Result {
this.instance = instance;
}
public List<KeyValue> getCollectedfrom() {
public List<CfHbKeyValue> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<KeyValue> collectedfrom) {
public void setCollectedfrom(List<CfHbKeyValue> collectedfrom) {
this.collectedfrom = collectedfrom;
}
@ -61,3 +66,5 @@ public class CommunityResult extends Result {
}
}

View File

@ -6,8 +6,9 @@ import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
import eu.dnetlib.dhp.schema.dump.oaf.Provenance;
import eu.dnetlib.dhp.schema.dump.oaf.Qualifier;
/**
* Reference to a relevant research infrastructure, initiative or community (RI/RC) among those collaborating with
@ -21,7 +22,14 @@ import eu.dnetlib.dhp.schema.dump.oaf.Qualifier;
* instantiated if the element datainfo.provenanceaction is not null. In this case - provenance corresponds to
* dataInfo.provenanceaction.classname - trust corresponds to dataInfo.trust
*/
public class Context extends Qualifier {
public class Context {
@JsonSchema(description="Code identifying the RI/RC")
private String code;
@JsonSchema(description="Label of the RI/RC")
private String label;
@JsonSchema(description = "Why this result is associated to the RI/RC.")
private List<Provenance> provenance;
public List<Provenance> getProvenance() {
@ -32,6 +40,23 @@ public class Context extends Qualifier {
this.provenance = provenance;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@Override
public int hashCode() {
final String p = Optional.ofNullable(getProvenance())

View File

@ -1,6 +1,8 @@
package eu.dnetlib.dhp.schema.dump.oaf.community;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
/**
* To store information about the funder funding the project related to the result. It has the following parameters: -
* shortName of type String to store the funder short name (e.c. AKA). - name of type String to store the funder name
@ -9,6 +11,7 @@ package eu.dnetlib.dhp.schema.dump.oaf.community;
*/
public class Funder extends eu.dnetlib.dhp.schema.dump.oaf.Funder {
@JsonSchema(description = "Stream of funding (e.g. for European Commission can be H2020 or FP7)")
private String fundingStream;
public String getFundingStream() {

View File

@ -1,6 +1,8 @@
package eu.dnetlib.dhp.schema.dump.oaf.community;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
import eu.dnetlib.dhp.schema.dump.oaf.Provenance;
/**
@ -13,10 +15,21 @@ import eu.dnetlib.dhp.schema.dump.oaf.Provenance;
*/
public class Project extends eu.dnetlib.dhp.schema.dump.oaf.Project {
@JsonSchema(description = "Information about the funder funding the project")
private Funder funder;
private Provenance provenance;
private Validated validated;
public void setValidated(Validated validated){
this.validated = validated;
}
public Validated getValidated(){
return validated;
}
public Provenance getProvenance() {
return provenance;
}

View File

@ -0,0 +1,39 @@
package eu.dnetlib.dhp.schema.dump.oaf.community;
import java.io.Serializable;
/**
* To store information about the funder funding the project related to the result. It has the following parameters: -
* shortName of type String to store the funder short name (e.c. AKA). - name of type String to store the funder name
* (e.c. Akademy of Finland) - fundingStream of type String to store the funding stream - jurisdiction of type String to
* store the jurisdiction of the funder
*/
public class Validated implements Serializable {
private String validationDate;
private Boolean validatedByFunder;
public void setValidationDate(String validationDate){
this.validationDate = validationDate;
}
public String getValidationDate(){
return validationDate;
}
public void setValidatedByFunder(Boolean validated){
this.validatedByFunder = validated;
}
public Boolean getValidatedByFunder(){
return validatedByFunder;
}
public static Validated newInstance(Boolean validated, String validationDate){
Validated v = new Validated();
v.validatedByFunder = validated;
v.validationDate = validationDate;
return v;
}
}

View File

@ -4,8 +4,9 @@ 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;
/**
* To store information about the datasource OpenAIRE collects information from. It contains the following parameters: -
@ -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
private List<Object> policies; //
@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;
}
@ -297,11 +319,11 @@ public class Datasource implements Serializable {
this.certificates = certificates;
}
public List<Object> getPolicies() {
public List<String> getPolicies() {
return policies;
}
public void setPolicies(List<Object> policiesr3) {
public void setPolicies(List<String> policiesr3) {
this.policies = policiesr3;
}
@ -313,3 +335,5 @@ public class Datasource implements Serializable {
this.journal = journal;
}
}

View File

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

View File

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

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

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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
@ -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;

View File

@ -3,14 +3,21 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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
* 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() {

View File

@ -3,6 +3,8 @@ 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;
@ -12,6 +14,7 @@ import eu.dnetlib.dhp.schema.dump.oaf.Result;
* the same parameter in the result represented in the internal model
*/
public class GraphResult extends Result {
@JsonSchema(description = "Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version")
private List<Instance> instance;
public List<Instance> getInstance() {

View File

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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

@ -4,25 +4,36 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
import java.io.Serializable;
import java.util.List;
import eu.dnetlib.dhp.schema.dump.oaf.ControlledField;
import eu.dnetlib.dhp.schema.dump.oaf.Qualifier;
import com.github.imifou.jsonschema.module.addon.annotation.JsonSchema;
import eu.dnetlib.dhp.schema.dump.oaf.Country;
/**
* To represent the generic organizaiton. It has the following parameters: - private String legalshortname to store the
* legalshortname of the organizaiton - private String legalname to store the legal name of the organization - private
* String websiteurl to store the websiteurl of the organization - private List<String> alternativenames to store the
* alternative names of the organization - private Qualifier country to store the country of the organization - private
* String id to store the id of the organization - private List<ControlledField> pid to store the list of pids for the
* organization
* To represent the generic organizaiton. It has the following parameters:
* - private String legalshortname to store the legalshortname of the organizaiton
* - private String legalname to store the legal name of the organization
* - private String websiteurl to store the websiteurl of the organization
* - private List<String> alternativenames to store the alternative names of the organization
* - private Country country to store the country of the organization
* - private String id to store the openaire id of the organization
* - private List<OrganizationPid> pid to store the list of pids for the organization
*/
public class Organization implements Serializable {
private String legalshortname;
private String legalname;
private String websiteurl;
@JsonSchema(description="Alternative names that identify the organisation")
private List<String> alternativenames;
private Qualifier country;
@JsonSchema(description="The organisation country")
private Country country;
@JsonSchema(description="The OpenAIRE id for the organisation")
private String id;
private List<ControlledField> pid;
@JsonSchema(description="Persistent identifiers for the organisation i.e. isni 0000000090326370")
private List<OrganizationPid> pid;
public String getLegalshortname() {
return legalshortname;
@ -56,11 +67,11 @@ public class Organization implements Serializable {
this.alternativenames = alternativenames;
}
public Qualifier getCountry() {
public Country getCountry() {
return country;
}
public void setCountry(Qualifier country) {
public void setCountry(Country country) {
this.country = country;
}
@ -72,12 +83,15 @@ public class Organization implements Serializable {
this.id = id;
}
public List<ControlledField> getPid() {
public List<OrganizationPid> getPid() {
return pid;
}
public void setPid(List<ControlledField> pid) {
public void setPid(List<OrganizationPid> pid) {
this.pid = pid;
}
}

View File

@ -0,0 +1,42 @@
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;
}
public static OrganizationPid newInstance(String scheme, String value) {
OrganizationPid cf = new OrganizationPid();
cf.setScheme(scheme);
cf.setValue(value);
return cf;
}
}

View File

@ -3,12 +3,17 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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
*/
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

@ -4,6 +4,8 @@ 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;
/**
* 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
@ -41,6 +43,7 @@ public class Project implements Serializable {
private String code;
private String acronym;
private String title;
private String startdate;
private String enddate;
@ -54,12 +57,15 @@ public class Project implements Serializable {
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() {

View File

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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

View File

@ -4,6 +4,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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;
/**
@ -13,11 +15,24 @@ import eu.dnetlib.dhp.schema.dump.oaf.Provenance;
* provenance of the relation
*/
public class Relation implements Serializable {
@JsonSchema(description = "The node source in the relation")
private Node source;
@JsonSchema(description = "The node target in the relation")
private Node target;
@JsonSchema(description = "To represent the semantics of a relation between two entities")
private RelType reltype;
@JsonSchema(description = "The reason why OpenAIRE holds the relation ")
private Provenance provenance;
@JsonSchema(description = "True if the relation is related to a project and it has been collected from an authoritative source (i.e. the funder)")
private boolean validated;
@JsonSchema(description = "The date when the relation was collected from OpenAIRE")
private String validationDate;
public Node getSource() {
return source;
}
@ -50,6 +65,23 @@ public class Relation implements Serializable {
this.provenance = provenance;
}
public void setValidated(boolean validate){
this.validated = validate;
}
public boolean getValidated(){
return validated;
}
public void setValidationDate(String validationDate){
this.validationDate = validationDate;
}
public String getValidationDate(){
return validationDate;
}
@Override
public int hashCode() {

View File

@ -3,11 +3,14 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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
*/
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

@ -3,6 +3,8 @@ package eu.dnetlib.dhp.schema.dump.oaf.graph;
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
@ -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() {

View File

@ -108,6 +108,12 @@ public class Datasource extends OafEntity implements Serializable {
// New field for EOSC
private List<Qualifier> contentpolicies;
private Boolean consenttermsofuse;
private Boolean fulltextdownload;
private String consenttermsofusedate;
public Qualifier getDatasourcetype() {
return datasourcetype;
}
@ -444,6 +450,30 @@ public class Datasource extends OafEntity implements Serializable {
this.contentpolicies = contentpolicies;
}
public Boolean getConsenttermsofuse() {
return consenttermsofuse;
}
public void setConsenttermsofuse(Boolean consenttermsofuse) {
this.consenttermsofuse = consenttermsofuse;
}
public Boolean getFulltextdownload() {
return fulltextdownload;
}
public void setFulltextdownload(Boolean fulltextdownload) {
this.fulltextdownload = fulltextdownload;
}
public String getConsenttermsofusedate() {
return consenttermsofusedate;
}
public void setConsenttermsofusedate(String consenttermsofusedate) {
this.consenttermsofusedate = consenttermsofusedate;
}
@Override
public void mergeFrom(final OafEntity e) {
super.mergeFrom(e);

View File

@ -37,6 +37,8 @@ public class Instance implements Serializable {
private Qualifier refereed; // peer-review status
private List<Measure> measures;
public Field<String> getLicense() {
return license;
}
@ -141,6 +143,14 @@ public class Instance implements Serializable {
this.refereed = refereed;
}
public List<Measure> getMeasures() {
return measures;
}
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public String toComparableString() {
return String
.format(

View File

@ -1,6 +1,7 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.List;
import com.google.common.base.Objects;
@ -8,7 +9,7 @@ import com.google.common.base.Objects;
/**
* Represent a measure, must be further described by a system available resource providing name and descriptions.
*/
public class Measure {
public class Measure implements Serializable {
/**
* Unique measure identifier.

View File

@ -70,8 +70,14 @@ public abstract class Oaf implements Serializable {
}
public void mergeOAFDataInfo(Oaf o) {
if (o.getDataInfo() != null && compareTrust(this, o) < 0)
dataInfo = o.getDataInfo();
Optional.ofNullable(o)
.ifPresent(other -> Optional.ofNullable(other.getDataInfo())
.ifPresent(otherDataInfo -> Optional.ofNullable(this.getDataInfo())
.ifPresent(thisDataInfo -> {
if (compareTrust(this, other) < 0 || thisDataInfo.getInvisible()) {
setDataInfo(otherDataInfo);
}
})));
}
protected String extractTrust(Oaf e) {

View File

@ -2,237 +2,736 @@
package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import eu.dnetlib.dhp.schema.common.AccessRightComparator;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import eu.dnetlib.dhp.schema.common.AccessRightComparator;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.oaf.utils.CleaningFunctions;
/**
* The type Result.
*/
public class Result extends OafEntity implements Serializable {
/**
* ( article | book ) processing charges.
*/
private Field<String> processingchargeamount;
/**
* currency - alphabetic code describe in ISO-4217.
*/
private Field<String> processingchargecurrency;
/**
* The Measures.
*/
private List<Measure> measures;
/**
* The Author.
*/
private List<Author> author;
// resulttype allows subclassing results into publications | datasets | software
/**
* The Resulttype.
*/
// resulttype allows subclassing results into publications | datasets | software
private Qualifier resulttype;
// common fields
/**
* The Language.
*/
// common fields
private Qualifier language;
/**
* The Country.
*/
private List<Country> country;
/**
* The Subject.
*/
private List<StructuredProperty> subject;
/**
* The Title.
*/
private List<StructuredProperty> title;
/**
* The Relevantdate.
*/
private List<StructuredProperty> relevantdate;
/**
* The Description.
*/
private List<Field<String>> description;
/**
* The Dateofacceptance.
*/
private Field<String> dateofacceptance;
/**
* The Publisher.
*/
private Field<String> publisher;
/**
* The Embargoenddate.
*/
private Field<String> embargoenddate;
/**
* The Source.
*/
private List<Field<String>> source;
/**
* The Fulltext.
*/
private List<Field<String>> fulltext; // remove candidate
/**
* The Format.
*/
private List<Field<String>> format;
/**
* The Contributor.
*/
private List<Field<String>> contributor;
/**
* The Resourcetype.
*/
private Qualifier resourcetype;
/**
* The Coverage.
*/
private List<Field<String>> coverage;
/**
* The Bestaccessright.
*/
private Qualifier bestaccessright;
/**
* The Context.
*/
private List<Context> context;
/**
* The External reference.
*/
private List<ExternalReference> externalReference;
/**
* The Instance.
*/
private List<Instance> instance;
/**
* Gets measures.
*
* @return the measures
*/
public List<Measure> getMeasures() {
return measures;
}
/**
* Sets measures.
*
* @param measures the measures
*/
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public Field<String> getProcessingchargeamount() {
return processingchargeamount;
}
public void setProcessingchargeamount(Field<String> processingchargeamount) {
this.processingchargeamount = processingchargeamount;
}
public Field<String> getProcessingchargecurrency() {
return processingchargecurrency;
}
public void setProcessingchargecurrency(Field<String> processingchargecurrency) {
this.processingchargecurrency = processingchargecurrency;
}
/**
* Gets author.
*
* @return the author
*/
public List<Author> getAuthor() {
return author;
}
/**
* Sets author.
*
* @param author the author
*/
public void setAuthor(List<Author> author) {
this.author = author;
}
/**
* Gets resulttype.
*
* @return the resulttype
*/
public Qualifier getResulttype() {
return resulttype;
}
/**
* Sets resulttype.
*
* @param resulttype the resulttype
*/
public void setResulttype(Qualifier resulttype) {
this.resulttype = resulttype;
}
/**
* Gets language.
*
* @return the language
*/
public Qualifier getLanguage() {
return language;
}
/**
* Sets language.
*
* @param language the language
*/
public void setLanguage(Qualifier language) {
this.language = language;
}
/**
* Gets country.
*
* @return the country
*/
public List<Country> getCountry() {
return country;
}
/**
* Sets country.
*
* @param country the country
*/
public void setCountry(List<Country> country) {
this.country = country;
}
/**
* Gets subject.
*
* @return the subject
*/
public List<StructuredProperty> getSubject() {
return subject;
}
/**
* Sets subject.
*
* @param subject the subject
*/
public void setSubject(List<StructuredProperty> subject) {
this.subject = subject;
}
/**
* Gets title.
*
* @return the title
*/
public List<StructuredProperty> getTitle() {
return title;
}
/**
* Sets title.
*
* @param title the title
*/
public void setTitle(List<StructuredProperty> title) {
this.title = title;
}
/**
* Gets relevantdate.
*
* @return the relevantdate
*/
public List<StructuredProperty> getRelevantdate() {
return relevantdate;
}
/**
* Sets relevantdate.
*
* @param relevantdate the relevantdate
*/
public void setRelevantdate(List<StructuredProperty> relevantdate) {
this.relevantdate = relevantdate;
}
/**
* Gets description.
*
* @return the description
*/
public List<Field<String>> getDescription() {
return description;
}
/**
* Sets description.
*
* @param description the description
*/
public void setDescription(List<Field<String>> description) {
this.description = description;
}
/**
* Gets dateofacceptance.
*
* @return the dateofacceptance
*/
public Field<String> getDateofacceptance() {
return dateofacceptance;
}
/**
* Sets dateofacceptance.
*
* @param dateofacceptance the dateofacceptance
*/
public void setDateofacceptance(Field<String> dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
/**
* Gets publisher.
*
* @return the publisher
*/
public Field<String> getPublisher() {
return publisher;
}
/**
* Sets publisher.
*
* @param publisher the publisher
*/
public void setPublisher(Field<String> publisher) {
this.publisher = publisher;
}
/**
* Gets embargoenddate.
*
* @return the embargoenddate
*/
public Field<String> getEmbargoenddate() {
return embargoenddate;
}
/**
* Sets embargoenddate.
*
* @param embargoenddate the embargoenddate
*/
public void setEmbargoenddate(Field<String> embargoenddate) {
this.embargoenddate = embargoenddate;
}
/**
* Gets source.
*
* @return the source
*/
public List<Field<String>> getSource() {
return source;
}
/**
* Sets source.
*
* @param source the source
*/
public void setSource(List<Field<String>> source) {
this.source = source;
}
/**
* Gets fulltext.
*
* @return the fulltext
*/
public List<Field<String>> getFulltext() {
return fulltext;
}
/**
* Sets fulltext.
*
* @param fulltext the fulltext
*/
public void setFulltext(List<Field<String>> fulltext) {
this.fulltext = fulltext;
}
/**
* Gets format.
*
* @return the format
*/
public List<Field<String>> getFormat() {
return format;
}
/**
* Sets format.
*
* @param format the format
*/
public void setFormat(List<Field<String>> format) {
this.format = format;
}
/**
* Gets contributor.
*
* @return the contributor
*/
public List<Field<String>> getContributor() {
return contributor;
}
/**
* Sets contributor.
*
* @param contributor the contributor
*/
public void setContributor(List<Field<String>> contributor) {
this.contributor = contributor;
}
/**
* Gets resourcetype.
*
* @return the resourcetype
*/
public Qualifier getResourcetype() {
return resourcetype;
}
/**
* Sets resourcetype.
*
* @param resourcetype the resourcetype
*/
public void setResourcetype(Qualifier resourcetype) {
this.resourcetype = resourcetype;
}
/**
* Gets coverage.
*
* @return the coverage
*/
public List<Field<String>> getCoverage() {
return coverage;
}
/**
* Sets coverage.
*
* @param coverage the coverage
*/
public void setCoverage(List<Field<String>> coverage) {
this.coverage = coverage;
}
/**
* Gets bestaccessright.
*
* @return the bestaccessright
*/
public Qualifier getBestaccessright() {
return bestaccessright;
}
/**
* Sets bestaccessright.
*
* @param bestaccessright the bestaccessright
*/
public void setBestaccessright(Qualifier bestaccessright) {
this.bestaccessright = bestaccessright;
}
/**
* Gets context.
*
* @return the context
*/
public List<Context> getContext() {
return context;
}
/**
* Sets context.
*
* @param context the context
*/
public void setContext(List<Context> context) {
this.context = context;
}
/**
* Gets external reference.
*
* @return the external reference
*/
public List<ExternalReference> getExternalReference() {
return externalReference;
}
/**
* Sets external reference.
*
* @param externalReference the external reference
*/
public void setExternalReference(List<ExternalReference> externalReference) {
this.externalReference = externalReference;
}
/**
* Gets instance.
*
* @return the instance
*/
public List<Instance> getInstance() {
return instance;
}
/**
* Sets instance.
*
* @param instance the instance
*/
public void setInstance(List<Instance> instance) {
this.instance = instance;
}
/**
* Is an enrichment boolean.
*
* @param e the e
* @return the boolean
*/
public static boolean isAnEnrichment(OafEntity e) {
return e.getDataInfo()!= null &&
e.getDataInfo().getProvenanceaction()!= null
&& ModelConstants.PROVENANCE_ENRICH.equalsIgnoreCase(e.getDataInfo().getProvenanceaction().getClassid());
}
/**
* Normalize pid string.
*
* @param pid the pid
* @return the string
*/
private static String extractKeyFromPid(final StructuredProperty pid) {
if (pid == null)
return null;
final StructuredProperty normalizedPid = CleaningFunctions.normalizePidValue(pid);
return String.format("%s::%s", normalizedPid.getQualifier().getClassid(), normalizedPid.getValue());
}
/**
* Valid pid boolean.
*
* @param p the p
* @return the boolean
*/
private static boolean validPid(final StructuredProperty p) {
return p.getValue()!= null && p.getQualifier()!= null && p.getQualifier().getClassid()!=null;
}
/**
* This method converts the list of instance enrichments
* into a Map where the key is the normalized identifier
* and the value is the instance itself
*
* @param ri the list of enrichment instances
* @return the result map
*/
public static Map<String, Instance> toInstanceMap(final List<Instance> ri) {
return ri
.stream()
.filter(i -> i.getPid() != null || i.getAlternateIdentifier() != null)
.flatMap(i -> {
final List<Pair<String, Instance>> result = new ArrayList<>();
if (i.getPid() != null)
i.getPid().stream().filter(Result::validPid).forEach(p -> result.add(new ImmutablePair<>(extractKeyFromPid(p), i)));
if (i.getAlternateIdentifier() != null)
i.getAlternateIdentifier().stream().filter(Result::validPid).forEach(p -> result.add(new ImmutablePair<>(extractKeyFromPid(p), i)));
return result.stream();
}).collect(Collectors.toMap(
Pair::getLeft,
Pair::getRight,
(a, b) -> a
));
}
/**
* This utility method finds the list of enrichment instances
* that match one or more PIDs in the input list
*
* @param pids the list of PIDs
* @param enrichments the List of enrichment instances having the same pid
* @return the list
*/
private static List<Instance> findEnrichmentsByPID(final List<StructuredProperty> pids, final Map<String,Instance> enrichments) {
if (pids == null || enrichments == null)
return null;
return pids
.stream()
.map(Result::extractKeyFromPid)
.map(enrichments::get)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
/**
* This method apply enrichment on a single instance
* The enrichment consists of replacing values on
* single attribute only if in the current instance is missing
* The only repeatable field enriched is measures
*
* @param currentInstance the current instance
* @param enrichment the enrichment instance
*/
private static void applyEnrichment(final Instance currentInstance, final Instance enrichment) {
if (currentInstance == null || enrichment == null)
return;
//ENRICH accessright
if (enrichment.getAccessright()!=null && currentInstance.getAccessright() == null)
currentInstance.setAccessright(enrichment.getAccessright());
//ENRICH license
if (enrichment.getLicense()!=null && currentInstance.getLicense() == null)
currentInstance.setLicense(enrichment.getLicense());
//ENRICH instanceType
if (enrichment.getInstancetype()!=null && currentInstance.getInstancetype() == null)
currentInstance.setInstancetype(enrichment.getInstancetype());
//ENRICH hostedby
if (enrichment.getHostedby()!=null && currentInstance.getHostedby() == null)
currentInstance.setHostedby(enrichment.getHostedby());
//ENRICH distributionlocation
if (enrichment.getDistributionlocation()!=null && currentInstance.getDistributionlocation() == null)
currentInstance.setDistributionlocation(enrichment.getDistributionlocation());
//ENRICH collectedfrom
if (enrichment.getCollectedfrom()!=null && currentInstance.getCollectedfrom() == null)
currentInstance.setCollectedfrom(enrichment.getCollectedfrom());
//ENRICH dateofacceptance
if (enrichment.getDateofacceptance()!=null && currentInstance.getDateofacceptance() == null)
currentInstance.setDateofacceptance(enrichment.getDateofacceptance());
//ENRICH processingchargeamount
if (enrichment.getProcessingchargeamount()!=null && currentInstance.getProcessingchargeamount() == null)
currentInstance.setProcessingchargeamount(enrichment.getProcessingchargeamount());
//ENRICH refereed
if (enrichment.getRefereed()!=null && currentInstance.getRefereed() == null)
currentInstance.setRefereed(enrichment.getRefereed());
//ENRICH measures
if (enrichment.getMeasures()!=null)
if (currentInstance.getMeasures() == null)
currentInstance.setMeasures(enrichment.getMeasures());
else
enrichment.getMeasures().forEach(currentInstance.getMeasures()::add);
}
/**
* This main method apply the enrichment of the instances
*
* @param toEnrichInstances the instances that could be enriched
* @param enrichmentInstances the enrichment instances
* @return list of instances possibly enriched
*/
private static List<Instance> enrichInstances(final List<Instance> toEnrichInstances,final List<Instance> enrichmentInstances) {
final List<Instance> enrichmentResult = new ArrayList<>();
if (toEnrichInstances == null) {
return enrichmentResult;
}
if (enrichmentInstances == null) {
return enrichmentResult;
}
Map<String, Instance> ri = toInstanceMap(enrichmentInstances);
toEnrichInstances.forEach(i -> {
final List<Instance> e = findEnrichmentsByPID(i.getPid(), ri);
if (e!= null && e.size()> 0) {
e.forEach(enr -> applyEnrichment(i, enr));
} else {
final List<Instance> a = findEnrichmentsByPID(i.getAlternateIdentifier(), ri);
if (a!= null && a.size()> 0) {
a.forEach(enr -> applyEnrichment(i, enr));
}
}
enrichmentResult.add(i);
});
return enrichmentResult;
}
@Override
public void mergeFrom(OafEntity e) {
super.mergeFrom(e);
@ -243,9 +742,22 @@ public class Result extends OafEntity implements Serializable {
Result r = (Result) e;
if(processingchargeamount == null || StringUtils.isBlank(processingchargeamount.getValue() )){
processingchargeamount = r.getProcessingchargeamount();
processingchargecurrency = r.getProcessingchargecurrency();
}
measures = mergeLists(measures, r.getMeasures());
instance = mergeLists(instance, r.getInstance());
if( !isAnEnrichment(this) && !isAnEnrichment(e))
instance = mergeLists(instance, r.getInstance());
else {
final List<Instance> enrichmentInstances = isAnEnrichment(this) ? instance : r.getInstance();
final List<Instance> enrichedInstances= isAnEnrichment(this) ? r.getInstance(): instance;
if (isAnEnrichment(this))
setDataInfo(e.getDataInfo());
instance = enrichInstances(enrichedInstances,enrichmentInstances);
}
if (r.getBestaccessright() != null
&& new AccessRightComparator().compare(r.getBestaccessright(), bestaccessright) < 0)
@ -325,6 +837,13 @@ public class Result extends OafEntity implements Serializable {
externalReference = mergeLists(externalReference, r.getExternalReference());
}
/**
* Longest lists list.
*
* @param a the a
* @param b the b
* @return the list
*/
private List<Field<String>> longestLists(List<Field<String>> a, List<Field<String>> b) {
if (a == null || b == null)
return a == null ? b : a;
@ -346,6 +865,12 @@ public class Result extends OafEntity implements Serializable {
return a.size() > b.size() ? a : b;
}
/**
* Gets main title.
*
* @param titles the titles
* @return the main title
*/
private StructuredProperty getMainTitle(List<StructuredProperty> titles) {
// need to check if the list of titles contains more than 1 main title? (in that case, we should chose which
// main title select in the list)

View File

@ -67,6 +67,25 @@ public class IdentifierFactory implements Serializable {
DELEGATED_PID_AUTHORITY.get(PidType.doi).put(ZENODO_R3_ID, "zenodo");
}
/**
* Declares the associations PID_TYPE -> [DATASOURCE ID, NAME] whose records are considered enrichment for the graph.
* Their OpenAIRE ID is built from the declared PID type. Are merged with their corresponding record, identified by
* the same OpenAIRE id.
*/
public static final Map<PidType, HashBiMap<String, String>> ENRICHMENT_PROVIDER = Maps.newHashMap();
static {
ENRICHMENT_PROVIDER.put(PidType.doi, HashBiMap.create());
ENRICHMENT_PROVIDER.get(PidType.doi).put(OPEN_APC_ID, OPEN_APC_NAME);
}
public static Set<String> delegatedAuthorityDatasourceIds() {
return DELEGATED_PID_AUTHORITY.values()
.stream()
.flatMap(m -> m.keySet().stream())
.collect(Collectors.toCollection(HashSet::new));
}
public static List<StructuredProperty> getPids(List<StructuredProperty> pid, KeyValue collectedFrom) {
return pidFromInstance(pid, collectedFrom, true).distinct().collect(Collectors.toList());
}
@ -177,23 +196,34 @@ public class IdentifierFactory implements Serializable {
.stream()
// filter away PIDs provided by a DS that is not considered an authority for the
// given PID Type
.filter(p -> shouldFilterPidByAuthority(collectedFrom, p, mapHandles))
.filter(p -> shouldFilterPidByCriteria(collectedFrom, p, mapHandles))
.map(CleaningFunctions::normalizePidValue)
.filter(p -> isNotFromDelegatedAuthority(collectedFrom, p))
.filter(CleaningFunctions::pidFilter))
.orElse(Stream.empty());
}
private static boolean shouldFilterPidByAuthority(KeyValue collectedFrom, StructuredProperty p, boolean mapHandles) {
private static boolean shouldFilterPidByCriteria(KeyValue collectedFrom, StructuredProperty p, boolean mapHandles) {
final PidType pType = PidType.tryValueOf(p.getQualifier().getClassid());
return (mapHandles && pType.equals(PidType.handle)) || Optional.ofNullable(collectedFrom).isPresent() &&
Optional
.ofNullable(PID_AUTHORITY.get(pType))
.map(authorities -> {
return authorities.containsKey(collectedFrom.getKey())
|| authorities.containsValue(collectedFrom.getValue());
})
if (Objects.isNull(collectedFrom)) {
return false;
}
boolean isEnrich = Optional
.ofNullable(ENRICHMENT_PROVIDER.get(pType))
.map(enrich -> enrich.containsKey(collectedFrom.getKey())
|| enrich.containsValue(collectedFrom.getValue()))
.orElse(false);
boolean isAuthority = Optional
.ofNullable(PID_AUTHORITY.get(pType))
.map(authorities -> authorities.containsKey(collectedFrom.getKey())
|| authorities.containsValue(collectedFrom.getValue()))
.orElse(false);
return (mapHandles && pType.equals(PidType.handle)) || isEnrich || isAuthority;
}
private static boolean isNotFromDelegatedAuthority(KeyValue collectedFrom, StructuredProperty p) {

View File

@ -0,0 +1,99 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import java.util.Objects;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
public class LinkPublisher {
@NotBlank
@JsonProperty("name")
private String name = null;
@NotBlank
@JsonProperty("totalRelationships")
private Integer totalRelationships = null;
public LinkPublisher name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@Schema(description = "The Publisher Name")
@Size(max=300) public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public LinkPublisher totalRelationships(Integer totalRelationships) {
this.totalRelationships = totalRelationships;
return this;
}
/**
* Get totalRelationships
* @return totalRelationships
**/
@Schema(description = "Total number of relationships that the publisher provides")
public Integer getTotalRelationships() {
return totalRelationships;
}
public void setTotalRelationships(Integer totalRelationships) {
this.totalRelationships = totalRelationships;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LinkPublisher linkPublisher = (LinkPublisher) o;
return Objects.equals(this.name, linkPublisher.name) &&
Objects.equals(this.totalRelationships, linkPublisher.totalRelationships);
}
@Override
public int hashCode() {
return Objects.hash(name, totalRelationships);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LinkPublisher {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" totalRelationships: ").append(toIndentedString(totalRelationships)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,70 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixEntityId;
import io.swagger.v3.oas.annotations.media.Schema;
public class ScholixCreator {
@JsonProperty("name")
private String name = null;
@JsonProperty("identifier")
private List<ScholixIdentifier> identifier = null;
public ScholixCreator name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@Schema(required = true, description = "The name of the Object Creator")
public String getName() {
return name;
}
public ScholixCreator setName(String name) {
this.name = name;
return this;
}
/**
* Get identifier
* @return identifier
**/
@Schema(description = "A unique string that identifies the Object Creator")
public List<ScholixIdentifier> getIdentifier() {
return identifier;
}
public ScholixCreator setIdentifier(List<ScholixIdentifier> identifier) {
this.identifier = identifier;
return this;
}
public static ScholixCreator fromScholixEntityId(final ScholixEntityId provider) {
if (provider == null)
return null;
ScholixCreator instance = new ScholixCreator().setName(provider.getName());
if (provider.getIdentifiers()!= null && provider.getIdentifiers().size()>0)
instance.setIdentifier(provider.getIdentifiers()
.stream()
.map(i ->new ScholixIdentifier()
.setIdentifier(i.getIdentifier())
.setSchema(i.getSchema()))
.collect(Collectors.toList()));
return instance;
}
}

View File

@ -0,0 +1,72 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
public class ScholixIdentifier {
@JsonProperty("identifier")
private String identifier = null;
@JsonProperty("schema")
private String schema = null;
public ScholixIdentifier Identifier(String ID) {
this.identifier = ID;
return this;
}
/**
* Get ID
* @return ID
**/
@Schema(description = "The value of the Identifier")
public String getIdentifier() {
return identifier;
}
public ScholixIdentifier setIdentifier(String identifier) {
this.identifier = identifier;
return this;
}
public ScholixIdentifier Schema(String idScheme) {
this.schema = idScheme;
return this;
}
/**
* Get the Schema
* @return Schema
**/
@Schema(description = "The Schema URL of the identifier type")
public String getSchema() {
return schema;
}
public ScholixIdentifier setSchema(String schema) {
this.schema = schema;
return this;
}
public static ScholixIdentifier fromScholixIdentifier(eu.dnetlib.dhp.schema.sx.scholix.ScholixIdentifier input) {
if (input == null)
return null;
final ScholixIdentifier result = new ScholixIdentifier();
result.setSchema(input.getSchema());
result.setIdentifier(input.getIdentifier());
return result;
}
}

View File

@ -0,0 +1,162 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixResource;
import io.swagger.v3.oas.annotations.media.Schema;
public class ScholixItem {
@JsonProperty("identifiers")
private List<ScholixIdentifier> identifiers;
@JsonProperty("objectType")
private String objectType;
@JsonProperty("objectSubType")
private String objectSubType;
@JsonProperty("title")
private String title;
@JsonProperty("creator")
private List<ScholixCreator> creator;
@JsonProperty("publicationDate")
private String publicationDate;
@JsonProperty("publisher")
private List<ScholixProvider> publisher;
@Schema(description = "The list of identifiers")
public List<ScholixIdentifier> getIdentifiers() {
return identifiers;
}
public ScholixItem setIdentifiers(List<ScholixIdentifier> identifiers) {
this.identifiers = identifiers;
return this;
}
public ScholixItem objectType(String objectType) {
this.objectType = objectType;
return this;
}
@Schema(description = "Describes the nature of the object (its intended usage)")
public String getObjectType() {
return objectType;
}
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public ScholixItem objectSubType(String objectSubType) {
this.objectSubType = objectSubType;
return this;
}
@Schema(description = "The sub-type of Object")
public String getObjectSubType() {
return objectSubType;
}
public void setObjectSubType(String objectSubType) {
this.objectSubType = objectSubType;
}
public ScholixItem title(String title) {
this.title = title;
return this;
}
@Schema(description = "The name of the object")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ScholixItem creator(List<ScholixCreator> creator) {
this.creator = creator;
return this;
}
public ScholixItem addCreatorInstance(ScholixCreator creatorInstance) {
if(this.creator == null)
this.creator = new ArrayList<>();
this.creator.add(creatorInstance);
return this;
}
@Schema(description = "Party responsible for the creation of the object")
public List<ScholixCreator> getCreator() {
return creator;
}
public void setCreator(List<ScholixCreator> creator) {
this.creator = creator;
}
@Schema(description = "The date the object was formally issued, published or distributed")
public String getPublicationDate() {
return publicationDate;
}
public void setPublicationDate(String publicationDate) {
this.publicationDate = publicationDate;
}
@Schema(description = "The list name of the publisher of the object")
public List<ScholixProvider> getPublisher() {
return publisher;
}
public ScholixItem setPublisher(List<ScholixProvider> publisher) {
this.publisher = publisher;
return this;
}
public static ScholixItem fromScholixResource(final ScholixResource input) {
if (input == null)
return null;
final ScholixItem result = new ScholixItem();
if (input.getIdentifier()!= null)
result.setIdentifiers(
input.getIdentifier().stream()
.map(ScholixIdentifier::fromScholixIdentifier)
.collect(Collectors.toList())
);
result.setTitle(input.getTitle());
result.setObjectType(input.getObjectType());
result.setObjectSubType(input.getObjectSubType());
result.setPublicationDate(input.getPublicationDate());
if(input.getPublisher()!= null)
result.setPublisher(input.getPublisher().stream()
.map(ScholixProvider::fromScholixEntityId)
.collect(Collectors.toList())
);
if (input.getCreator()!= null)
result.setCreator(input.getCreator().stream()
.map(ScholixCreator::fromScholixEntityId)
.collect(Collectors.toList())
);
return result;
}
}

View File

@ -0,0 +1,131 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.validation.Valid;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixEntityId;
import io.swagger.v3.oas.annotations.media.Schema;
public class ScholixProvider {
public static ScholixProvider fromScholixEntityId(final ScholixEntityId provider) {
if (provider == null)
return null;
ScholixProvider instance = new ScholixProvider().setName(provider.getName());
if (provider.getIdentifiers()!= null && provider.getIdentifiers().size()>0)
instance.setIdentifier(provider.getIdentifiers()
.stream()
.map(i ->new ScholixIdentifier()
.setIdentifier(i.getIdentifier())
.setSchema(i.getSchema()))
.collect(Collectors.toList()));
return instance;
}
@JsonProperty("name")
private String name = null;
@JsonProperty("identifier")
@Valid
private List<ScholixIdentifier> identifier = null;
public ScholixProvider name(String name) {
this.name = name;
return this;
}
/**
* Get the provider name
* @return name
**/
@Schema(description = "The provider name")
public String getName() {
return name;
}
public ScholixProvider setName(String name) {
this.name = name;
return this;
}
public ScholixProvider identifier(List<ScholixIdentifier> identifier) {
this.identifier = identifier;
return this;
}
public ScholixProvider addIdentifierItem(ScholixIdentifier identifierItem) {
if (this.identifier == null) {
this.identifier = new ArrayList<>();
}
this.identifier.add(identifierItem);
return this;
}
/**
* Get identifier
* @return identifier
**/
@Schema(description = "the identifiers of the provider")
@Valid
public List<ScholixIdentifier> getIdentifier() {
return identifier;
}
public ScholixProvider setIdentifier(List<ScholixIdentifier> identifier) {
this.identifier = identifier;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScholixProvider scholixProviderType = (ScholixProvider) o;
return Objects.equals(this.name, scholixProviderType.name) &&
Objects.equals(this.identifier, scholixProviderType.identifier);
}
@Override
public int hashCode() {
return Objects.hash(name, identifier);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ScholixProviderType {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" identifiers: ").append(toIndentedString(identifier)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,136 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import static eu.dnetlib.dhp.schema.sx.api.model.v2.RelationshipType.relationMapping;
import java.util.Objects;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
public class ScholixRelationship {
@JsonProperty("name")
private String name = null;
@JsonProperty("schema")
private String schema = null;
@NotBlank
@JsonProperty("inverseRelationship")
private String inverseRelationship = null;
public ScholixRelationship name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@Schema(required = true, description = "The relationship type chosen from a Scholix controlled vocabulary")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ScholixRelationship schema(String schema) {
this.schema = schema;
return this;
}
/**
* Get The name of the schema or controlled list from which Relationship Sub-type is sourced
* @return subType
**/
@Schema(description = "The name of the schema or controlled list from which Relationship Sub-type is sourced")
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public ScholixRelationship inverseRelationship(String inverseRelationship) {
this.inverseRelationship = inverseRelationship;
return this;
}
/**
* Get inverseRelationship
* @return inverseRelationship
**/
@Schema(description = "The value of the inverse relation")
public String getInverseRelationship() {
return inverseRelationship;
}
public void setInverseRelationship(String inverseRelationship) {
this.inverseRelationship = inverseRelationship;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScholixRelationship relationshipType = (ScholixRelationship) o;
return Objects.equals(this.name, relationshipType.name) &&
Objects.equals(this.schema, relationshipType.schema) &&
Objects.equals(this.inverseRelationship, relationshipType.inverseRelationship);
}
@Override
public int hashCode() {
return Objects.hash(name, schema, inverseRelationship);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RelationshipType {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" subType: ").append(toIndentedString(schema)).append("\n");
sb.append(" subTypeSchema: ").append(toIndentedString(inverseRelationship)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ScholixRelationship fromScholixIndexRelationship(eu.dnetlib.dhp.schema.sx.scholix.ScholixRelationship inputRel) {
if(inputRel==null)
return null;
ScholixRelationship result = new ScholixRelationship();
result.setName(relationMapping.getOrDefault(inputRel.getName(), "IsRelatedTo"));
result.setInverseRelationship(relationMapping.getOrDefault(inputRel.getInverse(), "IsRelatedTo"));
result.setSchema(inputRel.getSchema());
return result;
}
}

View File

@ -0,0 +1,186 @@
package eu.dnetlib.dhp.schema.sx.api.model.v1;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.Scholix;
import io.swagger.v3.oas.annotations.media.Schema;
public class ScholixV1 implements Serializable {
@JsonProperty("linkProvider")
private List<ScholixProvider> linkProvider;
@JsonProperty("publicationDate")
private String publicationDate;
@NotBlank
@JsonProperty("relationship")
private ScholixRelationship relationship;
@NotBlank
@JsonProperty("source")
private ScholixItem source;
@NotBlank
@JsonProperty("target")
private ScholixItem target;
public ScholixV1 linkProvider (final List<ScholixProvider> linkProvider ) {
this.linkProvider = linkProvider;
return this;
}
@Schema(description = "An entity responsible for making this record available online")
public List<ScholixProvider> getLinkProvider() {
return linkProvider;
}
public ScholixV1 addLinkProviderItem(ScholixProvider linkProviderItem) {
if (this.linkProvider == null) {
this.linkProvider = new ArrayList<>();
}
this.linkProvider.add(linkProviderItem);
return this;
}
public void setLinkProvider(List<ScholixProvider> linkProvider) {
this.linkProvider = linkProvider;
}
@Schema(description = "date of formal issuance (e.g., publication) of the resource; generally different from source object and target object publication dates")
public String getPublicationDate() {
return publicationDate;
}
public ScholixV1 publicationDate(String publicationDate) {
this.publicationDate = publicationDate;
return this;
}
public void setPublicationDate(String publicationDate) {
this.publicationDate = publicationDate;
}
@Schema(description = "Semantics of the relationship from source to target")
public ScholixRelationship getRelationship() {
return relationship;
}
public ScholixV1 relationship(ScholixRelationship relationship) {
this.relationship = relationship;
return this;
}
public void setRelationship(ScholixRelationship relationship) {
this.relationship = relationship;
}
@Schema(description = "Root element relative to all properties describing the links source object.")
public ScholixItem getSource() {
return source;
}
public ScholixV1 source(ScholixItem source) {
this.source = source;
return this;
}
public void setSource(ScholixItem source) {
this.source = source;
}
@Schema(description = "Root element relative to all properties describing the links target object.")
public ScholixItem getTarget() {
return target;
}
public ScholixV1 target(ScholixItem target) {
this.target = target;
return this;
}
public void setTarget(ScholixItem target) {
this.target = target;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScholixV1 scholixV1 = (ScholixV1) o;
return Objects.equals(this.linkProvider, scholixV1.getLinkProvider()) &&
Objects.equals(this.publicationDate, scholixV1.getPublicationDate()) &&
Objects.equals(this.relationship, scholixV1.getRelationship()) &&
Objects.equals(this.source, scholixV1.getSource()) &&
Objects.equals(this.target, scholixV1.getTarget());
}
@Override
public int hashCode() {
return Objects.hash(linkProvider, publicationDate, relationship, source, target);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ScholixV1 {\n");
sb.append(" linkProvider: ").append(toIndentedString(linkProvider)).append("\n");
sb.append(" publicationDate: ").append(toIndentedString(publicationDate)).append("\n");
sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n");
sb.append(" source: ").append(toIndentedString(source)).append("\n");
sb.append(" target: ").append(toIndentedString(target)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ScholixV1 fromScholix(Scholix input) {
if (input == null)
return null;
final ScholixV1 result = new ScholixV1();
if (input.getLinkprovider()!= null)
result.setLinkProvider(input.getLinkprovider()
.stream()
.map(ScholixProvider::fromScholixEntityId)
.collect(Collectors.toList()));
result.setPublicationDate(input.getPublicationDate());
result.setRelationship(ScholixRelationship.fromScholixIndexRelationship(input.getRelationship()));
result.setSource(ScholixItem.fromScholixResource(input.getSource()));
result.setTarget(ScholixItem.fromScholixResource(input.getTarget()));
return result;
}
}

View File

@ -0,0 +1,125 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.util.Objects;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Link provider type.
*/
public class LinkProviderType {
@NotBlank
@JsonProperty("name")
private String name = null;
@NotBlank
@JsonProperty("totalRelationships")
private Integer totalRelationships = null;
/**
* Name link provider type.
*
* @param name the name
* @return the link provider type
*/
public LinkProviderType name(String name) {
this.name = name;
return this;
}
/**
* Get name
*
* @return name name
*/
@Schema(description = "The Publisher Name")
@Size(max=300)
public String getName() {
return name;
}
/**
* Sets name.
*
* @param name the name
*/
public void setName(String name) {
this.name = name;
}
/**
* Total relationships link provider type.
*
* @param totalRelationships the total relationships
* @return the link provider type
*/
public LinkProviderType totalRelationships(Integer totalRelationships) {
this.totalRelationships = totalRelationships;
return this;
}
/**
* Get totalRelationships
*
* @return totalRelationships total relationships
*/
@Schema(description = "Total number of relationships that the publisher provides")
public Integer getTotalRelationships() {
return totalRelationships;
}
/**
* Sets total relationships.
*
* @param totalRelationships the total relationships
*/
public void setTotalRelationships(Integer totalRelationships) {
this.totalRelationships = totalRelationships;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LinkProviderType linkPublisher = (LinkProviderType) o;
return Objects.equals(this.name, linkPublisher.name) &&
Objects.equals(this.totalRelationships, linkPublisher.totalRelationships);
}
@Override
public int hashCode() {
return Objects.hash(name, totalRelationships);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LinkPublisher {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" totalRelationships: ").append(toIndentedString(totalRelationships)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,116 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The main class that show the page result from the method
* /l2/links
*/
public class PageResultType implements Serializable {
@NotBlank
@JsonProperty("currentPage")
@ApiModelProperty(position = 0)
private Integer currentPage = 0;
@NotBlank
@JsonProperty("totalLinks")
@ApiModelProperty(position = 1)
private Integer totalLinks= 0;
@NotBlank
@JsonProperty("totalPages")
@ApiModelProperty(position = 2)
private Integer totalPages = 0;
@NotBlank
@JsonProperty("result")
@ApiModelProperty(position = 3)
private List<ScholixType> result = new ArrayList<>();
/**
* Gets current page.
*
* @return the current page
*/
@Schema(description = "The Current page of the results")
public Integer getCurrentPage() {
return currentPage;
}
/**
* Sets current page.
*
* @param currentPage the current page
*/
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
/**
* Gets total links.
*
* @return the total links
*/
@Schema(description = "The total number of Links found by the query")
public Integer getTotalLinks() {
return totalLinks;
}
/**
* Sets total links.
*
* @param totalLinks the total links
*/
public void setTotalLinks(Integer totalLinks) {
this.totalLinks = totalLinks;
}
/**
* Gets total pages.
*
* @return the total pages
*/
@Schema(description = "The Total number of pages")
public Integer getTotalPages() {
return totalPages;
}
/**
* Sets total pages.
*
* @param totalPages the total pages
*/
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
/**
* Gets result.
*
* @return the result
*/
@Schema(description = "The First page of Scholix results")
public List<ScholixType> getResult() {
return result;
}
/**
* Sets result.
*
* @param result the result
*/
public void setResult(List<ScholixType> result) {
this.result = result;
}
}

View File

@ -0,0 +1,109 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixRelationship;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Relationship type.
*/
public class RelationshipType {
@NotNull
@JsonProperty("Name")
private String name;
@JsonProperty("SubType")
private String subType;
@JsonProperty("SubTypeSchema")
private String subTypeSchema;
public static Map<String, String> relationMapping = Stream.of(new String[][] {
{ "issupplementto", "IsSupplementTo" },
{ "issupplementedby", "IsSupplementedBy" },
{ "references", "References" },
{ "isreferencedby", "IsReferencedBy" },
}).collect(Collectors.toMap(data -> data[0], data -> data[1]));
/**
* Gets The relationship type chosen from a Scholix controlled vocabulary
*
* @return the name
*/
@Schema(description = "The relationship type chosen from a Scholix controlled vocabulary")
public String getName() {
return name;
}
/**
* Sets The relationship type chosen from a Scholix controlled vocabulary
*
* @param name the name
* @return the RelationshipType instance
*/
public RelationshipType setName(String name) {
this.name = name;
return this;
}
/**
* Gets The sub-type of RelationshipType.Name
*
* @return the sub type
*/
@Schema(description = "The sub-type of RelationshipType.Name")
public String getSubType() {
return subType;
}
/**
* Sets The sub-type of RelationshipType.Name
*
* @param subType the sub type
* @return the RelationshipType instance
*/
public RelationshipType setSubType(String subType) {
this.subType = subType;
return this;
}
/**
* Gets The name of the schema or controlled list from which RelationshipSub-type is sourced.
*
* @return the sub type schema
*/
@Schema(description = "The name of the schema or controlled list from which RelationshipSub-type is sourced")
public String getSubTypeSchema() {
return subTypeSchema;
}
/**
* Sets The name of the schema or controlled list from which RelationshipSub-type is sourced.
*
* @param subTypeSchema the sub type schema
* @return the RelationshipType instance
*/
public RelationshipType setSubTypeSchema(String subTypeSchema) {
this.subTypeSchema = subTypeSchema;
return this;
}
public static RelationshipType fromScholixRelationship(ScholixRelationship inputRels) {
return new RelationshipType()
.setName(relationMapping.getOrDefault(inputRels.getName(), "IsRelatedTo"))
.setSubType(inputRels.getName())
.setSubTypeSchema(inputRels.getSchema());
}
}

View File

@ -0,0 +1,88 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixEntityId;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Scholix creator type.
*/
public class ScholixCreatorType {
@NotBlank
@JsonProperty("name")
private String name = null;
@NotBlank
@JsonProperty("identifier")
private List<ScholixIdentifierType> identifier = new ArrayList<>();
/**
* Gets A List of unique string that identifies the creator
*
* @return the identifier
*/
@Schema(description = "A List of unique string that identifies the creator")
public List<ScholixIdentifierType> getIdentifier() {
return identifier;
}
/**
* Sets A List of unique string that identifies the creator
*
* @param identifier the identifier
* @return the identifier
*/
public ScholixCreatorType setIdentifier(List<ScholixIdentifierType> identifier) {
this.identifier = identifier;
return this;
}
/**
* Gets The name of the Object Creator
*
* @return the name
*/
@Schema(description = "The name of the Object Creator")
public String getName() {
return name;
}
/**
* Sets The name of the Object Creator
*
* @param name the name
* @return the name
*/
public ScholixCreatorType setName(String name) {
this.name = name;
return this;
}
public static ScholixCreatorType fromScholixEntityId(final ScholixEntityId inputCreator) {
if (inputCreator == null)
return null;
ScholixCreatorType instance = new ScholixCreatorType().setName(inputCreator.getName());
if (inputCreator.getIdentifiers()!= null && inputCreator.getIdentifiers().size()>0)
instance.setIdentifier(inputCreator.getIdentifiers()
.stream()
.map(i ->new ScholixIdentifierType()
.setId(i.getIdentifier())
.setIdScheme(i.getSchema()))
.collect(Collectors.toList()));
return instance;
}
}

View File

@ -0,0 +1,105 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixIdentifier;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Scholix identifier type.
*/
public class ScholixIdentifierType {
@NotBlank
@JsonProperty("ID")
private String id = null;
@NotBlank
@JsonProperty("IDScheme")
private String idScheme = null;
@NotBlank
@JsonProperty("IDURL")
private String idURL = null;
/**
* Gets The identifier
*
* @return the id
*/
@Schema(description = "The identifier")
public String getId() {
return id;
}
/**
* Sets The identifier
*
* @param id the id
* @return the id
*/
public ScholixIdentifierType setId(String id) {
this.id = id;
return this;
}
/**
* Gets The scheme or namespace of the identifier string
*
* @return the id scheme
*/
@Schema(description = "The scheme or namespace of the identifier string")
public String getIdScheme() {
return idScheme;
}
/**
* Sets The scheme or namespace of the identifier string
*
* @param idScheme the id scheme
* @return the id scheme
*/
public ScholixIdentifierType setIdScheme(String idScheme) {
this.idScheme = idScheme;
return this;
}
/**
* Gets An internet resolvable form of the identifier
*
* @return the id url
*/
@Schema(description = "An internet resolvable form of the identifier")
public String getIdURL() {
return idURL;
}
/**
* Sets An internet resolvable form of the identifier
*
* @param idURL the id url
* @return the id url
*/
public ScholixIdentifierType setIdURL(String idURL) {
this.idURL = idURL;
return this;
}
public static ScholixIdentifierType fromScholixIdentifier(ScholixIdentifier input) {
if (input== null)
return null;
final ScholixIdentifierType instance = new ScholixIdentifierType();
instance.setId(input.getIdentifier());
instance.setIdScheme(input.getSchema());
instance.setIdURL(input.getUrl());
return instance;
}
}

View File

@ -0,0 +1,189 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixResource;
/**
* The type Scholix item type.
*/
public class ScholixItemType {
@JsonProperty("Identifier")
private List<ScholixIdentifierType> identifier = new ArrayList();
@JsonProperty("Title")
private String title;
@JsonProperty("Type")
private String type;
@JsonProperty("Creator")
private List<ScholixCreatorType> creator = new ArrayList<>();
@JsonProperty("PublicationDate")
private String publicationDate;
@JsonProperty("Publisher")
private List<ScholixLinkProviderType> publisher = new ArrayList<>();
/**
* Gets identifier.
*
* @return the identifier
*/
public List<ScholixIdentifierType> getIdentifier() {
return identifier;
}
/**
* Sets identifier.
*
* @param identifier the identifier
* @return the identifier
*/
public ScholixItemType setIdentifier(List<ScholixIdentifierType> identifier) {
this.identifier = identifier;
return this;
}
/**
* Gets title.
*
* @return the title
*/
public String getTitle() {
return title;
}
/**
* Sets title.
*
* @param title the title
* @return the title
*/
public ScholixItemType setTitle(String title) {
this.title = title;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public ScholixItemType setType(String type) {
this.type = type;
return this;
}
/**
* Gets creator.
*
* @return the creator
*/
public List<ScholixCreatorType> getCreator() {
return creator;
}
/**
* Sets creator.
*
* @param creator the creator
* @return the creator
*/
public ScholixItemType setCreator(List<ScholixCreatorType> creator) {
this.creator = creator;
return this;
}
/**
* Gets publication date.
*
* @return the publication date
*/
public String getPublicationDate() {
return publicationDate;
}
/**
* Sets publication date.
*
* @param publicationDate the publication date
* @return the publication date
*/
public ScholixItemType setPublicationDate(String publicationDate) {
this.publicationDate = publicationDate;
return this;
}
/**
* Gets publisher.
*
* @return the publisher
*/
public List<ScholixLinkProviderType> getPublisher() {
return publisher;
}
/**
* Sets publisher.
*
* @param publisher the publisher
* @return the publisher
*/
public ScholixItemType setPublisher(List<ScholixLinkProviderType> publisher) {
this.publisher = publisher;
return this;
}
public static ScholixItemType fromScholixResource(final ScholixResource input) {
if (input == null)
return null;
final ScholixItemType instance = new ScholixItemType();
instance.setType("publication".equalsIgnoreCase(input.getObjectType())?"literature": "dataset");
instance.setTitle(input.getTitle());
if (input.getIdentifier()!= null)
instance.setIdentifier(input.getIdentifier()
.stream()
.map(ScholixIdentifierType::fromScholixIdentifier )
.collect(Collectors.toList())
);
if (input.getPublisher()!= null) {
instance.setPublisher(
input.getPublisher().stream()
.map(ScholixLinkProviderType::fromScholixEntityId)
.collect(Collectors.toList())
);
}
instance.setPublicationDate(input.getPublicationDate());
if(input.getCreator()!=null)
instance.setCreator(input.getCreator()
.stream()
.map(ScholixCreatorType::fromScholixEntityId)
.collect(Collectors.toList()));
return instance;
}
}

View File

@ -0,0 +1,88 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixEntityId;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Scholix link provider type.
*/
public class ScholixLinkProviderType {
@NotBlank
@JsonProperty("name")
private String name = null;
@NotBlank
@JsonProperty("identifier")
private List<ScholixIdentifierType> identifier = new ArrayList<>();
/**
* Gets A List of unique string that identifies the object
*
* @return the identifier
*/
@Schema(description = "A List of unique string that identifies the object")
public List<ScholixIdentifierType> getIdentifier() {
return identifier;
}
/**
* Sets A List of unique string that identifies the object
*
* @param identifier the identifier
* @return the identifier
*/
public ScholixLinkProviderType setIdentifier(List<ScholixIdentifierType> identifier) {
this.identifier = identifier;
return this;
}
/**
* Gets The name of the Provider
*
* @return the name
*/
@Schema(description = "The name of the Provider")
public String getName() {
return name;
}
/**
* Sets The name of the Provider
*
* @param name the name
* @return the name
*/
public ScholixLinkProviderType setName(String name) {
this.name = name;
return this;
}
public static ScholixLinkProviderType fromScholixEntityId(final ScholixEntityId provider) {
if (provider == null)
return null;
ScholixLinkProviderType instance = new ScholixLinkProviderType().setName(provider.getName());
if (provider.getIdentifiers()!= null && provider.getIdentifiers().size()>0)
instance.setIdentifier(provider.getIdentifiers()
.stream()
.map(i ->new ScholixIdentifierType()
.setId(i.getIdentifier())
.setIdScheme(i.getSchema()))
.collect(Collectors.toList()));
return instance;
}
}

View File

@ -0,0 +1,199 @@
package eu.dnetlib.dhp.schema.sx.api.model.v2;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.scholix.Scholix;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Scholix type.
*/
public class ScholixType implements Serializable {
@NotBlank
@JsonProperty("RelationshipType")
private RelationshipType relationshipType ;
@NotBlank
@JsonProperty("source")
private ScholixItemType source ;
@NotBlank
@JsonProperty("target")
private ScholixItemType target ;
@JsonProperty("HarvestDate")
private String harvestDate ;
@JsonProperty("LicenseURL")
private String licenseURL ;
@JsonProperty("LinkProvider")
private List<ScholixLinkProviderType> linkProvider ;
@JsonProperty("LinkPublicationDate")
private String linkPublicationDate ;
/**
* Gets the nature of the relationship between the source object and target object in this Link Information Package
*
* @return the relationship type
*/
@Schema(description = "The nature of the relationship between the source object and target object in this Link Information Package")
public RelationshipType getRelationshipType() {
return relationshipType;
}
/**
* Sets relationship type.
*
* @param relationshipType the relationship type
*/
public void setRelationshipType(RelationshipType relationshipType) {
this.relationshipType = relationshipType;
}
/**
* Gets Root element relative to all properties describing the links source object
*
* @return the source
*/
@Schema(description = "Root element relative to all properties describing the links source object")
public ScholixItemType getSource() {
return source;
}
/**
* Sets source.
*
* @param source the source
*/
public void setSource(ScholixItemType source) {
this.source = source;
}
/**
* Gets Root element relative to all properties describing the links target object
*
* @return the target
*/
@Schema(description = "Gets Root element relative to all properties describing the links target object")
public ScholixItemType getTarget() {
return target;
}
/**
* Sets target.
*
* @param target the target
*/
public void setTarget(ScholixItemType target) {
this.target = target;
}
/**
* Gets harvest date.
*
* @return the harvest date
*/
public String getHarvestDate() {
return harvestDate;
}
/**
* Sets harvest date.
*
* @param harvestDate the harvest date
*/
public void setHarvestDate(String harvestDate) {
this.harvestDate = harvestDate;
}
/**
* Gets The URL of the license for the Scholix Link Information Package
*
* @return the license url
*/
@Schema(description = "The URL of the license for the Scholix Link Information Package")
public String getLicenseURL() {
return licenseURL;
}
/**
* Sets license url.
*
* @param licenseURL the license url
*/
public void setLicenseURL(String licenseURL) {
this.licenseURL = licenseURL;
}
/**
* Gets The source(s) of this Link Information Package.
*
* @return the link provider
*/
@Schema(description = "The source(s) of this Link Information Package")
public List<ScholixLinkProviderType> getLinkProvider() {
return linkProvider;
}
/**
* Sets link provider.
*
* @param linkProvider the link provider
*/
public void setLinkProvider(List<ScholixLinkProviderType> linkProvider) {
this.linkProvider = linkProvider;
}
/**
* Gets Date when this Link Information Package was first formally issued from this current Provider
*
* @return the link publication date
*/
@Schema(description = "Date when this Link Information Package was first formally issued from this current Provider")
public String getLinkPublicationDate() {
return linkPublicationDate;
}
/**
* Sets link publication date.
*
* @param linkPublicationDate the link publication date
*/
public void setLinkPublicationDate(String linkPublicationDate) {
this.linkPublicationDate = linkPublicationDate;
}
public static ScholixType fromScholix(Scholix input) {
final ScholixType instance = new ScholixType();
instance.setLinkPublicationDate(input.getPublicationDate());
instance.setHarvestDate(input.getPublicationDate());
instance.setRelationshipType(RelationshipType.fromScholixRelationship(input.getRelationship()));
if(input.getLinkprovider()!= null && input.getLinkprovider().size()>0)
instance.setLinkProvider(input.getLinkprovider()
.stream()
.map(ScholixLinkProviderType::fromScholixEntityId)
.collect(Collectors.toList())
);
instance.setSource(ScholixItemType.fromScholixResource(input.getSource()));
instance.setTarget(ScholixItemType.fromScholixResource(input.getTarget()));
return instance;
}
}

View File

@ -0,0 +1,216 @@
package eu.dnetlib.dhp.schema.sx.api.model.v3;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.api.model.v2.ScholixCreatorType;
import eu.dnetlib.dhp.schema.sx.api.model.v2.ScholixIdentifierType;
import eu.dnetlib.dhp.schema.sx.api.model.v2.ScholixLinkProviderType;
import eu.dnetlib.dhp.schema.sx.scholix.ScholixResource;
/**
* The type Scholix item type.
*/
public class ScholixItemType {
@JsonProperty("Identifier")
private List<ScholixIdentifierType> identifier = new ArrayList();
@JsonProperty("Title")
private String title;
@JsonProperty("Type")
private String type;
@JsonProperty("subType")
private String subType;
@JsonProperty("Creator")
private List<ScholixCreatorType> creator = new ArrayList<>();
@JsonProperty("PublicationDate")
private String publicationDate;
@JsonProperty("Publisher")
private List<ScholixLinkProviderType> publisher = new ArrayList<>();
/**
* Gets identifier.
*
* @return the identifier
*/
public List<ScholixIdentifierType> getIdentifier() {
return identifier;
}
/**
* Sets identifier.
*
* @param identifier the identifier
* @return the identifier
*/
public ScholixItemType setIdentifier(List<ScholixIdentifierType> identifier) {
this.identifier = identifier;
return this;
}
/**
* Gets title.
*
* @return the title
*/
public String getTitle() {
return title;
}
/**
* Sets title.
*
* @param title the title
* @return the title
*/
public ScholixItemType setTitle(String title) {
this.title = title;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getSubType() {
return subType;
}
/**
* Sets sub Type.
*
* @param subType the subType
* @return the title
*/
public ScholixItemType setSubType(String subType) {
this.subType = subType;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public ScholixItemType setType(String type) {
this.type = type;
return this;
}
/**
* Gets creator.
*
* @return the creator
*/
public List<ScholixCreatorType> getCreator() {
return creator;
}
/**
* Sets creator.
*
* @param creator the creator
* @return the creator
*/
public ScholixItemType setCreator(List<ScholixCreatorType> creator) {
this.creator = creator;
return this;
}
/**
* Gets publication date.
*
* @return the publication date
*/
public String getPublicationDate() {
return publicationDate;
}
/**
* Sets publication date.
*
* @param publicationDate the publication date
* @return the publication date
*/
public ScholixItemType setPublicationDate(String publicationDate) {
this.publicationDate = publicationDate;
return this;
}
/**
* Gets publisher.
*
* @return the publisher
*/
public List<ScholixLinkProviderType> getPublisher() {
return publisher;
}
/**
* Sets publisher.
*
* @param publisher the publisher
* @return the publisher
*/
public ScholixItemType setPublisher(List<ScholixLinkProviderType> publisher) {
this.publisher = publisher;
return this;
}
public static ScholixItemType fromScholixResource(final ScholixResource input) {
if (input == null)
return null;
final ScholixItemType instance = new ScholixItemType();
instance.setType("publication".equalsIgnoreCase(input.getObjectType())?"literature": "dataset");
instance.setTitle(input.getTitle());
if (input.getIdentifier()!= null)
instance.setIdentifier(input.getIdentifier()
.stream()
.map(ScholixIdentifierType::fromScholixIdentifier )
.collect(Collectors.toList())
);
if (input.getPublisher()!= null) {
instance.setPublisher(
input.getPublisher().stream()
.map(ScholixLinkProviderType::fromScholixEntityId)
.collect(Collectors.toList())
);
}
instance.setPublicationDate(input.getPublicationDate());
if(input.getCreator()!=null)
instance.setCreator(input.getCreator()
.stream()
.map(ScholixCreatorType::fromScholixEntityId)
.collect(Collectors.toList()));
return instance;
}
}

View File

@ -0,0 +1,201 @@
package eu.dnetlib.dhp.schema.sx.api.model.v3;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.NotBlank;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.sx.api.model.v2.RelationshipType;
import eu.dnetlib.dhp.schema.sx.api.model.v2.ScholixLinkProviderType;
import eu.dnetlib.dhp.schema.sx.scholix.Scholix;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* The type Scholix type.
*/
public class ScholixType implements Serializable {
@NotBlank
@JsonProperty("RelationshipType")
private RelationshipType relationshipType ;
@NotBlank
@JsonProperty("source")
private ScholixItemType source ;
@NotBlank
@JsonProperty("target")
private ScholixItemType target ;
@JsonProperty("HarvestDate")
private String harvestDate ;
@JsonProperty("LicenseURL")
private String licenseURL ;
@JsonProperty("LinkProvider")
private List<ScholixLinkProviderType> linkProvider ;
@JsonProperty("LinkPublicationDate")
private String linkPublicationDate ;
/**
* Gets the nature of the relationship between the source object and target object in this Link Information Package
*
* @return the relationship type
*/
@Schema(description = "The nature of the relationship between the source object and target object in this Link Information Package")
public RelationshipType getRelationshipType() {
return relationshipType;
}
/**
* Sets relationship type.
*
* @param relationshipType the relationship type
*/
public void setRelationshipType(RelationshipType relationshipType) {
this.relationshipType = relationshipType;
}
/**
* Gets Root element relative to all properties describing the links source object
*
* @return the source
*/
@Schema(description = "Root element relative to all properties describing the links source object")
public ScholixItemType getSource() {
return source;
}
/**
* Sets source.
*
* @param source the source
*/
public void setSource(ScholixItemType source) {
this.source = source;
}
/**
* Gets Root element relative to all properties describing the links target object
*
* @return the target
*/
@Schema(description = "Gets Root element relative to all properties describing the links target object")
public ScholixItemType getTarget() {
return target;
}
/**
* Sets target.
*
* @param target the target
*/
public void setTarget(ScholixItemType target) {
this.target = target;
}
/**
* Gets harvest date.
*
* @return the harvest date
*/
public String getHarvestDate() {
return harvestDate;
}
/**
* Sets harvest date.
*
* @param harvestDate the harvest date
*/
public void setHarvestDate(String harvestDate) {
this.harvestDate = harvestDate;
}
/**
* Gets The URL of the license for the Scholix Link Information Package
*
* @return the license url
*/
@Schema(description = "The URL of the license for the Scholix Link Information Package")
public String getLicenseURL() {
return licenseURL;
}
/**
* Sets license url.
*
* @param licenseURL the license url
*/
public void setLicenseURL(String licenseURL) {
this.licenseURL = licenseURL;
}
/**
* Gets The source(s) of this Link Information Package.
*
* @return the link provider
*/
@Schema(description = "The source(s) of this Link Information Package")
public List<ScholixLinkProviderType> getLinkProvider() {
return linkProvider;
}
/**
* Sets link provider.
*
* @param linkProvider the link provider
*/
public void setLinkProvider(List<ScholixLinkProviderType> linkProvider) {
this.linkProvider = linkProvider;
}
/**
* Gets Date when this Link Information Package was first formally issued from this current Provider
*
* @return the link publication date
*/
@Schema(description = "Date when this Link Information Package was first formally issued from this current Provider")
public String getLinkPublicationDate() {
return linkPublicationDate;
}
/**
* Sets link publication date.
*
* @param linkPublicationDate the link publication date
*/
public void setLinkPublicationDate(String linkPublicationDate) {
this.linkPublicationDate = linkPublicationDate;
}
public static ScholixType fromScholix(Scholix input) {
final ScholixType instance = new ScholixType();
instance.setLinkPublicationDate(input.getPublicationDate());
instance.setHarvestDate(input.getPublicationDate());
instance.setRelationshipType(RelationshipType.fromScholixRelationship(input.getRelationship()));
if(input.getLinkprovider()!= null && input.getLinkprovider().size()>0)
instance.setLinkProvider(input.getLinkprovider()
.stream()
.map(ScholixLinkProviderType::fromScholixEntityId)
.collect(Collectors.toList())
);
instance.setSource(ScholixItemType.fromScholixResource(input.getSource()));
instance.setTarget(ScholixItemType.fromScholixResource(input.getTarget()));
return instance;
}
}

View File

@ -1,10 +1,17 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import static eu.dnetlib.dhp.schema.sx.scholix.ScholixComparator.*;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
public class Scholix implements Serializable, Comparable<Scholix> {
public class Scholix implements Serializable {
private String publicationDate;
private List<ScholixEntityId> publisher;
@ -74,4 +81,54 @@ public class Scholix implements Serializable {
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Scholix)) return false;
Scholix scholix = (Scholix) o;
return compareTo(scholix) == 0;
}
@Override
public int hashCode() {
final int publisherHash = publisher == null ? 0: publisher.stream().sorted().collect(Collectors.toList()).hashCode();
final int linkProviderHash = linkprovider == null ? 0: linkprovider.stream().sorted().collect(Collectors.toList()).hashCode();
return Objects.hash(normalizeString(publicationDate),publisherHash, linkProviderHash, relationship, source, target, normalizeIdnetifier(identifier));
}
@Override
public int compareTo(Scholix other) {
if (other == null)
return -1;
// Comparing publication date
final int publicationDateCompare =StringUtils.compare(publicationDate, other.getPublicationDate());
if (publicationDateCompare != 0)
return publicationDateCompare;
final int linkPublisherComparator = compareList(publisher, other.getPublisher());
if (linkPublisherComparator!= 0)
return linkPublisherComparator;
final int linkProviderComparator = compareList(linkprovider, other.getLinkprovider());
if (linkProviderComparator!= 0)
return linkProviderComparator;
final int relsComparator = compareObjects(relationship, other.getRelationship());
if (relsComparator!= 0)
return relsComparator;
final int sourceComparator = compareObjects(source, other.getSource());
if (sourceComparator!= 0)
return sourceComparator;
return compareObjects(target, other.getTarget());
}
}

View File

@ -1,9 +1,14 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import java.io.Serializable;
import static eu.dnetlib.dhp.schema.sx.scholix.ScholixComparator.*;
public class ScholixCollectedFrom implements Serializable {
import java.io.Serializable;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
public class ScholixCollectedFrom implements Serializable, Comparable<ScholixCollectedFrom> {
private ScholixEntityId provider;
private String provisionMode;
@ -42,4 +47,42 @@ public class ScholixCollectedFrom implements Serializable {
public void setCompletionStatus(String completionStatus) {
this.completionStatus = completionStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ScholixCollectedFrom)) return false;
ScholixCollectedFrom that = (ScholixCollectedFrom) o;
return compareTo(that)==0;
}
@Override
public int hashCode() {
return Objects.hash(provider, normalizeString(provisionMode), normalizeString(completionStatus));
}
@Override
public int compareTo(ScholixCollectedFrom other) {
if (other == null)
return -1;
int provModeCompare = StringUtils.compare(normalizeString(provisionMode),normalizeString(other.getProvisionMode()) );
int compStatusCompare =StringUtils.compare(normalizeString(completionStatus),normalizeString(other.getCompletionStatus()) );
if (provider == null && other.getProvider() == null)
return provModeCompare == 0 ? compStatusCompare: provModeCompare;
if (provider == null)
return 1;
if (other.getProvider() == null)
return -1;
int provCompare = provider.compareTo(other.getProvider());
if (provCompare == 0)
return provModeCompare == 0 ? compStatusCompare: provModeCompare;
return provCompare;
}
}

View File

@ -0,0 +1,59 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import java.text.Normalizer;
import java.util.List;
import java.util.stream.Stream;
import com.google.common.collect.Iterators;
import me.xuender.unidecode.Unidecode;
public class ScholixComparator {
public static String normalizeIdnetifier(final String input) {
if (input == null)
return null;
return Normalizer.normalize(input, Normalizer.Form.NFD)
.toLowerCase();
}
public static String normalizeString(final String input) {
if (input == null)
return null;
return Unidecode.decode(input).toLowerCase();
}
public static <T extends Comparable<T>> int compareObjects (T left, T right) {
if (left == null && right==null)
return 0;
if(left == null)
return 1;
if (right == null)
return -1;
return left.compareTo(right);
}
public static <T extends Comparable<T>> int compareList (List<T> left, List<T> right) {
if (left == null && right==null)
return 0;
if(left == null)
return 1;
if (right == null)
return -1;
Stream<T> sortedLeft = left.stream().sorted();
Stream<T> sortedRight = right.stream().sorted();
boolean equals = Iterators.elementsEqual(sortedLeft.iterator(), sortedRight.iterator());
return equals? 0: -1;
}
}

View File

@ -1,10 +1,19 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import static eu.dnetlib.dhp.schema.sx.scholix.ScholixComparator.normalizeString;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ScholixEntityId implements Serializable {
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Iterators;
public class ScholixEntityId implements Serializable, Comparable<ScholixEntityId> {
private String name;
private List<ScholixIdentifier> identifiers;
@ -31,4 +40,31 @@ public class ScholixEntityId implements Serializable {
public void setIdentifiers(List<ScholixIdentifier> identifiers) {
this.identifiers = identifiers;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ScholixEntityId that = (ScholixEntityId) o;
return compareTo(that)==0;
}
@Override
public int hashCode() {
if (identifiers != null)
return Objects.hash(normalizeString(name), identifiers.stream().sorted().collect(Collectors.toList()));
else
return Objects.hash(normalizeString(name));
}
@Override
public int compareTo(ScholixEntityId other) {
if (other == null)
return -1;
final int nameComp = StringUtils.compare(normalizeString(name), normalizeString(other.getName()));
if (nameComp != 0)
return nameComp;
return ScholixComparator.compareList(identifiers,other.getIdentifiers());
}
}

View File

@ -1,17 +1,34 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import static eu.dnetlib.dhp.schema.sx.scholix.ScholixComparator.normalizeIdnetifier;
import java.io.Serializable;
import java.util.Objects;
public class ScholixIdentifier implements Serializable {
import org.apache.commons.lang3.StringUtils;
/**
* The type Scholix identifier.
*/
public class ScholixIdentifier implements Serializable, Comparable<ScholixIdentifier> {
private String identifier;
private String schema;
private String url;
/**
* Instantiates a new Scholix identifier.
*/
public ScholixIdentifier() {
}
/**
* Instantiates a new Scholix identifier.
*
* @param identifier the identifier
* @param schema the schema
* @param url the url
*/
public ScholixIdentifier(String identifier, String schema, String url) {
this.identifier = identifier;
this.schema = schema;
@ -19,41 +36,87 @@ public class ScholixIdentifier implements Serializable {
}
/**
* Gets url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets url.
*
* @param url the url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets identifier.
*
* @return the identifier
*/
public String getIdentifier() {
return identifier;
}
/**
* Sets identifier.
*
* @param identifier the identifier
*/
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* Gets schema.
*
* @return the schema
*/
public String getSchema() {
return schema;
}
/**
* Sets schema.
*
* @param schema the schema
*/
public void setSchema(String schema) {
this.schema = schema;
}
@Override
public int compareTo(ScholixIdentifier other) {
if (other == null)
return -1;
final int idComp = StringUtils.compare(normalizeIdnetifier(identifier), normalizeIdnetifier(other.getIdentifier()));
if (idComp !=0)
return idComp;
final int schemaComp = StringUtils.compare(normalizeIdnetifier(schema), normalizeIdnetifier(other.getSchema()));
if (schemaComp !=0)
return schemaComp;
return StringUtils.compare(normalizeIdnetifier(url), normalizeIdnetifier(other.getUrl()));
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ScholixIdentifier that = (ScholixIdentifier) o;
return identifier.equals(that.identifier) && schema.equals(that.schema);
return compareTo(that) == 0;
}
@Override
public int hashCode() {
return Objects.hash(identifier, schema);
return Objects.hash(normalizeIdnetifier(identifier), normalizeIdnetifier(schema), normalizeIdnetifier(url));
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
}

View File

@ -1,9 +1,14 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import java.io.Serializable;
import static eu.dnetlib.dhp.schema.sx.scholix.ScholixComparator.*;
public class ScholixRelationship implements Serializable {
import java.io.Serializable;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
public class ScholixRelationship implements Serializable, Comparable<ScholixRelationship> {
private String name;
private String schema;
private String inverse;
@ -40,4 +45,34 @@ public class ScholixRelationship implements Serializable {
public void setInverse(String inverse) {
this.inverse = inverse;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ScholixRelationship)) return false;
ScholixRelationship that = (ScholixRelationship) o;
return this.compareTo(that) ==0;
}
@Override
public int hashCode() {
return Objects.hash(normalizeString(getName()), normalizeString(getSchema()), normalizeString(getInverse()));
}
@Override
public int compareTo(ScholixRelationship other) {
if (other == null)
return -1;
final int nameCompare = StringUtils.compare(normalizeString(name), normalizeString(other.getName()));
if (nameCompare!= 0 )
return nameCompare;
final int schemaCompare = StringUtils.compare(normalizeString(schema), normalizeString(other.getSchema()));
if (schemaCompare!= 0 )
return schemaCompare;
return StringUtils.compare(normalizeString(inverse), normalizeString(other.getInverse()));
}
}

View File

@ -1,10 +1,16 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import static eu.dnetlib.dhp.schema.sx.scholix.ScholixComparator.*;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
public class ScholixResource implements Serializable {
import org.apache.commons.lang3.StringUtils;
public class ScholixResource implements Serializable, Comparable<ScholixResource> {
private List<ScholixIdentifier> identifier;
private String dnetIdentifier;
@ -87,4 +93,71 @@ public class ScholixResource implements Serializable {
public void setCollectedFrom(List<ScholixCollectedFrom> collectedFrom) {
this.collectedFrom = collectedFrom;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ScholixResource)) return false;
ScholixResource that = (ScholixResource) o;
return compareTo(that) == 0;
}
@Override
public int hashCode() {
int idHash = identifier == null ? 0 : identifier.stream().sorted().collect(Collectors.toList()).hashCode();
int creatorHash = creator == null ? 0 : creator.stream().sorted().collect(Collectors.toList()).hashCode();
int publisherHash = publisher == null ? 0 : publisher.stream().sorted().collect(Collectors.toList()).hashCode();
int collectedFromHash = collectedFrom == null ? 0 : collectedFrom.stream().sorted().collect(Collectors.toList()).hashCode();
return Objects.hash(idHash, normalizeIdnetifier(dnetIdentifier), normalizeString(objectType),
normalizeString(objectSubType), normalizeString(title),creatorHash, normalizeString(publicationDate), publisherHash, collectedFromHash);
}
@Override
public int compareTo(ScholixResource other) {
if (other == null)
return -1;
final int compIdentifiers = compareList(identifier, other.getIdentifier());
if (compIdentifiers!= 0)
return compIdentifiers;
final int dnetIdComp = StringUtils.compare(dnetIdentifier, other.getDnetIdentifier());
if (dnetIdComp != 0)
return dnetIdComp;
final int objTypeComparator = StringUtils.compare(normalizeString(objectType), normalizeString(other.getObjectType()));
if (objTypeComparator != 0)
return objTypeComparator;
final int objSubTypeComparator = StringUtils.compare(normalizeString(objectSubType), normalizeString(other.getObjectSubType()));
if (objSubTypeComparator != 0)
return objSubTypeComparator;
final int titleComparator = StringUtils.compare(normalizeString(title), normalizeString(other.getTitle()));
if (titleComparator != 0)
return titleComparator;
final int creatorComparator = compareList(creator, other.getCreator());
if (creatorComparator!= 0)
return creatorComparator;
final int pubDateComparator = StringUtils.compare(normalizeString(publicationDate), normalizeString(other.getPublicationDate()));
if (pubDateComparator!= 0)
return pubDateComparator;
final int publisherComparator = compareList(publisher, other.getPublisher());
if (publisherComparator!= 0)
return publisherComparator;
return compareList(collectedFrom, other.getCollectedFrom());
}
}

View File

@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"acronym": {
"type": "string",
"description": "The acronym of the community"
},
"description": {
"type": "string",
"description": "Description of the research community/research infrastructure"
},
"id": {
"type": "string",
"description": "OpenAIRE id of the research community/research infrastructure"
},
"name": {
"type": "string",
"description": "The long name of the community"
},
"subject": {
"description": "Only for research communities: the list of the subjects associated to the research community",
"type": "array",
"items": {"type": "string"}
},
"type": {
"type": "string",
"description": "One of {Research Community, Research infrastructure}"
},
"zenodo_community": {
"type": "string",
"description": "The URL of the Zenodo community associated to the Research community/Research infrastructure"
}
}
}

View File

@ -0,0 +1,192 @@
{
"$schema":"http://json-schema.org/draft-07/schema#",
"definitions": {
"ControlledField": {
"type": "object",
"properties": {
"scheme": {
"type": "string"
},
"value": {
"type": "string"
}
},
"description": "To represent the information described by a scheme and a value in that scheme (i.e. pid)"
}
},
"type":"object",
"properties": {
"accessrights": {
"type": "string",
"description": "Type of access to the data source, as defined by re3data.org. Possible values: {open, restricted, closed}"
},
"certificates": {
"type": "string",
"description": "The certificate, seal or standard the data source complies with. As defined by re3data.org."
},
"citationguidelineurl": {
"type": "string",
"description":"The URL of the data source providing information on how to cite its items. As defined by re3data.org."
},
"contenttypes": {
"description": "Types of content in the data source, as defined by OpenDOAR",
"type": "array",
"items": {
"type": "string"
}
},
"databaseaccessrestriction": {
"type": "string",
"description": "Access restrinctions to the data source, as defined by re3data.org. One of {feeRequired, registration, other}"
},
"datasourcetype": {
"allOf": [
{
"$ref": "#/definitions/ControlledField"
},
{
"description": "The type of the datasource. See https://api.openaire.eu/vocabularies/dnet:datasource_typologies"
}
]
},
"datauploadrestriction": {
"type": "string",
"description": "Upload restrictions applied by the datasource, as defined by re3data.org. One of {feeRequired, registration, other}"
},
"dateofvalidation": {
"type": "string",
"description": "The date of last validation against the OpenAIRE guidelines for the datasource records"
},
"description": {
"type": "string"
},
"englishname": {
"type": "string",
"description": "The English name of the datasource"
},
"id": {
"type": "string",
"description": "The OpenAIRE id of the data source"
},
"journal": {
"type": "object",
"properties": {
"conferencedate": {
"type": "string"
},
"conferenceplace": {
"type": "string"
},
"edition": {
"type": "string"
},
"ep": {
"type": "string",
"description": "End page"
},
"iss": {
"type": "string",
"description": "Issue number"
},
"issnLinking": {
"type": "string"
},
"issnOnline": {
"type": "string"
},
"issnPrinted": {
"type": "string"
},
"name": {
"type": "string"
},
"sp": {
"type": "string",
"description": "Start page"
},
"vol": {
"type": "string",
"description": "Volume"
}
},
"description": "Information about the journal, if this data source is of type Journal."
},
"languages": {
"description": "The languages present in the data source's content, as defined by OpenDOAR.",
"type": "array",
"items": {
"type": "string"
}
},
"logourl": {
"type": "string"
},
"missionstatementurl": {
"type": "string",
"description":"The URL of a mission statement describing the designated community of the data source. As defined by re3data.org"
},
"officialname": {
"type": "string",
"description": "The official name of the datasource"
},
"openairecompatibility": {
"type": "string",
"description": "OpenAIRE guidelines the data source comply with. See also https://guidelines.openaire.eu."
},
"originalId": {
"description": "Original identifiers for the datasource"
"type": "array",
"items": {
"type": "string"
}
},
"pid": {
"description": "Persistent identifiers of the datasource",
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/definitions/ControlledField"
}
]
}
},
"pidsystems": {
"type": "string",
"description": "The persistent identifier system that is used by the data source. As defined by re3data.org"
},
"policies": {
"description": "Policies of the data source, as defined in OpenDOAR.",
"type": "array",
"items": {
"type": "string"
}
},
"releaseenddate": {
"type": "string",
"description": "Date when the data source went offline or stopped ingesting new research data. As defined by re3data.org"
},
"releasestartdate": {
"type": "string",
"description": "Releasing date of the data source, as defined by re3data.org"
},
"subjects": {
"description": "List of subjects associated to the datasource",
"type": "array",
"items": {
"type": "string"
}
},
"uploadrights": {
"type": "string",
"description": "Type of data upload. As defined by re3data.org: one of {open, restricted,closed}"
},
"versioning": {
"type": "boolean",
"description": "As defined by redata.org: 'yes' if the data source supports versioning, 'no' otherwise."
},
"websiteurl": {
"type": "string"
}
}
}

View File

@ -0,0 +1,57 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"alternativenames": {
"description": "Alternative names that identify the organisation",
"type": "array",
"items": {
"type": "string"
}
},
"country": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "The organisation country code"
},
"label": {
"type": "string",
"description": "The organisation country label"
}
},
"description": "The country of the organisation"
},
"id": {
"type": "string",
"description": "The OpenAIRE id for the organisation"
},
"legalname": {
"type": "string"
},
"legalshortname": {
"type": "string"
},
"pid": {
"description": "Persistent identifiers for the organisation i.e. isni 0000000090326370",
"type": "array",
"items": {
"type": "object",
"properties": {
"scheme": {
"type": "string",
"description": "The scheme of the identifier (i.e. isni)"
},
"value": {
"type": "string",
"description": "the value in the schema (i.e. 0000000090326370)"
}
}
}
},
"websiteurl": {
"type": "string"
}
}
}

View File

@ -0,0 +1,119 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"acronym": {
"type": "string"
},
"callidentifier": {
"type": "string"
},
"code": {
"type": "string",
"description": "The grant agreement number"
},
"enddate": {
"type": "string"
},
"funding": {
"description": "Funding information for the project",
"type": "array",
"items": {
"type": "object",
"properties": {
"funding_stream": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Description of the funding stream"
},
"id": {
"type": "string",
"description": "Id of the funding stream"
}
}
},
"jurisdiction": {
"type": "string",
"description": "The jurisdiction of the funder (i.e. EU)"
},
"name": {
"type": "string",
"description": "The name of the funder (European Commission)"
},
"shortName": {
"type": "string",
"description": "The short name of the funder (EC)"
}
}
}
},
"granted": {
"type": "object",
"properties": {
"currency": {
"type": "string",
"description": "The currency of the granted amount (e.g. EUR)"
},
"fundedamount": {
"type": "number",
"description": "The funded amount"
},
"totalcost": {
"type": "number",
"description": "The total cost of the project"
}
},
"description": "The money granted to the project"
},
"h2020programme": {
"description": "The h2020 programme funding the project",
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "The code of the programme"
},
"description": {
"type": "string",
"description": "The description of the programme"
}
}
}
},
"id": {
"type": "string",
"description": "OpenAIRE id for the project"
},
"keywords": {
"type": "string"
},
"openaccessmandatefordataset": {
"type": "boolean"
},
"openaccessmandateforpublications": {
"type": "boolean"
},
"startdate": {
"type": "string"
},
"subject": {
"type": "array",
"items": {
"type": "string"
}
},
"summary": {
"type": "string"
},
"title": {
"type": "string"
},
"websiteurl": {
"type": "string"
}
}
}

View File

@ -0,0 +1,68 @@
{
"$schema":"http://json-schema.org/draft-07/schema#",
"definitions": {
"Node": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The OpenAIRE id of the entity"
},
"type": {
"type": "string",
"description": "The type of the entity (i.e. organisation)"
}
}
}
},
"type":"object",
"properties": {
"provenance": {
"type": "object",
"properties": {
"provenance": {
"type": "string",
"description": "The reason why OpenAIRE holds the relation "
},
"trust": {
"type": "string",
"description": "The trust of the relation in the range of [0,1]. Where greater the number, more the trust. Harvested relationships have typically a high trust (0.9). The trust of inferred relationship is calculated by the inference algorithm that generated them, as described in https://graph.openaire.eu/about#architecture (Enrichment --> Mining)"
}
}
},
"reltype": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The semantics of the relation (i.e. isAuthorInstitutionOf). "
},
"type": {
"type": "string",
"description": "the type of the relation (i.e. affiliation)"
}
},
"description": "To represent the semantics of a relation between two entities"
},
"source": {
"allOf": [
{"$ref": "#/definitions/Node"},
{"description": "The node source in the relation"}
]
},
"target": {
"allOf": [
{"$ref": "#/definitions/Node"},
{"description": "The node target in the relation"}
]
},
"validated":{
"type":"boolean",
"description":"True if the relation is related to a project and it has been collected from an authoritative source (i.e. the funder)"
},
"validationDate":{
"type":"string",
"description":"The date when the relation was collected from OpenAIRE"
}
}
}

View File

@ -0,0 +1,448 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ControlledField": {
"type": "object",
"properties": {
"scheme": {
"type": "string"
},
"value": {
"type": "string"
}
},
"description": "To represent the information described by a scheme and a value in that scheme (i.e. pid)"
},
"Provenance": {
"type": "object",
"properties": {
"provenance": {
"type": "string",
"description": "The process that produced/provided the information"
},
"trust": {
"type": "string"
}
},
"description": "Indicates the process that produced (or provided) the information, and the trust associated to the information"
}
},
"type": "object",
"properties": {
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fullname": {
"type": "string"
},
"name": {
"type": "string"
},
"pid": {
"type": "object",
"properties": {
"id": {
"allOf": [
{"$ref": "#/definitions/ControlledField"},
{"description": "The author's id and scheme. OpenAIRE currently supports 'ORCID'"}
]
},
"provenance": {
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Provenance of author's pid"}
]
}
}
},
"rank": {
"type": "integer"
},
"surname": {
"type": "string"
}
}
}
},
"bestaccessright":{
"type":"object",
"properties":{
"code": {
"type": "string",
"description": "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
},
"label": {
"type": "string",
"description": "Label for the access mode"
},
"scheme": {
"type": "string",
"description": "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
}
}
},
"codeRepositoryUrl": {
"type": "string",
"description": "Only for results with type 'software': the URL to the repository with the source code"
},
"contactgroup": {
"description": "Only for results with type 'software': Information on the group responsible for providing further information regarding the resource",
"type": "array",
"items": {
"type": "string"
}
},
"contactperson": {
"description": "Only for results with type 'software': Information on the person responsible for providing further information regarding the resource",
"type": "array",
"items": {
"type": "string"
}
},
"container": {
"type": "object",
"properties": {
"conferencedate": {
"type": "string"
},
"conferenceplace": {
"type": "string"
},
"edition": {
"type": "string",
"description": "Edition of the journal or conference proceeding"
},
"ep": {
"type": "string",
"description": "End page"
},
"iss": {
"type": "string",
"description": "Journal issue"
},
"issnLinking": {
"type": "string"
},
"issnOnline": {
"type": "string"
},
"issnPrinted": {
"type": "string"
},
"name": {
"type": "string",
"description": "Name of the journal or conference"
},
"sp": {
"type": "string",
"description": "start page"
},
"vol": {
"type": "string"
}
},
"description": "Container has information about the conference or journal where the result has been presented or published"
},
"contributor": {
"type": "array",
"items": {
"type": "string",
"description": "Contributors for the result"
}
},
"country": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code"
},
"label": {
"type": "string"
},
"provenance": {
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Why this result is associated to the country."}
]
}
}
}
},
"coverage": {
"type": "array",
"items": {
"type": "string"
}
},
"dateofcollection": {
"type": "string",
"description": "When OpenAIRE collected the record the last time"
},
"description": {
"type": "array",
"items": {
"type": "string"
}
},
"documentationUrl": {
"description": "Only for results with type 'software': URL to the software documentation",
"type": "array",
"items": {
"type": "string"
}
},
"embargoenddate": {
"type": "string",
"description": "Date when the embargo ends and this result turns Open Access"
},
"format": {
"type": "array",
"items": {
"type": "string"
}
},
"geolocation": {
"description": "Geolocation information",
"type": "array",
"items": {
"type": "object",
"properties": {
"box": {
"type": "string"
},
"place": {
"type": "string"
},
"point": {
"type": "string"
}
}
}
},
"id": {
"type": "string",
"description": "OpenAIRE Identifier"
},
"instance":{
"description":"Each instance is one specific materialisation or version of the result. For example, you can have one result with three instance: one is the pre-print, one is the post-print, one is te published version",
"type":"array",
"items":{
"type":"object",
"properties":{
"accessright":{
"type":"object",
"properties":{
"code": {
"type": "string",
"description": "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
},
"label": {
"type": "string",
"description": "Label for the access mode"
},
"openAccessRoute":{
"type":"string",
"enum":[
"gold",
"green",
"hybrid",
"bronze"
],
"description":"The type of OpenAccess applied to the result"
},
"scheme": {
"type": "string",
"description": "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
}
}
},
"alternateIdentifier":{
"type":"array",
"items":{
"allOf":[
{
"$ref":"#/definitions/ControlledField"
},
{
"description":"All the identifiers other than pids forged by an authorithy for the pid type (i.e. Crossref for DOIs"
}
]
}
},
"articleprocessingcharge":{
"description": "The money spent to make this book or article available in Open Access. Source for this information is the OpenAPC initiative.",
"type":"object",
"properties":{
"amount":{
"type":"string"
},
"currency":{
"type":"string"
}
}
},
"license":{
"type":"string"
},
"measures":{
"type":"array",
"items":{
"type":"object",
"properties":{
"key":{
"type":"string",
"description":"The measure"
},
"value":{
"type":"string",
"description":"The value for the measure"
}
},
"description":"Measures computed for this instance, for example Bip!Finder ones"
}
},
"pid":{
"description":"The set of persistent identifiers associated to this instance that have been collected from an authority for the pid type (i.e. Crossref/Datacite for doi)",
"type":"array",
"items":{
"allOf":[
{
"$ref":"#/definitions/ControlledField"
},
{
"description":"The persistent identifier associated to the result"
}
]
}
},
"publicationdate":{
"type":"string",
"description": "Date of the research product"
},
"refereed":{
"description": "If this instance has been peer-reviewed or not. Allowed values are peerReviewed, nonPeerReviewed, UNKNOWN (as defined in https://api.openaire.eu/vocabularies/dnet:review_levels)",
"type":"string"
},
"type":{
"type":"string",
"description":"The specific sub-type of this instance (see https://api.openaire.eu/vocabularies/dnet:result_typologies following the links)"
},
"url":{
"description":"URLs to the instance. They may link to the actual full-text or to the landing page at the hosting source. ",
"type":"array",
"items":{
"type":"string"
}
}
}
}
},
"language": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "alpha-3/ISO 639-2 code of the language"
},
"label": {
"type": "string",
"description": "Language label in English"
}
}
},
"lastupdatetimestamp": {
"type": "integer",
"description": "Timestamp of last update of the record in OpenAIRE"
},
"maintitle": {
"type": "string",
"descriptio": "A name or title by which a scientific result is known. May be the title of a publication, of a dataset or the name of a piece of software."
},
"subtitle": {
"type": "string",
"descriptio": "Explanatory or alternative name by which a scientific result is known."
},
"originalId": {
"description": "Identifiers of the record at the original sources",
"type": "array",
"items": {
"type": "string"
}
},
"pid": {
"description": "Persistent identifiers of the result",
"type": "array",
"items": {
"allOf": [
{"$ref": "#/definitions/ControlledField"},
{"description": "scheme: list of available schemes are at https://api.openaire.eu/vocabularies/dnet:pid_types, value: the PID of the result. Note: the result will have a pid associated only if it was collected from an authority for that pid type. For example a doi will be among the pids for one result if the result metadata were collected from Crossref or Datacite. In all the other cases, the doi will be present among the alteranteIdentifiers for the result "}
]
}
},
"programmingLanguage": {
"type": "string",
"description": "Only for results with type 'software': the programming language"
},
"publicationdate": {
"type": "string",
"description": "Main date of the research product: typically the publication or issued date. In case of a research result with different versions with different dates, the date of the result is selected as the most frequent well-formatted date. If not available, then the most recent and complete date among those that are well-formatted. For statistics, the year is extracted and the result is counted only among the result of that year. Example: Pre-print date: 2019-02-03, Article date provided by repository: 2020-02, Article date provided by Crossref: 2020, OpenAIRE will set as date 2019-02-03, because its the most recent among the complete and well-formed dates. If then the repository updates the metadata and set a complete date (e.g. 2020-02-12), then this will be the new date for the result because it becomes the most recent most complete date. However, if OpenAIRE then collects the pre-print from another repository with date 2019-02-03, then this will be the “winning date” because it becomes the most frequent well-formatted date."
},
"publisher": {
"type": "string",
"description": "The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource."
},
"size": {
"type": "string",
"description": "Only for results with type 'dataset': the declared size of the dataset"
},
"source": {
"description": "See definition of Dublin Core field dc:source",
"type": "array",
"items": {
"type": "string"
}
},
"subjects": {
"description": "Keywords associated to the result",
"type": "array",
"items": {
"type": "object",
"properties": {
"provenance": {
"allOf": [
{"$ref": "#/definitions/Provenance"},
{"description": "Why this subject is associated to the result"}
]
},
"subject": {
"allOf": [
{"$ref": "#/definitions/ControlledField"},
{"description": "OpenAIRE subject classification scheme (https://api.openaire.eu/vocabularies/dnet:subject_classification_typologies) and value. When the scheme is 'keyword', it means that the subject is free-text (i.e. not a term from a controlled vocabulary)."}
]
}
}
}
},
"tool": {
"description": "Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product",
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
"description": "Type of the result: one of 'publication', 'dataset', 'software', 'other' (see also https://api.openaire.eu/vocabularies/dnet:result_typologies)"
},
"version": {
"type": "string",
"description": "Version of the result"
}
}
}

View File

@ -1,8 +1,9 @@
package eu.dnetlib.dhp.schema.common;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;
import java.io.IOException;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@ -34,4 +35,19 @@ public class ModelSupportTest {
assertTrue(result);
}
}
@Nested
class InverseRelation {
@Test
void findRelations() throws IOException {
assertNotNull(ModelSupport.findRelation("isMetadataFor"));
assertNotNull(ModelSupport.findRelation("ismetadatafor"));
assertNotNull(ModelSupport.findRelation("ISMETADATAFOR"));
assertNotNull(ModelSupport.findRelation("isRelatedTo"));
}
}
}

View File

@ -3,22 +3,42 @@ package eu.dnetlib.dhp.schema.oaf;
import static org.junit.jupiter.api.Assertions.*;
import java.io.IOException;
import java.io.InputStream;
import java.time.format.DateTimeParseException;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* The type Merge test.
*/
class MergeTest {
/**
* The Oaf.
*/
OafEntity oaf;
/**
* Sets up.
*/
@BeforeEach
public void setUp() {
oaf = new Publication();
}
/**
* Merge lists test.
*/
@Test
@SuppressWarnings("unchecked")
void mergeListsTest() {
@ -35,6 +55,9 @@ class MergeTest {
System.out.println("merge result 3 = " + oaf.mergeLists(c, c));
}
/**
* Merge publication collected from test.
*/
@Test
void mergePublicationCollectedFromTest() {
@ -50,6 +73,213 @@ class MergeTest {
assertEquals(3, a.getCollectedfrom().size());
}
/**
* Load resource result list.
*
* @param <T> the type parameter
* @param path the path
* @param clazz the clazz
* @return the list
* @throws Exception the exception
*/
private <T extends Result> List<Result> loadResourceResult(final String path, final Class<T> clazz ) throws Exception {
final ObjectMapper mapper = new ObjectMapper();
final InputStream str = Objects.requireNonNull(getClass().getResourceAsStream(path));
// LOAD test publications
return IOUtils.readLines(str).stream().map(s -> {
try {
return mapper.readValue(s, clazz);
} catch (IOException e) {
return null;
}
}).filter(Objects::nonNull).collect(Collectors.toList());
}
/**
* Apply to any test list result the same pid of the enrichment instance
*
* @param source the source
* @param enrichment the enrichment
* @param overrideAlternateIdentifier the override alternate identifier
*/
private void updatePidIntoPublicationInstance(final List<Result> source, final List<Result>enrichment, final boolean overrideAlternateIdentifier) {
for(int i = 0 ; i< source.size(); i++) {
final Result currentPub = source.get(i);
final Result currentEnrichment = enrichment.get(i);
final Instance currentInstance = Objects.requireNonNull(currentPub.getInstance()).get(0);
if (overrideAlternateIdentifier)
currentInstance.setAlternateIdentifier(Objects.requireNonNull(currentEnrichment.getInstance()).get(0).getPid());
else
currentInstance.setPid(Objects.requireNonNull(currentEnrichment.getInstance()).get(0).getPid());
}
}
private void applyAndVerifyEnrichment(final List<Result> l1, final List<Result> l2) {
// Apply Merge and verify that enrichments works
for(int i = 0 ; i< l1.size(); i++) {
final Result currentPub = l2.get(i);
final Result currentEnrichment = l1.get(i);
currentPub.mergeFrom(currentEnrichment);
assertEquals(1, currentPub.getInstance().size());
final Instance currentInstance = Objects.requireNonNull(currentPub.getInstance()).get(0);
assertNotNull(currentInstance.getMeasures());
assertNotNull(currentPub.getTitle());
assertFalse(Result.isAnEnrichment(currentPub));
}
}
/**
* Test the merge of the APC at the level of the result and the instance.
*
* @throws Exception the exception
*/
@Test
void testAPCMerge() throws Exception {
List<Result> publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publication_apc.json", Publication.class);
System.out.println(publications.size());
publications.forEach(p -> assertEquals(1, p.getInstance().size()));
publications.forEach(p -> assertTrue(p.getProcessingchargeamount() != null ));
publications.forEach(p -> assertTrue(p.getProcessingchargecurrency() != null ));
publications.forEach(p -> assertTrue(StringUtils.isNotBlank(p.getProcessingchargeamount().getValue() )));
publications.forEach(p -> assertTrue(StringUtils.isNotBlank(p.getProcessingchargecurrency().getValue() )));
publications.forEach(p -> p.getInstance().stream()
.forEach(i -> assertTrue(i.getProcessingchargeamount() != null)));
publications.forEach(p -> p.getInstance().stream()
.forEach(i -> assertTrue(i.getProcessingchargecurrency() != null)));
publications.forEach(p -> p.getInstance().stream()
.forEach(i -> assertTrue(StringUtils.isNotBlank(i.getProcessingchargeamount().getValue()))));
publications.forEach(p -> p.getInstance().stream()
.forEach(i -> assertTrue(StringUtils.isNotBlank(i.getProcessingchargecurrency().getValue()))));
Result p1 = publications.get(0);
Result p2 = publications.get(1);
p1.mergeFrom(p2);
assertEquals("1721.47", p1.getProcessingchargeamount().getValue());
assertEquals("EUR", p1.getProcessingchargecurrency().getValue());
assertEquals(2 , p1.getInstance().size());
p1.getInstance().stream().forEach(i -> assertTrue(i.getProcessingchargeamount() != null));
p1.getInstance().stream().forEach(i -> assertTrue(i.getProcessingchargecurrency() != null));
p1.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount().getValue().equals("2000.47"));
p1.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount().getValue().equals("1721.47"));
p1.getInstance().stream().anyMatch(i -> i.getProcessingchargecurrency().getValue().equals("EUR"));
p1.getInstance().stream().anyMatch(i -> i.getProcessingchargecurrency().getValue().equals("USD"));
System.out.println(new ObjectMapper().writeValueAsString(p1));
}
@Test
void testAPCMerge2() throws Exception {
List<Result> publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publication_apc2.json", Publication.class);
System.out.println(publications.size());
publications.forEach(p -> assertEquals(1, p.getInstance().size()));
assertTrue(publications.get(0).getProcessingchargeamount() != null );
assertTrue(publications.get(0).getProcessingchargecurrency() != null );
assertTrue(publications.get(1).getProcessingchargeamount() == null );
Result p1 = publications.get(1);
Result p2 = publications.get(0);
//merge visible record with OpenAPC
p1.mergeFrom(p2);
assertFalse(p1.getDataInfo().getInvisible());
assertEquals("1721.47", p1.getProcessingchargeamount().getValue());
assertEquals("EUR", p1.getProcessingchargecurrency().getValue());
assertEquals(2 , p1.getInstance().size());
p1.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount() != null);
p1.getInstance().stream().anyMatch(i -> i.getProcessingchargecurrency() != null);
assertEquals("1721.47", p1.getInstance().stream().filter(i -> i.getProcessingchargeamount() != null)
.collect(Collectors.toList()).get(0).getProcessingchargeamount().getValue());
assertEquals("EUR", p1.getInstance().stream().filter(i -> i.getProcessingchargeamount() != null)
.collect(Collectors.toList()).get(0).getProcessingchargecurrency().getValue());
assertFalse(p1.getDataInfo().getInvisible());
System.out.println(new ObjectMapper().writeValueAsString(p1));
//merge OpenAPC with visible record
p2.mergeFrom(p1);
assertFalse(p2.getDataInfo().getInvisible());
assertEquals("1721.47", p2.getProcessingchargeamount().getValue());
assertEquals("EUR", p2.getProcessingchargecurrency().getValue());
assertEquals(2 , p2.getInstance().size());
p2.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount() != null);
p2.getInstance().stream().anyMatch(i -> i.getProcessingchargecurrency() != null);
assertEquals("1721.47", p2.getInstance().stream().filter(i -> i.getProcessingchargeamount() != null)
.collect(Collectors.toList()).get(0).getProcessingchargeamount().getValue());
assertEquals("EUR", p2.getInstance().stream().filter(i -> i.getProcessingchargeamount() != null)
.collect(Collectors.toList()).get(0).getProcessingchargecurrency().getValue());
}
/**
* Test enrichment function.
*
* @throws Exception the exception
*/
@Test
void testEnrichment() throws Exception {
// 1 TEST UPDATING PID INSTANCE AND MERGE CURRENT PUBLICATION WITH ENRICHMENT
// LOAD test publications
List<Result> publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publications.json", Publication.class);
// Assert that each publication has only one instance and inside that all the measure field is empty
publications.forEach(p -> {
assertEquals(1, p.getInstance().size());
final Instance currentInstance = Objects.requireNonNull(p.getInstance()).get(0);
assertNull(currentInstance.getMeasures());
});
// LOAD test enrichments
List<Result> enrichment = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/enrichment.json", Result.class);
updatePidIntoPublicationInstance(publications, enrichment, false);
applyAndVerifyEnrichment(publications, enrichment);
// 2 TEST UPDATING ALTERNATE ID INSTANCE AND MERGE CURRENT PUBLICATION WITH ENRICHMENT
publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publications.json", Publication.class);
enrichment = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/enrichment.json", Result.class);
updatePidIntoPublicationInstance(publications, enrichment, true);
applyAndVerifyEnrichment(publications, enrichment);
// 3 TEST UPDATING PID INSTANCE AND MERGE ENRICHMENT WITH CURRENT PUBLICATION
publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publications.json", Publication.class);
enrichment = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/enrichment.json", Result.class);
updatePidIntoPublicationInstance(publications, enrichment, false);
applyAndVerifyEnrichment( enrichment, publications);
// 4 TEST UPDATING ALTERNATE ID INSTANCE AND MERGE ENRICHMENT WITH CURRENT PUBLICATION
publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publications.json", Publication.class);
enrichment = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/enrichment.json", Result.class);
updatePidIntoPublicationInstance(publications, enrichment, true);
applyAndVerifyEnrichment( enrichment, publications);
}
/**
* Merge publication date of acceptance test both present.
*/
@Test
void mergePublicationDateOfAcceptanceTest_bothPresent() {
@ -65,6 +295,9 @@ class MergeTest {
assertEquals("2021-06-18", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test both present 1.
*/
@Test
void mergePublicationDateOfAcceptanceTest_bothPresent_1() {
@ -80,6 +313,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test both present 2.
*/
@Test
void mergePublicationDateOfAcceptanceTest_bothPresent_2() {
@ -95,6 +331,9 @@ class MergeTest {
assertEquals("2021-06-18", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test left missing.
*/
@Test
void mergePublicationDateOfAcceptanceTest_leftMissing() {
@ -109,6 +348,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test left missing 1.
*/
@Test
void mergePublicationDateOfAcceptanceTest_leftMissing_1() {
@ -123,6 +365,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test left missing 2.
*/
@Test
void mergePublicationDateOfAcceptanceTest_leftMissing_2() {
@ -137,6 +382,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test right missing.
*/
@Test
void mergePublicationDateOfAcceptanceTest_rightMissing() {
@ -151,6 +399,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test right missing 1.
*/
@Test
void mergePublicationDateOfAcceptanceTest_rightMissing_1() {
@ -165,6 +416,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication date of acceptance test right missing 2.
*/
@Test
void mergePublicationDateOfAcceptanceTest_rightMissing_2() {
@ -179,6 +433,9 @@ class MergeTest {
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
}
/**
* Merge publication subject test.
*/
@Test
void mergePublicationSubjectTest() {
@ -194,6 +451,9 @@ class MergeTest {
assertEquals(3, a.getSubject().size());
}
/**
* Merge relation test.
*/
@Test
void mergeRelationTest() {
@ -235,6 +495,9 @@ class MergeTest {
}
/**
* Merge relation test parse exception.
*/
@Test
void mergeRelationTestParseException() {
assertThrows(DateTimeParseException.class, () -> {
@ -244,6 +507,13 @@ class MergeTest {
});
}
/**
* Create rel relation.
*
* @param validated the validated
* @param validationDate the validation date
* @return the relation
*/
private Relation createRel(Boolean validated, String validationDate) {
Relation rel = new Relation();
rel.setSource("1");
@ -256,6 +526,13 @@ class MergeTest {
return rel;
}
/**
* Sets kv.
*
* @param key the key
* @param value the value
* @return the kv
*/
private KeyValue setKV(final String key, final String value) {
KeyValue k = new KeyValue();
@ -266,6 +543,14 @@ class MergeTest {
return k;
}
/**
* Sets sp.
*
* @param value the value
* @param schema the schema
* @param classname the classname
* @return the sp
*/
private StructuredProperty setSP(
final String value, final String schema, final String classname) {
StructuredProperty s = new StructuredProperty();
@ -279,24 +564,48 @@ class MergeTest {
return s;
}
/**
* Field field.
*
* @param <T> the type parameter
* @param value the value
* @return the field
*/
private <T> Field<T> field(T value) {
Field<T> f = new Field();
f.setValue(value);
return f;
}
/**
* Publication publication.
*
* @return the publication
*/
private Publication publication() {
Publication p = new Publication();
p.setDataInfo(df("0.9"));
return p;
}
/**
* Publication publication.
*
* @param trust the trust
* @return the publication
*/
private Publication publication(String trust) {
Publication p = new Publication();
p.setDataInfo(df(trust));
return p;
}
/**
* Df data info.
*
* @param trust the trust
* @return the data info
*/
private DataInfo df(String trust) {
DataInfo d = new DataInfo();
d.setTrust(trust);

View File

@ -0,0 +1,55 @@
package eu.dnetlib.dhp.schema.oaf.dump;
import java.io.IOException;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.JsonNode;
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.ExecCreateSchemas;
import eu.dnetlib.dhp.schema.dump.oaf.graph.*;
//@Disabled
class GenerateJsonSchema {
@Test
void generateSchema() {
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_7,
OptionPreset.PLAIN_JSON)
.with(Option.SCHEMA_VERSION_INDICATOR)
.without(Option.NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS);
configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName());
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(GraphResult.class);
System.out.println(jsonSchema.toString());
}
@Test
void generateSchema2(){
ObjectMapper objectMapper = new ObjectMapper();
AddonModule module = new AddonModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper,SchemaVersion.DRAFT_7,OptionPreset.PLAIN_JSON)
.with(module)
.with(Option.SCHEMA_VERSION_INDICATOR)
.without(Option.NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS);
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(GraphResult.class);
System.out.println(jsonSchema.toString());
}
@Test
void generateJsonSchema3() throws IOException {
ExecCreateSchemas.main(new String[]{});
}
}

View File

@ -43,6 +43,9 @@ class IdentifierFactoryTest {
verifyIdentifier(
"publication_pmc2.json", "50|pmc_________::94e4cb08c93f8733b48e2445d04002ac", true);
verifyIdentifier(
"publication_openapc.json", "50|doi_________::79dbc7a2a56dc1532659f9038843256e", true);
final String defaultID = "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f";
verifyIdentifier("publication_3.json", defaultID, true);
verifyIdentifier("publication_4.json", defaultID, true);

View File

@ -0,0 +1,241 @@
package eu.dnetlib.dhp.schema.sx.scholix;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.junit.jupiter.api.Test;
public class ScholixCompareTest {
private ScholixIdentifier generateMockScholixId(final String baseId ,boolean toUpper, int idCount) {
final String id = String.format("%s.%d",baseId, idCount);
final String schema = "DOI";
final String url =String.format("http://dx.dOI.org/%s.%d",baseId, idCount);
final ScholixIdentifier result = new ScholixIdentifier();
result.setIdentifier(toUpper ? id.toUpperCase(): id.toLowerCase());
result.setSchema(toUpper ? schema.toUpperCase():schema.toLowerCase());
result.setUrl(toUpper ? url.toUpperCase():url.toLowerCase());
return result;
}
private ScholixIdentifier generateMockScholixId(boolean toUpper, int idCount) {
return generateMockScholixId("10.11646/zootaxa.5099.1", toUpper, idCount);
}
private ScholixEntityId generateMockScholixEntityId(String name, boolean toUpper, boolean invertOrder, int numberOfIds) {
final List<ScholixIdentifier> ids = new ArrayList<>();
if (!invertOrder) {
for (int i = 0; i < numberOfIds; i++) {
ids.add(generateMockScholixId(toUpper, i));
}
}
else {
for (int i = numberOfIds-1; i >=0; i--) {
ids.add(generateMockScholixId(toUpper, i));
}
}
return new ScholixEntityId(toUpper? name.toUpperCase(): name.toLowerCase(), ids);
}
private ScholixEntityId generateMockScholixEntityId(boolean toUpper, boolean invertOrder, int numberOfIds) {
return generateMockScholixEntityId("datacite", toUpper, invertOrder,numberOfIds);
}
private ScholixCollectedFrom generateMockScholixCollectedFrom(final String dsName , final boolean toUpper, final boolean invertOrder, final int numberOfIds) {
final ScholixCollectedFrom result = new ScholixCollectedFrom();
final String completionStatus = "complete";
final String provisionMode = "collected";
result.setProvider(generateMockScholixEntityId(dsName,toUpper, invertOrder, numberOfIds));
result.setCompletionStatus(toUpper ? completionStatus.toUpperCase(): completionStatus.toLowerCase());
result.setProvisionMode(toUpper ? provisionMode.toUpperCase(): provisionMode.toLowerCase());
return result;
}
private ScholixCollectedFrom generateMockScholixCollectedFrom(boolean toUpper, boolean invertOrder, int numberOfIds) {
return generateMockScholixCollectedFrom("datasource", toUpper, invertOrder,numberOfIds);
}
private ScholixRelationship generateMockScholixRelationships(boolean toUpper) {
final String name = "IsRelatedTo";
final String inverse = "RelatedTo";
final String schema = "datacite";
final ScholixRelationship rel = new ScholixRelationship();
rel.setName(toUpper? name.toUpperCase():name.toLowerCase());
rel.setInverse(toUpper? inverse.toUpperCase():inverse.toLowerCase());
rel.setSchema(toUpper? schema.toUpperCase():schema.toLowerCase());
return rel;
}
private ScholixResource generateMockScholixResource(final String sourceBase, boolean toUpper, int idCount, boolean invertOrder, int numEntityIds) {
final ScholixResource resource = new ScholixResource();
final String baseSourceId = "%s_10.1000/ID_%d/";
final String creatorBase ="Creator %d";
final String publisherBase ="Publisher %d";
final String collectedFromBase ="Datasource %d";
final String title = String.format("Resource %s Title 1", sourceBase);
final List<ScholixIdentifier> ids = IntStream.range(0,numEntityIds)
.mapToObj(i -> String.format(baseSourceId,sourceBase, i))
.map(s ->generateMockScholixId(s, toUpper, idCount))
.collect(Collectors.toList());
resource.setIdentifier(ids);
resource.setDnetIdentifier("dnetId");
resource.setObjectType("dataset");
resource.setObjectSubType("dataset");
resource.setTitle(title);
final List<ScholixEntityId> creators = IntStream.range(0,numEntityIds)
.mapToObj(i -> String.format(creatorBase, i))
.map(s ->generateMockScholixEntityId(s, toUpper,invertOrder,idCount))
.collect(Collectors.toList());
resource.setCreator(creators);
resource.setPublicationDate("22-02-2022");
final List<ScholixEntityId> publishers = IntStream.range(0,numEntityIds)
.mapToObj(i -> String.format(publisherBase, i))
.map(s ->generateMockScholixEntityId(s, toUpper,invertOrder,idCount))
.collect(Collectors.toList());
resource.setPublisher(publishers);
final List<ScholixCollectedFrom> collectedFroms = IntStream.range(0,numEntityIds)
.mapToObj(i -> String.format(collectedFromBase, i))
.map(s -> generateMockScholixCollectedFrom(s,toUpper, invertOrder, idCount))
.collect(Collectors.toList());
resource.setCollectedFrom(collectedFroms);
return resource;
}
private Scholix generateMockScholix( boolean toUpper, int idCount, boolean invertOrder, int numEntityIds) {
final Scholix result = new Scholix();
result.setPublicationDate("2022-02-22");
final String id = "dnetID";
final String publisherBase ="Publisher %d";
result.setPublisher(IntStream.range(0,numEntityIds)
.mapToObj(i -> String.format(publisherBase, i))
.map(s ->generateMockScholixEntityId(s, toUpper,invertOrder,idCount))
.collect(Collectors.toList()));
result.setLinkprovider(IntStream.range(0,numEntityIds)
.mapToObj(i -> String.format(publisherBase, i))
.map(s ->generateMockScholixEntityId(s, toUpper,invertOrder,idCount))
.collect(Collectors.toList()));
result.setRelationship(generateMockScholixRelationships(toUpper));
result.setSource(generateMockScholixResource("source", toUpper, idCount,invertOrder, numEntityIds));
result.setTarget(generateMockScholixResource("target", toUpper, idCount,invertOrder, numEntityIds));
result.setIdentifier(toUpper?id.toUpperCase():id.toLowerCase());
return result;
}
@Test
public void testScholixIdentifierComparison() {
final ScholixIdentifier left = generateMockScholixId(true, 1);
final ScholixIdentifier right = generateMockScholixId(false,1);
assertEquals(0,left.compareTo(right));
assertEquals(left, right);
assertEquals(left.hashCode(), right.hashCode());
left.setIdentifier(null);
assertEquals(-1, left.compareTo(right));
}
@Test
public void testScholixEntityIDComparison() {
final ScholixEntityId first =generateMockScholixEntityId(true,false,10);
final ScholixEntityId second =generateMockScholixEntityId(false,true,10);
assertEquals(first,second);
assertEquals(first.hashCode(), second.hashCode());
}
@Test
public void testScholixCollectedFromComparison() {
final ScholixCollectedFrom cfLeft = generateMockScholixCollectedFrom(true, true, 20);
final ScholixCollectedFrom cfRight = generateMockScholixCollectedFrom(false, false, 20);
assertEquals(cfLeft, cfRight);
assertEquals(cfLeft.hashCode(), cfRight.hashCode());
cfRight.setCompletionStatus(null);
assertNotEquals(cfLeft, cfRight);
}
@Test
public void testCompareScholixResource() {
final ScholixResource left = generateMockScholixResource("source",true,5, true,5);
final ScholixResource right = generateMockScholixResource("source",false,5, false,5);
assertEquals(left,right);
assertEquals(left.hashCode(), right.hashCode());
final ScholixResource different = generateMockScholixResource("source",false,4, false,5);
assertNotEquals(different,right);
assertNotEquals(different,left);
assertNotEquals(left.hashCode(), different.hashCode());
assertNotEquals(right.hashCode(), different.hashCode());
}
@Test
public void testCompareScholix() {
final Scholix left = generateMockScholix(true,5, true,5);
final Scholix right = generateMockScholix(false,5, false,5);
assertEquals(left,right);
assertEquals(left.hashCode(), right.hashCode());
final Scholix different = generateMockScholix(true,4, false,5);
assertNotEquals(different,right);
assertNotEquals(different,left);
assertNotEquals(left.hashCode(), different.hashCode());
assertNotEquals(right.hashCode(), different.hashCode());
}
@Test
public void testCompareScholixRelation() {
final ScholixRelationship left = generateMockScholixRelationships(true);
final ScholixRelationship right = generateMockScholixRelationships(false);
assertEquals(left, right);
assertEquals(left.hashCode(), right.hashCode());
}
}

View File

@ -0,0 +1,12 @@
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0000/ra.v2i3.114::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"4.65008652949e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0000/ra.v2i3.114"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0001/(aj).v3i6.458::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"4.01810569717e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0001/(aj).v3i6.458"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0001/1587::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.39172290649e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0001/1587"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0001/462::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"6.33235333753e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.36"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.00285265116e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0001/462"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0001/731::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"4.01810569717e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0001/731"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0001/ijllis.v9i4.2066.g2482::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"8.48190886761e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0001/ijllis.v9i4.2066.g2482"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0118/alfahim.v3i1.140::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"9.88840807598e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0118/alfahim.v3i1.140"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0166/fk2.stagefigshare.6442896.v3::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"7.28336930301e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0166/fk2.stagefigshare.6442896.v3"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0301/jttb.v2i1.64::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"7.28336930301e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0301/jttb.v2i1.64"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0809/seruni.v1i1.567::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"2.62959564033e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0809/seruni.v1i1.567"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0809/seruni.v2i1.765::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"9.40178571921e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0559872"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"3.67659957614e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0809/seruni.v2i1.765"}]}]}
{"dataInfo":{"deletedbyinference":false,"inferred":true,"invisible":false,"provenanceaction":{"classid":"sysimport:enrich","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"}},"id":"unresolved::10.0901/jkip.v7i3.485::doi","instance":[{"measures":[{"id":"influence","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"5.91019644836e-09"}]},{"id":"popularity_alt","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"0.0"}]},{"id":"popularity","unit":[{"dataInfo":{"deletedbyinference":false,"inferenceprovenance":"update","inferred":true,"invisible":false,"provenanceaction":{"classid":"measure:bip","classname":"Inferred by OpenAIRE","schemeid":"dnet:provenanceActions","schemename":"dnet:provenanceActions"},"trust":""},"key":"score","value":"6.26204125721e-09"}]}],"pid":[{"qualifier":{"classid":"doi","classname":"Digital Object Identifier","schemeid":"dnet:pid_types","schemename":"dnet:pid_types"},"value":"10.0901/jkip.v7i3.485"}]}]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,31 @@
{
"id": "50|openapc_____::000023f9cb6e3a247c764daec4273cbc",
"resuttype": {
"classid": "publication"
},
"instance": [
{
"collectedfrom": {
"key": "10|apc_________::e2b1600b229fc30663c8a1f662debddf",
"value": "OpenAPC Global Initiative"
},
"pid": [
{
"qualifier": {"classid": "doi"},
"value": "10.1016/j.cmet.2010.03.013"
},
{
"qualifier": {"classid": "pmc"},
"value": "21459329"
},
{
"qualifier": {"classid": "pmid"},
"value": "25811027"
}
],
"url":["https://doi.org/10.1155/2015/439379"]
}
]
}

File diff suppressed because one or more lines are too long