Compare commits
9 Commits
master
...
dhp-schema
Author | SHA1 | Date |
---|---|---|
Claudio Atzori | 3fb1ed30d3 | |
Claudio Atzori | c1f9ca92f3 | |
Claudio Atzori | 9763d1913e | |
Claudio Atzori | 1f4bdbd636 | |
Miriam Baglioni | a125da847e | |
Claudio Atzori | d60a4fbf6b | |
Alessia Bardi | 287fd256f2 | |
Alessia Bardi | c1f701cffa | |
Alessia Bardi | bbcdc0e762 |
64
CHANGES.md
64
CHANGES.md
|
@ -2,35 +2,37 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
| **Version** | **Changes** | **Readiness** |
|
||||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
|
||||
| 2.12.0 | [Graph model] </br> <ul><li>Introducing EOSC Services as datasources</li> <ul> | beta |
|
||||
| 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 |
|
||||
| **Version** | **Changes** | **Readiness** |
|
||||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2.13.1-patched | [Graph model] </br> <ul><li>ROHub as delegated authority for w3id PIDs</li><li>Added measure at the level of the OafEntity</li><ul> | production |
|
||||
| 2.12.1-patched | [Graph model] </br> <ul><li>moved EoscIfGuidelines field to Result and Datasource/Service</li><ul> | production |
|
||||
| 2.12.0 | [Graph model] </br> <ul><li>Introducing EOSC Services as datasources</li> <ul> | production |
|
||||
| 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> | production |
|
||||
| 2.10.31 | [Minor] </br>NPE checks | production |
|
||||
| 2.10.30 | [Minor] </br>added comparator for refereed field instances | production |
|
||||
| 2.10.29 | [Merge Result] </br>merge logics changed to consider invisble in dataInfo | production |
|
||||
| 2.10.28 | [Graph Model] </br> Added APC information at the level of the result | production |
|
||||
| 2.10.27 | [Graph Model] </br> change name and id of OpenAPC datasource | production |
|
||||
| 2.10.26 | [Graph Model] </br> OpenAIRE ids of the delegated authorities and enrichment providers in the identifier creation strategy | production |
|
||||
| 2.10.25 | [Graph model]</br>implemented enrichment on Result specializing in the method mergefrom. | production |
|
||||
| 2.10.24 | [Graph model]</br>added utility method and constants for checking weather is an OafEntity represents an enrichment. | production |
|
||||
| 2.9.24 | [Dump model]</br>change the names of the classes to be able to automatically create the json schema with specific descriptions | production |
|
||||
| 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 | production |
|
||||
| 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 |
|
||||
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -5,7 +5,7 @@
|
|||
<groupId>eu.dnetlib.dhp</groupId>
|
||||
<artifactId>dhp-schemas</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.12.1</version>
|
||||
<version>2.13.2-patched-SNAPSHOT</version>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
|
@ -32,7 +32,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.12.1</tag>
|
||||
<tag>dhp-schemas-2.13.1</tag>
|
||||
</scm>
|
||||
|
||||
<description>This module contains common schema classes meant to be used across the dnet-hadoop submodules</description>
|
||||
|
|
|
@ -24,6 +24,7 @@ public class ModelConstants {
|
|||
public static final String EUROPE_PUBMED_CENTRAL_ID = "10|opendoar____::8b6dd7db9af49e67306feb59a8bdc52c";
|
||||
public static final String PUBMED_CENTRAL_ID = "10|opendoar____::eda80a3d5b344bc40f3bc04f65b7a357";
|
||||
public static final String ARXIV_ID = "10|opendoar____::6f4922f45568161a8cdf4ad2299f6d23";
|
||||
public static final String ROHUB_ID = "10|fairsharing_::1b69ebedb522700034547abc5652ffac";
|
||||
|
||||
public static final String OPENORGS_NAME = "OpenOrgs Database";
|
||||
|
||||
|
@ -113,7 +114,7 @@ public class ModelConstants {
|
|||
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_DESCRIBED_BY = "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";
|
||||
|
|
|
@ -125,7 +125,7 @@ public class ModelSupport {
|
|||
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_DESCRIBED_BY, 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);
|
||||
|
|
|
@ -21,6 +21,29 @@ public abstract class OafEntity extends Oaf implements Serializable {
|
|||
|
||||
private OAIProvenance oaiprovenance;
|
||||
|
||||
/**
|
||||
* The Measures.
|
||||
*/
|
||||
private List<Measure> measures;
|
||||
|
||||
/**
|
||||
* 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 String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -94,6 +117,8 @@ public abstract class OafEntity extends Oaf implements Serializable {
|
|||
|
||||
if (e.getOaiprovenance() != null && compareTrust(this, e) < 0)
|
||||
oaiprovenance = e.getOaiprovenance();
|
||||
|
||||
measures = mergeLists(measures, e.getMeasures());
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
|
|
|
@ -30,10 +30,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*/
|
||||
private Field<String> processingchargecurrency;
|
||||
|
||||
/**
|
||||
* The Measures.
|
||||
*/
|
||||
private List<Measure> measures;
|
||||
|
||||
|
||||
/**
|
||||
* The Author.
|
||||
|
@ -147,23 +144,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*/
|
||||
private List<EoscIfGuidelines> eoscifguidelines;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
@ -759,7 +740,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
processingchargecurrency = r.getProcessingchargecurrency();
|
||||
}
|
||||
|
||||
measures = mergeLists(measures, r.getMeasures());
|
||||
|
||||
|
||||
eoscifguidelines = mergeLists(eoscifguidelines, r.getEoscifguidelines());
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ public class IdentifierFactory implements Serializable {
|
|||
public static final int ID_PREFIX_LEN = 12;
|
||||
|
||||
/**
|
||||
* Declares the associations PID_TYPE -> [DATASOURCE ID, NAME] considered authoritative for that PID_TYPE
|
||||
* Declares the associations PID_TYPE -> [DATASOURCE ID, NAME] considered authoritative for that PID_TYPE.
|
||||
* The id of the record (source_::id) will be rewritten as pidType_::id)
|
||||
*/
|
||||
public static final Map<PidType, HashBiMap<String, String>> PID_AUTHORITY = Maps.newHashMap();
|
||||
|
||||
|
@ -53,11 +54,17 @@ public class IdentifierFactory implements Serializable {
|
|||
|
||||
PID_AUTHORITY.put(PidType.arXiv, HashBiMap.create());
|
||||
PID_AUTHORITY.get(PidType.arXiv).put(ARXIV_ID, "arXiv.org e-Print Archive");
|
||||
|
||||
PID_AUTHORITY.put(PidType.w3id, HashBiMap.create());
|
||||
PID_AUTHORITY.get(PidType.w3id).put(ROHUB_ID, "ROHub");
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares the associations PID_TYPE -> [DATASOURCE ID, PID SUBSTRING] considered as delegated authority for that
|
||||
* PID_TYPE. Example, Zenodo is delegated to forge DOIs that contain the 'zenodo' word.
|
||||
*
|
||||
* If a record with the same id (same pid) comes from 2 data sources, the one coming from a delegated source wins. E.g. Zenodo records win over those from Datacite.
|
||||
* See also https://code-repo.d4science.org/D-Net/dnet-hadoop/pulls/187 and the class dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/OafMapperUtils.java
|
||||
*/
|
||||
public static final Map<PidType, Map<String, String>> DELEGATED_PID_AUTHORITY = Maps.newHashMap();
|
||||
|
||||
|
@ -65,6 +72,8 @@ public class IdentifierFactory implements Serializable {
|
|||
DELEGATED_PID_AUTHORITY.put(PidType.doi, new HashMap<>());
|
||||
DELEGATED_PID_AUTHORITY.get(PidType.doi).put(ZENODO_OD_ID, "zenodo");
|
||||
DELEGATED_PID_AUTHORITY.get(PidType.doi).put(ZENODO_R3_ID, "zenodo");
|
||||
DELEGATED_PID_AUTHORITY.put(PidType.w3id, new HashMap<>());
|
||||
DELEGATED_PID_AUTHORITY.get(PidType.w3id).put(ROHUB_ID, "ro-id");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,7 +56,7 @@ public enum PidType {
|
|||
*
|
||||
* Source: https://www.nlm.nih.gov/bsd/mms/medlineelements.html#pmc
|
||||
*/
|
||||
pmc, handle, arXiv, nct, pdb,
|
||||
pmc, handle, arXiv, nct, pdb, w3id,
|
||||
|
||||
// Organization
|
||||
openorgs, corda, corda_h2020, GRID, mag_id, urn,
|
||||
|
|
|
@ -68,12 +68,18 @@ class IdentifierFactoryTest {
|
|||
verifyIdentifier("publication_5.json", defaultID, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateIdentifierForROHub() throws IOException {
|
||||
verifyIdentifier(
|
||||
"orp-rohub.json", "50|w3id________::afc7592914ae190a50570db90f55f9c2", true);
|
||||
}
|
||||
|
||||
protected void verifyIdentifier(String filename, String expectedID, boolean md5) throws IOException {
|
||||
final String json = IOUtils.toString(getClass().getResourceAsStream(filename));
|
||||
final Publication pub = OBJECT_MAPPER.readValue(json, Publication.class);
|
||||
|
||||
String id = IdentifierFactory.createIdentifier(pub, md5);
|
||||
|
||||
System.out.println(id);
|
||||
assertNotNull(id);
|
||||
assertEquals(expectedID, id);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue