Graph model footprint optimisation #23
|
@ -4,9 +4,8 @@ This project defines **object schemas** of the OpenAIRE main entities and the re
|
|||
Namely it defines the model for
|
||||
|
||||
- the graph internal representation, defined under the package `eu.dnetlib.dhp.schema.oaf`
|
||||
- the public graph dump representations, defined under the package `eu.dnetlib.dhp.schema.dump.oaf`
|
||||
- the scholexplorer content representation, defined under the package `eu.dnetlib.dhp.schema.sx`
|
||||
- the contents acquired from the netadata aggregation subsystem, defined under the package `eu.dnetlib.dhp.schema.mdstore`
|
||||
- the contents acquired from the metadata aggregation subsystem, defined under the package `eu.dnetlib.dhp.schema.mdstore`
|
||||
- the ORCID common schemas, defined under the package `eu.dnetlib.dhp.schema.orcid`
|
||||
|
||||
Te serialization of such objects (data store files) are used to pass data between workflow nodes in the processing pipeline.
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -5,7 +5,7 @@
|
|||
<groupId>eu.dnetlib.dhp</groupId>
|
||||
<artifactId>dhp-schemas</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.15.1-SNAPSHOT</version>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.Qualifier;
|
||||
|
||||
public class AccessRightComparator<T extends Qualifier> implements Comparator<T> {
|
||||
|
||||
@Override
|
||||
public int compare(T left, T 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("OPEN SOURCE"))
|
||||
return -1;
|
||||
if (rClass.equals("OPEN SOURCE"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("OPEN"))
|
||||
return -1;
|
||||
if (rClass.equals("OPEN"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("6MONTHS"))
|
||||
return -1;
|
||||
if (rClass.equals("6MONTHS"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("12MONTHS"))
|
||||
return -1;
|
||||
if (rClass.equals("12MONTHS"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("EMBARGO"))
|
||||
return -1;
|
||||
if (rClass.equals("EMBARGO"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("RESTRICTED"))
|
||||
return -1;
|
||||
if (rClass.equals("RESTRICTED"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("CLOSED"))
|
||||
return -1;
|
||||
if (rClass.equals("CLOSED"))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals("UNKNOWN"))
|
||||
return -1;
|
||||
if (rClass.equals("UNKNOWN"))
|
||||
return 1;
|
||||
|
||||
// Else (but unlikely), lexicographical ordering will do.
|
||||
return lClass.compareTo(rClass);
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.OafEntity;
|
||||
|
||||
/** Actual entity types in the Graph */
|
||||
public enum EntityType {
|
||||
publication, dataset, otherresearchproduct, software, datasource, organization, project;
|
||||
|
||||
/**
|
||||
* Resolves the EntityType, given the relative class name
|
||||
*
|
||||
* @param clazz the given class name
|
||||
* @param <T> actual OafEntity subclass
|
||||
* @return the EntityType associated to the given class
|
||||
*/
|
||||
public static <T extends OafEntity> EntityType fromClass(Class<T> clazz) {
|
||||
|
||||
return EntityType.valueOf(clazz.getSimpleName().toLowerCase());
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
/** Main entity types in the Graph */
|
||||
public enum MainEntityType {
|
||||
result, datasource, organization, project
|
||||
}
|
|
@ -1,250 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.AccessRight;
|
||||
import eu.dnetlib.dhp.schema.oaf.DataInfo;
|
||||
import eu.dnetlib.dhp.schema.oaf.KeyValue;
|
||||
import eu.dnetlib.dhp.schema.oaf.Qualifier;
|
||||
|
||||
public class ModelConstants {
|
||||
|
||||
private ModelConstants() {}
|
||||
|
||||
public static final String ORCID = "orcid";
|
||||
public static final String ORCID_PENDING = "orcid_pending";
|
||||
public static final String ORCID_CLASSNAME = "Open Researcher and Contributor ID";
|
||||
public static final String ORCID_DS = ORCID.toUpperCase();
|
||||
|
||||
public static final String CROSSREF_ID = "10|openaire____::081b82f96300b6a6e3d282bad31cb6e2";
|
||||
public static final String DATACITE_ID = "10|openaire____::9e3be59865b2c1c335d32dae2fe7b254";
|
||||
|
||||
public static final String ZENODO_OD_ID = "10|opendoar____::358aee4cc897452c00244351e4d91f69";
|
||||
public static final String ZENODO_R3_ID = "10|re3data_____::7b0ad08687b2c960d5aeef06f811d5e6";
|
||||
|
||||
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";
|
||||
|
||||
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";
|
||||
public static final String ACCESS_RIGHT_CLOSED = "CLOSED";
|
||||
|
||||
public static final String DNET_SUBJECT_KEYWORD = "keyword";
|
||||
|
||||
public static final String DNET_SUBJECT_FOS_CLASSID = "FOS";
|
||||
|
||||
public static final String DNET_SUBJECT_FOS_CLASSNAME = "Fields of Science and Technology classification";
|
||||
|
||||
public static final String DNET_SUBJECT_TYPOLOGIES = "dnet:subject_classification_typologies";
|
||||
public static final String DNET_RESULT_TYPOLOGIES = "dnet:result_typologies";
|
||||
public static final String DNET_PUBLICATION_RESOURCE = "dnet:publication_resource";
|
||||
public static final String DNET_ACCESS_MODES = "dnet:access_modes";
|
||||
public static final String DNET_LANGUAGES = "dnet:languages";
|
||||
public static final String DNET_PID_TYPES = "dnet:pid_types";
|
||||
public static final String DNET_DATACITE_DATE = "dnet:dataCite_date";
|
||||
public static final String DNET_DATACITE_TITLE = "dnet:dataCite_title";
|
||||
public static final String DNET_DATA_CITE_RESOURCE = "dnet:dataCite_resource";
|
||||
public static final String DNET_PROVENANCE_ACTIONS = "dnet:provenanceActions";
|
||||
public static final String DNET_COUNTRY_TYPE = "dnet:countries";
|
||||
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";
|
||||
public static final String SYSIMPORT_ACTIONSET = "sysimport:actionset";
|
||||
public static final String SYSIMPORT_ORCID_NO_DOI = "sysimport:actionset:orcidworks-no-doi";
|
||||
|
||||
public static final String USER_CLAIM = "user:claim";
|
||||
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);
|
||||
|
||||
public static final String DATASET_RESULTTYPE_CLASSID = "dataset";
|
||||
public static final String PUBLICATION_RESULTTYPE_CLASSID = "publication";
|
||||
public static final String SOFTWARE_RESULTTYPE_CLASSID = "software";
|
||||
public static final String ORP_RESULTTYPE_CLASSID = "other";
|
||||
|
||||
public static final String RESULT_RESULT = "resultResult"; // relType
|
||||
/**
|
||||
* @deprecated Use {@link ModelConstants#RELATIONSHIP} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PUBLICATION_DATASET = "publicationDataset"; // subreltype
|
||||
|
||||
public static final String SUPPLEMENT = "supplement"; // subreltype
|
||||
public static final String IS_SUPPLEMENT_TO = "IsSupplementTo";
|
||||
public static final String IS_SUPPLEMENTED_BY = "IsSupplementedBy";
|
||||
|
||||
public static final String PART = "part"; // subreltype
|
||||
public static final String IS_PART_OF = "IsPartOf";
|
||||
public static final String HAS_PART = "HasPart";
|
||||
|
||||
public static final String RELATIONSHIP = "relationship"; // subreltype
|
||||
|
||||
public static final String IS_RELATED_TO = "IsRelatedTo";
|
||||
public static final String IS_IDENTICAL_TO = "IsIdenticalTo";
|
||||
|
||||
public static final String REFERENCES = "References";
|
||||
public static final String IS_REFERENCED_BY = "IsReferencedBy";
|
||||
public static final String CONTINUES = "Continues";
|
||||
public static final String IS_CONTINUED_BY = "IsContinuedBy";
|
||||
public static final String DOCUMENTS = "Documents";
|
||||
public static final String IS_DOCUMENTED_BY = "IsDocumentedBy";
|
||||
public static final String IS_SOURCE_OF = "IsSourceOf";
|
||||
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_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";
|
||||
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";
|
||||
public static final String IS_CITED_BY = "IsCitedBy";
|
||||
|
||||
public static final String REVIEW = "review"; // subreltype
|
||||
public static final String REVIEWS = "Reviews";
|
||||
public static final String IS_REVIEWED_BY = "IsReviewedBy";
|
||||
|
||||
public static final String VERSION = "version"; // subreltype
|
||||
public static final String IS_VERSION_OF = "IsVersionOf";
|
||||
public static final String HAS_VERSION = "HasVersion";
|
||||
public static final String IS_PREVIOUS_VERSION_OF = "IsPreviousVersionOf";
|
||||
public static final String IS_NEW_VERSION_OF = "IsNewVersionOf";
|
||||
public static final String IS_VARIANT_FORM_OF = "IsVariantFormOf";
|
||||
public static final String IS_ORIGINAL_FORM_OF = "IsOriginalFormOf";
|
||||
public static final String IS_OBSOLETED_BY = "IsObsoletedBy";
|
||||
public static final String OBSOLETES = "Obsoletes";
|
||||
|
||||
public static final String RESULT_PROJECT = "resultProject"; // relType
|
||||
public static final String OUTCOME = "outcome"; // subreltype
|
||||
public static final String IS_PRODUCED_BY = "isProducedBy";
|
||||
public static final String PRODUCES = "produces";
|
||||
|
||||
public static final String DATASOURCE_ORGANIZATION = "datasourceOrganization"; // relType
|
||||
public static final String PROVISION = "provision"; // subreltype
|
||||
public static final String IS_PROVIDED_BY = "isProvidedBy";
|
||||
public static final String PROVIDES = "provides";
|
||||
|
||||
public static final String PROJECT_ORGANIZATION = "projectOrganization"; // relType
|
||||
public static final String PARTICIPATION = "participation"; // subreltype
|
||||
public static final String HAS_PARTICIPANT = "hasParticipant";
|
||||
public static final String IS_PARTICIPANT = "isParticipant";
|
||||
|
||||
public static final String RESULT_ORGANIZATION = "resultOrganization"; // relType
|
||||
public static final String AFFILIATION = "affiliation"; // subreltype
|
||||
public static final String IS_AUTHOR_INSTITUTION_OF = "isAuthorInstitutionOf";
|
||||
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";
|
||||
public static final String IS_MERGED_IN = "isMergedIn";
|
||||
|
||||
public static final String SIMILARITY = "similarity"; // subreltype
|
||||
public static final String IS_SIMILAR_TO = "isSimilarTo";
|
||||
public static final String IS_AMONG_TOP_N_SIMILAR_DOCS = "IsAmongTopNSimilarDocuments";
|
||||
public static final String HAS_AMONG_TOP_N_SIMILAR_DOCS = "HasAmongTopNSimilarDocuments";
|
||||
|
||||
public static final String IS_DIFFERENT_FROM = "isDifferentFrom";
|
||||
|
||||
public static final String UNKNOWN = "UNKNOWN";
|
||||
public static final String NOT_AVAILABLE = "not available";
|
||||
|
||||
public static final Qualifier PUBLICATION_DEFAULT_RESULTTYPE = qualifier(
|
||||
PUBLICATION_RESULTTYPE_CLASSID, PUBLICATION_RESULTTYPE_CLASSID,
|
||||
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
public static final Qualifier DATASET_DEFAULT_RESULTTYPE = qualifier(
|
||||
DATASET_RESULTTYPE_CLASSID, DATASET_RESULTTYPE_CLASSID,
|
||||
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
public static final Qualifier SOFTWARE_DEFAULT_RESULTTYPE = qualifier(
|
||||
SOFTWARE_RESULTTYPE_CLASSID, SOFTWARE_RESULTTYPE_CLASSID,
|
||||
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
public static final Qualifier ORP_DEFAULT_RESULTTYPE = qualifier(
|
||||
ORP_RESULTTYPE_CLASSID, ORP_RESULTTYPE_CLASSID,
|
||||
DNET_RESULT_TYPOLOGIES, DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
public static final Qualifier REPOSITORY_PROVENANCE_ACTIONS = qualifier(
|
||||
SYSIMPORT_CROSSWALK_REPOSITORY, SYSIMPORT_CROSSWALK_REPOSITORY,
|
||||
DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS);
|
||||
|
||||
public static final Qualifier ENTITYREGISTRY_PROVENANCE_ACTION = qualifier(
|
||||
SYSIMPORT_CROSSWALK_ENTITYREGISTRY, SYSIMPORT_CROSSWALK_ENTITYREGISTRY,
|
||||
DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS);
|
||||
|
||||
public static final String UNKNOWN_REPOSITORY_ORIGINALID = "openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18";
|
||||
public static final KeyValue UNKNOWN_REPOSITORY = keyValue(
|
||||
"10|openaire____::55045bd2a65019fd8e6741a755395c8c", "Unknown Repository");
|
||||
|
||||
public static final Qualifier UNKNOWN_COUNTRY = qualifier(UNKNOWN, "Unknown", DNET_COUNTRY_TYPE, DNET_COUNTRY_TYPE);
|
||||
|
||||
public static final Qualifier MAIN_TITLE_QUALIFIER = qualifier(
|
||||
"main title", "main title", DNET_DATACITE_TITLE, DNET_DATACITE_TITLE);
|
||||
|
||||
public static final AccessRight OPEN_ACCESS_RIGHT() {
|
||||
|
||||
final AccessRight result = new AccessRight();
|
||||
result.setClassid(ACCESS_RIGHT_OPEN);
|
||||
result.setClassid(ACCESS_RIGHT_OPEN);
|
||||
result.setSchemeid(ModelConstants.DNET_ACCESS_MODES);
|
||||
result.setSchemename(ModelConstants.DNET_ACCESS_MODES);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Qualifier qualifier(
|
||||
final String classid,
|
||||
final String classname,
|
||||
final String schemeid,
|
||||
final String schemename) {
|
||||
final Qualifier q = new Qualifier();
|
||||
q.setClassid(classid);
|
||||
q.setClassname(classname);
|
||||
q.setSchemeid(schemeid);
|
||||
q.setSchemename(schemename);
|
||||
return q;
|
||||
}
|
||||
|
||||
private static KeyValue keyValue(final String key, final String value) {
|
||||
final KeyValue kv = new KeyValue();
|
||||
kv.setKey(key);
|
||||
kv.setValue(value);
|
||||
kv.setDataInfo(new DataInfo());
|
||||
return kv;
|
||||
}
|
||||
}
|
|
@ -1,412 +0,0 @@
|
|||
|
||||
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;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.github.sisyphsu.dateparser.DateParserUtils;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.*;
|
||||
|
||||
/** Oaf model utility methods. */
|
||||
public class ModelSupport {
|
||||
|
||||
/** Defines the mapping between the actual entity type and the main entity type */
|
||||
private static final Map<EntityType, MainEntityType> entityMapping = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
entityMapping.put(EntityType.publication, MainEntityType.result);
|
||||
entityMapping.put(EntityType.dataset, MainEntityType.result);
|
||||
entityMapping.put(EntityType.otherresearchproduct, MainEntityType.result);
|
||||
entityMapping.put(EntityType.software, MainEntityType.result);
|
||||
entityMapping.put(EntityType.datasource, MainEntityType.datasource);
|
||||
entityMapping.put(EntityType.organization, MainEntityType.organization);
|
||||
entityMapping.put(EntityType.project, MainEntityType.project);
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the mapping between the actual entity types and the relative classes implementing them
|
||||
*/
|
||||
public static final Map<EntityType, Class> entityTypes = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
entityTypes.put(EntityType.datasource, Datasource.class);
|
||||
entityTypes.put(EntityType.organization, Organization.class);
|
||||
entityTypes.put(EntityType.project, Project.class);
|
||||
entityTypes.put(EntityType.dataset, Dataset.class);
|
||||
entityTypes.put(EntityType.otherresearchproduct, OtherResearchProduct.class);
|
||||
entityTypes.put(EntityType.software, Software.class);
|
||||
entityTypes.put(EntityType.publication, Publication.class);
|
||||
}
|
||||
|
||||
public static final Map<String, Class> oafTypes = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
oafTypes.put("datasource", Datasource.class);
|
||||
oafTypes.put("organization", Organization.class);
|
||||
oafTypes.put("project", Project.class);
|
||||
oafTypes.put("dataset", Dataset.class);
|
||||
oafTypes.put("otherresearchproduct", OtherResearchProduct.class);
|
||||
oafTypes.put("software", Software.class);
|
||||
oafTypes.put("publication", Publication.class);
|
||||
oafTypes.put("relation", Relation.class);
|
||||
}
|
||||
|
||||
public static final Map<Class, String> idPrefixMap = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
idPrefixMap.put(Datasource.class, "10");
|
||||
idPrefixMap.put(Organization.class, "20");
|
||||
idPrefixMap.put(Project.class, "40");
|
||||
idPrefixMap.put(Dataset.class, "50");
|
||||
idPrefixMap.put(OtherResearchProduct.class, "50");
|
||||
idPrefixMap.put(Software.class, "50");
|
||||
idPrefixMap.put(Publication.class, "50");
|
||||
}
|
||||
|
||||
public static final Map<String, String> entityIdPrefix = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
entityIdPrefix.put("datasource", "10");
|
||||
entityIdPrefix.put("organization", "20");
|
||||
entityIdPrefix.put("project", "40");
|
||||
entityIdPrefix.put("result", "50");
|
||||
}
|
||||
|
||||
public static final Map<String, String> idPrefixEntity = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
idPrefixEntity.put("10", "datasource");
|
||||
idPrefixEntity.put("20", "organization");
|
||||
idPrefixEntity.put("40", "project");
|
||||
idPrefixEntity.put("50", "result");
|
||||
}
|
||||
|
||||
public static final Map<String, RelationInverse> relationInverseMap = Maps.newHashMap();
|
||||
|
||||
static {
|
||||
set(relationInverseMap, PROJECT_ORGANIZATION, PARTICIPATION, IS_PARTICIPANT, HAS_PARTICIPANT);
|
||||
|
||||
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_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);
|
||||
|
||||
|
||||
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";
|
||||
|
||||
public static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
|
||||
private ModelSupport() {
|
||||
}
|
||||
|
||||
public static <E extends OafEntity> String getIdPrefix(Class<E> clazz) {
|
||||
return idPrefixMap.get(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks subclass-superclass relationship.
|
||||
*
|
||||
* @param subClazzObject Subclass object instance
|
||||
* @param superClazzObject Superclass object instance
|
||||
* @param <X> Subclass type
|
||||
* @param <Y> Superclass type
|
||||
* @return True if X is a subclass of Y
|
||||
*/
|
||||
public static <X extends Oaf, Y extends Oaf> Boolean isSubClass(
|
||||
X subClazzObject, Y superClazzObject) {
|
||||
return isSubClass(subClazzObject.getClass(), superClazzObject.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks subclass-superclass relationship.
|
||||
*
|
||||
* @param subClazzObject Subclass object instance
|
||||
* @param superClazz Superclass class
|
||||
* @param <X> Subclass type
|
||||
* @param <Y> Superclass type
|
||||
* @return True if X is a subclass of Y
|
||||
*/
|
||||
public static <X extends Oaf, Y extends Oaf> Boolean isSubClass(
|
||||
X subClazzObject, Class<Y> superClazz) {
|
||||
return isSubClass(subClazzObject.getClass(), superClazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks subclass-superclass relationship.
|
||||
*
|
||||
* @param subClazz Subclass class
|
||||
* @param superClazz Superclass class
|
||||
* @param <X> Subclass type
|
||||
* @param <Y> Superclass type
|
||||
* @return True if X is a subclass of Y
|
||||
*/
|
||||
public static <X extends Oaf, Y extends Oaf> Boolean isSubClass(
|
||||
Class<X> subClazz, Class<Y> superClazz) {
|
||||
return superClazz.isAssignableFrom(subClazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all the OAF model classes
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T extends Oaf> Class<T>[] getOafModelClasses() {
|
||||
return new Class[] {
|
||||
Author.class,
|
||||
Context.class,
|
||||
Country.class,
|
||||
DataInfo.class,
|
||||
Dataset.class,
|
||||
Datasource.class,
|
||||
ExternalReference.class,
|
||||
ExtraInfo.class,
|
||||
Field.class,
|
||||
GeoLocation.class,
|
||||
Instance.class,
|
||||
AccessRight.class,
|
||||
OpenAccessRoute.class,
|
||||
Journal.class,
|
||||
KeyValue.class,
|
||||
Oaf.class,
|
||||
OafEntity.class,
|
||||
OAIProvenance.class,
|
||||
Organization.class,
|
||||
OriginDescription.class,
|
||||
OtherResearchProduct.class,
|
||||
Project.class,
|
||||
Publication.class,
|
||||
Qualifier.class,
|
||||
Relation.class,
|
||||
Result.class,
|
||||
Software.class,
|
||||
StructuredProperty.class
|
||||
};
|
||||
}
|
||||
|
||||
public static String getMainType(final EntityType type) {
|
||||
return entityMapping.get(type).name();
|
||||
}
|
||||
|
||||
public static boolean isResult(EntityType type) {
|
||||
return MainEntityType.result.name().equals(getMainType(type));
|
||||
}
|
||||
|
||||
public static String getScheme(final String sourceType, final String targetType) {
|
||||
return String
|
||||
.format(
|
||||
schemeTemplate,
|
||||
entityMapping.get(EntityType.valueOf(sourceType)).name(),
|
||||
entityMapping.get(EntityType.valueOf(targetType)).name());
|
||||
}
|
||||
|
||||
public static <T extends Oaf> String tableIdentifier(String dbName, String tableName) {
|
||||
|
||||
checkArgument(StringUtils.isNotBlank(dbName), "DB name cannot be empty");
|
||||
checkArgument(StringUtils.isNotBlank(tableName), "table name cannot be empty");
|
||||
|
||||
return String.format("%s.%s", dbName, tableName);
|
||||
}
|
||||
|
||||
public static <T extends Oaf> String tableIdentifier(String dbName, Class<T> clazz) {
|
||||
|
||||
checkArgument(Objects.nonNull(clazz), "clazz is needed to derive the table name, thus cannot be null");
|
||||
|
||||
return tableIdentifier(dbName, clazz.getSimpleName().toLowerCase());
|
||||
}
|
||||
|
||||
public static <T extends Oaf> Function<T, String> idFn() {
|
||||
return x -> {
|
||||
if (isSubClass(x, Relation.class)) {
|
||||
return idFnForRelation(x);
|
||||
}
|
||||
return idFnForOafEntity(x);
|
||||
};
|
||||
}
|
||||
|
||||
private static <T extends Oaf> String idFnForRelation(T t) {
|
||||
Relation r = (Relation) t;
|
||||
return Optional
|
||||
.ofNullable(r.getSource())
|
||||
.map(
|
||||
source -> Optional
|
||||
.ofNullable(r.getTarget())
|
||||
.map(
|
||||
target -> Optional
|
||||
.ofNullable(r.getRelType())
|
||||
.map(
|
||||
relType -> Optional
|
||||
.ofNullable(r.getSubRelType())
|
||||
.map(
|
||||
subRelType -> Optional
|
||||
.ofNullable(r.getRelClass())
|
||||
.map(
|
||||
relClass -> String
|
||||
.join(
|
||||
source,
|
||||
target,
|
||||
relType,
|
||||
subRelType,
|
||||
relClass))
|
||||
.orElse(
|
||||
String
|
||||
.join(
|
||||
source,
|
||||
target,
|
||||
relType,
|
||||
subRelType)))
|
||||
.orElse(String.join(source, target, relType)))
|
||||
.orElse(String.join(source, target)))
|
||||
.orElse(source))
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
private static <T extends Oaf> String idFnForOafEntity(T t) {
|
||||
return ((OafEntity) t).getId();
|
||||
}
|
||||
|
||||
public static String md5(final String s) {
|
||||
try {
|
||||
final MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(s.getBytes(StandardCharsets.UTF_8));
|
||||
return new String(Hex.encodeHex(md.digest()));
|
||||
} catch (final NoSuchAlgorithmException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String generateIdentifier(final String originalId, final String nsPrefix) {
|
||||
return String.format("%s::%s", nsPrefix, md5(originalId));
|
||||
}
|
||||
|
||||
public static String oldest(String dateA, String dateB) throws ParseException {
|
||||
|
||||
if (StringUtils.isBlank(dateA)) {
|
||||
return dateB;
|
||||
}
|
||||
if (StringUtils.isBlank(dateB)) {
|
||||
return dateA;
|
||||
}
|
||||
if (StringUtils.isNotBlank(dateA) && StringUtils.isNotBlank(dateB)) {
|
||||
|
||||
final Date a = DateParserUtils.parseDate(dateA);
|
||||
final Date b = DateParserUtils.parseDate(dateB);
|
||||
|
||||
if (Objects.nonNull(a) && Objects.nonNull(b)) {
|
||||
return a.before(b) ? dateA : dateB;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
public class RelationInverse {
|
||||
private String relClass;
|
||||
private String inverseRelClass;
|
||||
private String relType;
|
||||
private String subReltype;
|
||||
|
||||
public String getRelType() {
|
||||
return relType;
|
||||
}
|
||||
|
||||
public RelationInverse setRelType(String relType) {
|
||||
this.relType = relType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSubReltype() {
|
||||
return subReltype;
|
||||
}
|
||||
|
||||
public RelationInverse setSubReltype(String subReltype) {
|
||||
this.subReltype = subReltype;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRelClass() {
|
||||
return relClass;
|
||||
}
|
||||
|
||||
public RelationInverse setRelClass(String relClass) {
|
||||
this.relClass = relClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getInverseRelClass() {
|
||||
return inverseRelClass;
|
||||
}
|
||||
|
||||
public RelationInverse setInverseRelClass(String inverseRelClass) {
|
||||
this.inverseRelClass = inverseRelClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
|
@ -3,8 +3,6 @@ package eu.dnetlib.dhp.schema.mdstore;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
|
||||
/**
|
||||
* This class models a record in a Metadata store collection on HDFS
|
||||
*/
|
||||
|
@ -38,6 +36,7 @@ public class MetadataRecord implements Serializable {
|
|||
}
|
||||
|
||||
public MetadataRecord(
|
||||
String id,
|
||||
String originalId,
|
||||
String encoding,
|
||||
Provenance provenance,
|
||||
|
@ -49,7 +48,7 @@ public class MetadataRecord implements Serializable {
|
|||
this.provenance = provenance;
|
||||
this.body = body;
|
||||
this.dateOfCollection = dateOfCollection;
|
||||
this.id = ModelSupport.generateIdentifier(originalId, this.provenance.getNsPrefix());
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -15,9 +15,7 @@ public class Author implements Serializable {
|
|||
// START WITH 1
|
||||
private Integer rank;
|
||||
|
||||
private List<StructuredProperty> pid;
|
||||
|
||||
private List<Field<String>> affiliation;
|
||||
private List<AuthorPid> pid;
|
||||
|
||||
public String getFullname() {
|
||||
return fullname;
|
||||
|
@ -51,22 +49,14 @@ public class Author implements Serializable {
|
|||
this.rank = rank;
|
||||
}
|
||||
|
||||
public List<StructuredProperty> getPid() {
|
||||
public List<AuthorPid> getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(List<StructuredProperty> pid) {
|
||||
public void setPid(List<AuthorPid> pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public List<Field<String>> getAffiliation() {
|
||||
return affiliation;
|
||||
}
|
||||
|
||||
public void setAffiliation(List<Field<String>> affiliation) {
|
||||
this.affiliation = affiliation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
|
@ -78,13 +68,12 @@ public class Author implements Serializable {
|
|||
&& Objects.equals(name, author.name)
|
||||
&& Objects.equals(surname, author.surname)
|
||||
&& Objects.equals(rank, author.rank)
|
||||
&& Objects.equals(pid, author.pid)
|
||||
&& Objects.equals(affiliation, author.affiliation);
|
||||
&& Objects.equals(pid, author.pid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(fullname, name, surname, rank, pid, affiliation);
|
||||
return Objects.hash(fullname, name, surname, rank, pid);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AuthorPid extends StructuredProperty implements Serializable {
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
}
|
|
@ -6,21 +6,11 @@ import java.util.Objects;
|
|||
|
||||
public class DataInfo implements Serializable {
|
||||
|
||||
private Boolean invisible = false;
|
||||
private Boolean inferred;
|
||||
private Boolean deletedbyinference = false;
|
||||
private String trust;
|
||||
private Float trust;
|
||||
private String inferenceprovenance;
|
||||
private Qualifier provenanceaction;
|
||||
|
||||
public Boolean getInvisible() {
|
||||
return invisible;
|
||||
}
|
||||
|
||||
public void setInvisible(Boolean invisible) {
|
||||
this.invisible = invisible;
|
||||
}
|
||||
|
||||
public Boolean getInferred() {
|
||||
return inferred;
|
||||
}
|
||||
|
@ -29,19 +19,11 @@ public class DataInfo implements Serializable {
|
|||
this.inferred = inferred;
|
||||
}
|
||||
|
||||
public Boolean getDeletedbyinference() {
|
||||
return deletedbyinference;
|
||||
}
|
||||
|
||||
public void setDeletedbyinference(Boolean deletedbyinference) {
|
||||
this.deletedbyinference = deletedbyinference;
|
||||
}
|
||||
|
||||
public String getTrust() {
|
||||
public Float getTrust() {
|
||||
return trust;
|
||||
}
|
||||
|
||||
public void setTrust(String trust) {
|
||||
public void setTrust(Float trust) {
|
||||
this.trust = trust;
|
||||
}
|
||||
|
||||
|
@ -68,9 +50,7 @@ public class DataInfo implements Serializable {
|
|||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
DataInfo dataInfo = (DataInfo) o;
|
||||
return Objects.equals(invisible, dataInfo.invisible)
|
||||
&& Objects.equals(inferred, dataInfo.inferred)
|
||||
&& Objects.equals(deletedbyinference, dataInfo.deletedbyinference)
|
||||
return Objects.equals(inferred, dataInfo.inferred)
|
||||
&& Objects.equals(trust, dataInfo.trust)
|
||||
&& Objects.equals(inferenceprovenance, dataInfo.inferenceprovenance)
|
||||
&& Objects.equals(provenanceaction, dataInfo.provenanceaction);
|
||||
|
@ -80,6 +60,6 @@ public class DataInfo implements Serializable {
|
|||
public int hashCode() {
|
||||
return Objects
|
||||
.hash(
|
||||
invisible, inferred, deletedbyinference, trust, inferenceprovenance, provenanceaction);
|
||||
inferred, trust, inferenceprovenance, provenanceaction);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,74 +4,72 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
|
||||
public class Dataset extends Result implements Serializable {
|
||||
|
||||
private Field<String> storagedate;
|
||||
private String storagedate;
|
||||
|
||||
// candidate for removal
|
||||
private Field<String> device;
|
||||
private String device;
|
||||
|
||||
private Field<String> size;
|
||||
private String size;
|
||||
|
||||
private Field<String> version;
|
||||
private String version;
|
||||
|
||||
private Field<String> lastmetadataupdate;
|
||||
private String lastmetadataupdate;
|
||||
|
||||
private Field<String> metadataversionnumber;
|
||||
private String metadataversionnumber;
|
||||
|
||||
private List<GeoLocation> geolocation;
|
||||
|
||||
public Dataset() {
|
||||
setResulttype(ModelConstants.DATASET_DEFAULT_RESULTTYPE);
|
||||
setResulttype(RESULTTYPE.dataset);
|
||||
}
|
||||
|
||||
public Field<String> getStoragedate() {
|
||||
public String getStoragedate() {
|
||||
return storagedate;
|
||||
}
|
||||
|
||||
public void setStoragedate(Field<String> storagedate) {
|
||||
public void setStoragedate(String storagedate) {
|
||||
this.storagedate = storagedate;
|
||||
}
|
||||
|
||||
public Field<String> getDevice() {
|
||||
public String getDevice() {
|
||||
return device;
|
||||
}
|
||||
|
||||
public void setDevice(Field<String> device) {
|
||||
public void setDevice(String device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
public Field<String> getSize() {
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(Field<String> size) {
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public Field<String> getVersion() {
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Field<String> version) {
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Field<String> getLastmetadataupdate() {
|
||||
public String getLastmetadataupdate() {
|
||||
return lastmetadataupdate;
|
||||
}
|
||||
|
||||
public void setLastmetadataupdate(Field<String> lastmetadataupdate) {
|
||||
public void setLastmetadataupdate(String lastmetadataupdate) {
|
||||
this.lastmetadataupdate = lastmetadataupdate;
|
||||
}
|
||||
|
||||
public Field<String> getMetadataversionnumber() {
|
||||
public String getMetadataversionnumber() {
|
||||
return metadataversionnumber;
|
||||
}
|
||||
|
||||
public void setMetadataversionnumber(Field<String> metadataversionnumber) {
|
||||
public void setMetadataversionnumber(String metadataversionnumber) {
|
||||
this.metadataversionnumber = metadataversionnumber;
|
||||
}
|
||||
|
||||
|
@ -82,35 +80,4 @@ public class Dataset extends Result implements Serializable {
|
|||
public void setGeolocation(List<GeoLocation> geolocation) {
|
||||
this.geolocation = geolocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
if (!Dataset.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Dataset d = (Dataset) e;
|
||||
|
||||
storagedate = d.getStoragedate() != null && compareTrust(this, e) < 0 ? d.getStoragedate() : storagedate;
|
||||
|
||||
device = d.getDevice() != null && compareTrust(this, e) < 0 ? d.getDevice() : device;
|
||||
|
||||
size = d.getSize() != null && compareTrust(this, e) < 0 ? d.getSize() : size;
|
||||
|
||||
version = d.getVersion() != null && compareTrust(this, e) < 0 ? d.getVersion() : version;
|
||||
|
||||
lastmetadataupdate = d.getLastmetadataupdate() != null && compareTrust(this, e) < 0
|
||||
? d.getLastmetadataupdate()
|
||||
: lastmetadataupdate;
|
||||
|
||||
metadataversionnumber = d.getMetadataversionnumber() != null && compareTrust(this, e) < 0
|
||||
? d.getMetadataversionnumber()
|
||||
: metadataversionnumber;
|
||||
|
||||
geolocation = mergeLists(geolocation, d.getGeolocation());
|
||||
|
||||
mergeOAFDataInfo(d);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,8 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class Datasource extends OafEntity implements Serializable {
|
||||
public class Datasource extends Entity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1019089598408414496L;
|
||||
|
||||
@Deprecated
|
||||
|
@ -23,83 +20,83 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
|
||||
private Qualifier openairecompatibility;
|
||||
|
||||
private Field<String> officialname;
|
||||
private String officialname;
|
||||
|
||||
private Field<String> englishname;
|
||||
private String englishname;
|
||||
|
||||
private Field<String> websiteurl;
|
||||
private String websiteurl;
|
||||
|
||||
private Field<String> logourl;
|
||||
private String logourl;
|
||||
|
||||
private Field<String> contactemail;
|
||||
private String contactemail;
|
||||
|
||||
private Field<String> namespaceprefix;
|
||||
private String namespaceprefix;
|
||||
|
||||
private Field<String> latitude;
|
||||
private String latitude;
|
||||
|
||||
private Field<String> longitude;
|
||||
private String longitude;
|
||||
|
||||
private Field<String> dateofvalidation;
|
||||
private String dateofvalidation;
|
||||
|
||||
private Field<String> description;
|
||||
private String description;
|
||||
|
||||
private List<StructuredProperty> subjects;
|
||||
|
||||
// opendoar specific fields (od*)
|
||||
@Deprecated
|
||||
private Field<String> odnumberofitems;
|
||||
private String odnumberofitems;
|
||||
|
||||
@Deprecated
|
||||
private Field<String> odnumberofitemsdate;
|
||||
private String odnumberofitemsdate;
|
||||
|
||||
@Deprecated
|
||||
private Field<String> odpolicies;
|
||||
private String odpolicies;
|
||||
|
||||
@Deprecated
|
||||
private List<Field<String>> odlanguages;
|
||||
private List<String> odlanguages;
|
||||
|
||||
private List<String> languages;
|
||||
|
||||
@Deprecated
|
||||
private List<Field<String>> odcontenttypes;
|
||||
private List<String> odcontenttypes;
|
||||
|
||||
private List<Field<String>> accessinfopackage;
|
||||
private List<String> accessinfopackage;
|
||||
|
||||
// re3data fields
|
||||
private Field<String> releasestartdate;
|
||||
private String releasestartdate;
|
||||
|
||||
private Field<String> releaseenddate;
|
||||
private String releaseenddate;
|
||||
|
||||
private Field<String> missionstatementurl;
|
||||
private String missionstatementurl;
|
||||
|
||||
@Deprecated
|
||||
private Field<Boolean> dataprovider;
|
||||
private Boolean dataprovider;
|
||||
|
||||
@Deprecated
|
||||
private Field<Boolean> serviceprovider;
|
||||
private Boolean serviceprovider;
|
||||
|
||||
// {open, restricted or closed}
|
||||
private Field<String> databaseaccesstype;
|
||||
private String databaseaccesstype;
|
||||
|
||||
// {open, restricted or closed}
|
||||
private Field<String> datauploadtype;
|
||||
private String datauploadtype;
|
||||
|
||||
// {feeRequired, registration, other}
|
||||
private Field<String> databaseaccessrestriction;
|
||||
private String databaseaccessrestriction;
|
||||
|
||||
// {feeRequired, registration, other}
|
||||
private Field<String> datauploadrestriction;
|
||||
private String datauploadrestriction;
|
||||
|
||||
@Deprecated
|
||||
private Field<Boolean> versioning;
|
||||
private Boolean versioning;
|
||||
|
||||
private Boolean versioncontrol;
|
||||
|
||||
private Field<String> citationguidelineurl;
|
||||
private String citationguidelineurl;
|
||||
|
||||
private Field<String> pidsystems;
|
||||
private String pidsystems;
|
||||
|
||||
private Field<String> certificates;
|
||||
private String certificates;
|
||||
|
||||
@Deprecated
|
||||
private List<KeyValue> policies;
|
||||
|
@ -146,7 +143,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return datasourcetype;
|
||||
}
|
||||
|
||||
public void setDatasourcetype(final Qualifier datasourcetype) {
|
||||
public void setDatasourcetype(Qualifier datasourcetype) {
|
||||
this.datasourcetype = datasourcetype;
|
||||
}
|
||||
|
||||
|
@ -154,7 +151,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return datasourcetypeui;
|
||||
}
|
||||
|
||||
public void setDatasourcetypeui(final Qualifier datasourcetypeui) {
|
||||
public void setDatasourcetypeui(Qualifier datasourcetypeui) {
|
||||
this.datasourcetypeui = datasourcetypeui;
|
||||
}
|
||||
|
||||
|
@ -178,87 +175,87 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return openairecompatibility;
|
||||
}
|
||||
|
||||
public void setOpenairecompatibility(final Qualifier openairecompatibility) {
|
||||
public void setOpenairecompatibility(Qualifier openairecompatibility) {
|
||||
this.openairecompatibility = openairecompatibility;
|
||||
}
|
||||
|
||||
public Field<String> getOfficialname() {
|
||||
public String getOfficialname() {
|
||||
return officialname;
|
||||
}
|
||||
|
||||
public void setOfficialname(final Field<String> officialname) {
|
||||
public void setOfficialname(String officialname) {
|
||||
this.officialname = officialname;
|
||||
}
|
||||
|
||||
public Field<String> getEnglishname() {
|
||||
public String getEnglishname() {
|
||||
return englishname;
|
||||
}
|
||||
|
||||
public void setEnglishname(final Field<String> englishname) {
|
||||
public void setEnglishname(String englishname) {
|
||||
this.englishname = englishname;
|
||||
}
|
||||
|
||||
public Field<String> getWebsiteurl() {
|
||||
public String getWebsiteurl() {
|
||||
return websiteurl;
|
||||
}
|
||||
|
||||
public void setWebsiteurl(final Field<String> websiteurl) {
|
||||
public void setWebsiteurl(String websiteurl) {
|
||||
this.websiteurl = websiteurl;
|
||||
}
|
||||
|
||||
public Field<String> getLogourl() {
|
||||
public String getLogourl() {
|
||||
return logourl;
|
||||
}
|
||||
|
||||
public void setLogourl(final Field<String> logourl) {
|
||||
public void setLogourl(String logourl) {
|
||||
this.logourl = logourl;
|
||||
}
|
||||
|
||||
public Field<String> getContactemail() {
|
||||
public String getContactemail() {
|
||||
return contactemail;
|
||||
}
|
||||
|
||||
public void setContactemail(final Field<String> contactemail) {
|
||||
public void setContactemail(String contactemail) {
|
||||
this.contactemail = contactemail;
|
||||
}
|
||||
|
||||
public Field<String> getNamespaceprefix() {
|
||||
public String getNamespaceprefix() {
|
||||
return namespaceprefix;
|
||||
}
|
||||
|
||||
public void setNamespaceprefix(final Field<String> namespaceprefix) {
|
||||
public void setNamespaceprefix(String namespaceprefix) {
|
||||
this.namespaceprefix = namespaceprefix;
|
||||
}
|
||||
|
||||
public Field<String> getLatitude() {
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(final Field<String> latitude) {
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public Field<String> getLongitude() {
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(final Field<String> longitude) {
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public Field<String> getDateofvalidation() {
|
||||
public String getDateofvalidation() {
|
||||
return dateofvalidation;
|
||||
}
|
||||
|
||||
public void setDateofvalidation(final Field<String> dateofvalidation) {
|
||||
public void setDateofvalidation(String dateofvalidation) {
|
||||
this.dateofvalidation = dateofvalidation;
|
||||
}
|
||||
|
||||
public Field<String> getDescription() {
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final Field<String> description) {
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
@ -266,39 +263,39 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return subjects;
|
||||
}
|
||||
|
||||
public void setSubjects(final List<StructuredProperty> subjects) {
|
||||
public void setSubjects(List<StructuredProperty> subjects) {
|
||||
this.subjects = subjects;
|
||||
}
|
||||
|
||||
public Field<String> getOdnumberofitems() {
|
||||
public String getOdnumberofitems() {
|
||||
return odnumberofitems;
|
||||
}
|
||||
|
||||
public void setOdnumberofitems(final Field<String> odnumberofitems) {
|
||||
public void setOdnumberofitems(String odnumberofitems) {
|
||||
this.odnumberofitems = odnumberofitems;
|
||||
}
|
||||
|
||||
public Field<String> getOdnumberofitemsdate() {
|
||||
public String getOdnumberofitemsdate() {
|
||||
return odnumberofitemsdate;
|
||||
}
|
||||
|
||||
public void setOdnumberofitemsdate(final Field<String> odnumberofitemsdate) {
|
||||
public void setOdnumberofitemsdate(String odnumberofitemsdate) {
|
||||
this.odnumberofitemsdate = odnumberofitemsdate;
|
||||
}
|
||||
|
||||
public Field<String> getOdpolicies() {
|
||||
public String getOdpolicies() {
|
||||
return odpolicies;
|
||||
}
|
||||
|
||||
public void setOdpolicies(final Field<String> odpolicies) {
|
||||
public void setOdpolicies(String odpolicies) {
|
||||
this.odpolicies = odpolicies;
|
||||
}
|
||||
|
||||
public List<Field<String>> getOdlanguages() {
|
||||
public List<String> getOdlanguages() {
|
||||
return odlanguages;
|
||||
}
|
||||
|
||||
public void setOdlanguages(final List<Field<String>> odlanguages) {
|
||||
public void setOdlanguages(List<String> odlanguages) {
|
||||
this.odlanguages = odlanguages;
|
||||
}
|
||||
|
||||
|
@ -306,103 +303,103 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return languages;
|
||||
}
|
||||
|
||||
public void setLanguages(final List<String> languages) {
|
||||
public void setLanguages(List<String> languages) {
|
||||
this.languages = languages;
|
||||
}
|
||||
|
||||
public List<Field<String>> getOdcontenttypes() {
|
||||
public List<String> getOdcontenttypes() {
|
||||
return odcontenttypes;
|
||||
}
|
||||
|
||||
public void setOdcontenttypes(final List<Field<String>> odcontenttypes) {
|
||||
public void setOdcontenttypes(List<String> odcontenttypes) {
|
||||
this.odcontenttypes = odcontenttypes;
|
||||
}
|
||||
|
||||
public List<Field<String>> getAccessinfopackage() {
|
||||
public List<String> getAccessinfopackage() {
|
||||
return accessinfopackage;
|
||||
}
|
||||
|
||||
public void setAccessinfopackage(final List<Field<String>> accessinfopackage) {
|
||||
public void setAccessinfopackage(List<String> accessinfopackage) {
|
||||
this.accessinfopackage = accessinfopackage;
|
||||
}
|
||||
|
||||
public Field<String> getReleasestartdate() {
|
||||
public String getReleasestartdate() {
|
||||
return releasestartdate;
|
||||
}
|
||||
|
||||
public void setReleasestartdate(final Field<String> releasestartdate) {
|
||||
public void setReleasestartdate(String releasestartdate) {
|
||||
this.releasestartdate = releasestartdate;
|
||||
}
|
||||
|
||||
public Field<String> getReleaseenddate() {
|
||||
public String getReleaseenddate() {
|
||||
return releaseenddate;
|
||||
}
|
||||
|
||||
public void setReleaseenddate(final Field<String> releaseenddate) {
|
||||
public void setReleaseenddate(String releaseenddate) {
|
||||
this.releaseenddate = releaseenddate;
|
||||
}
|
||||
|
||||
public Field<String> getMissionstatementurl() {
|
||||
public String getMissionstatementurl() {
|
||||
return missionstatementurl;
|
||||
}
|
||||
|
||||
public void setMissionstatementurl(final Field<String> missionstatementurl) {
|
||||
public void setMissionstatementurl(String missionstatementurl) {
|
||||
this.missionstatementurl = missionstatementurl;
|
||||
}
|
||||
|
||||
public Field<Boolean> getDataprovider() {
|
||||
public Boolean getDataprovider() {
|
||||
return dataprovider;
|
||||
}
|
||||
|
||||
public void setDataprovider(final Field<Boolean> dataprovider) {
|
||||
public void setDataprovider(Boolean dataprovider) {
|
||||
this.dataprovider = dataprovider;
|
||||
}
|
||||
|
||||
public Field<Boolean> getServiceprovider() {
|
||||
public Boolean getServiceprovider() {
|
||||
return serviceprovider;
|
||||
}
|
||||
|
||||
public void setServiceprovider(final Field<Boolean> serviceprovider) {
|
||||
public void setServiceprovider(Boolean serviceprovider) {
|
||||
this.serviceprovider = serviceprovider;
|
||||
}
|
||||
|
||||
public Field<String> getDatabaseaccesstype() {
|
||||
public String getDatabaseaccesstype() {
|
||||
return databaseaccesstype;
|
||||
}
|
||||
|
||||
public void setDatabaseaccesstype(final Field<String> databaseaccesstype) {
|
||||
public void setDatabaseaccesstype(String databaseaccesstype) {
|
||||
this.databaseaccesstype = databaseaccesstype;
|
||||
}
|
||||
|
||||
public Field<String> getDatauploadtype() {
|
||||
public String getDatauploadtype() {
|
||||
return datauploadtype;
|
||||
}
|
||||
|
||||
public void setDatauploadtype(final Field<String> datauploadtype) {
|
||||
public void setDatauploadtype(String datauploadtype) {
|
||||
this.datauploadtype = datauploadtype;
|
||||
}
|
||||
|
||||
public Field<String> getDatabaseaccessrestriction() {
|
||||
public String getDatabaseaccessrestriction() {
|
||||
return databaseaccessrestriction;
|
||||
}
|
||||
|
||||
public void setDatabaseaccessrestriction(final Field<String> databaseaccessrestriction) {
|
||||
public void setDatabaseaccessrestriction(String databaseaccessrestriction) {
|
||||
this.databaseaccessrestriction = databaseaccessrestriction;
|
||||
}
|
||||
|
||||
public Field<String> getDatauploadrestriction() {
|
||||
public String getDatauploadrestriction() {
|
||||
return datauploadrestriction;
|
||||
}
|
||||
|
||||
public void setDatauploadrestriction(final Field<String> datauploadrestriction) {
|
||||
public void setDatauploadrestriction(String datauploadrestriction) {
|
||||
this.datauploadrestriction = datauploadrestriction;
|
||||
}
|
||||
|
||||
public Field<Boolean> getVersioning() {
|
||||
public Boolean getVersioning() {
|
||||
return versioning;
|
||||
}
|
||||
|
||||
public void setVersioning(final Field<Boolean> versioning) {
|
||||
public void setVersioning(Boolean versioning) {
|
||||
this.versioning = versioning;
|
||||
}
|
||||
|
||||
|
@ -414,27 +411,27 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
this.versioncontrol = versioncontrol;
|
||||
}
|
||||
|
||||
public Field<String> getCitationguidelineurl() {
|
||||
public String getCitationguidelineurl() {
|
||||
return citationguidelineurl;
|
||||
}
|
||||
|
||||
public void setCitationguidelineurl(final Field<String> citationguidelineurl) {
|
||||
public void setCitationguidelineurl(String citationguidelineurl) {
|
||||
this.citationguidelineurl = citationguidelineurl;
|
||||
}
|
||||
|
||||
public Field<String> getPidsystems() {
|
||||
public String getPidsystems() {
|
||||
return pidsystems;
|
||||
}
|
||||
|
||||
public void setPidsystems(final Field<String> pidsystems) {
|
||||
public void setPidsystems(String pidsystems) {
|
||||
this.pidsystems = pidsystems;
|
||||
}
|
||||
|
||||
public Field<String> getCertificates() {
|
||||
public String getCertificates() {
|
||||
return certificates;
|
||||
}
|
||||
|
||||
public void setCertificates(final Field<String> certificates) {
|
||||
public void setCertificates(String certificates) {
|
||||
this.certificates = certificates;
|
||||
}
|
||||
|
||||
|
@ -442,7 +439,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return policies;
|
||||
}
|
||||
|
||||
public void setPolicies(final List<KeyValue> policies) {
|
||||
public void setPolicies(List<KeyValue> policies) {
|
||||
this.policies = policies;
|
||||
}
|
||||
|
||||
|
@ -450,7 +447,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return journal;
|
||||
}
|
||||
|
||||
public void setJournal(final Journal journal) {
|
||||
public void setJournal(Journal journal) {
|
||||
this.journal = journal;
|
||||
}
|
||||
|
||||
|
@ -458,7 +455,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return researchentitytypes;
|
||||
}
|
||||
|
||||
public void setResearchentitytypes(final List<String> researchentitytypes) {
|
||||
public void setResearchentitytypes(List<String> researchentitytypes) {
|
||||
this.researchentitytypes = researchentitytypes;
|
||||
}
|
||||
|
||||
|
@ -466,7 +463,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return providedproducttypes;
|
||||
}
|
||||
|
||||
public void setProvidedproducttypes(final List<String> providedproducttypes) {
|
||||
public void setProvidedproducttypes(List<String> providedproducttypes) {
|
||||
this.providedproducttypes = providedproducttypes;
|
||||
}
|
||||
|
||||
|
@ -474,7 +471,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return jurisdiction;
|
||||
}
|
||||
|
||||
public void setJurisdiction(final Qualifier jurisdiction) {
|
||||
public void setJurisdiction(Qualifier jurisdiction) {
|
||||
this.jurisdiction = jurisdiction;
|
||||
}
|
||||
|
||||
|
@ -482,7 +479,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return thematic;
|
||||
}
|
||||
|
||||
public void setThematic(final Boolean thematic) {
|
||||
public void setThematic(Boolean thematic) {
|
||||
this.thematic = thematic;
|
||||
}
|
||||
|
||||
|
@ -490,7 +487,7 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return contentpolicies;
|
||||
}
|
||||
|
||||
public void setContentpolicies(final List<Qualifier> contentpolicies) {
|
||||
public void setContentpolicies(List<Qualifier> contentpolicies) {
|
||||
this.contentpolicies = contentpolicies;
|
||||
}
|
||||
|
||||
|
@ -530,10 +527,26 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
return consenttermsofuse;
|
||||
}
|
||||
|
||||
public void setConsenttermsofuse(final Boolean 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;
|
||||
}
|
||||
|
||||
public String getLastconsenttermsofusedate() {
|
||||
return lastconsenttermsofusedate;
|
||||
}
|
||||
|
@ -542,22 +555,6 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
this.lastconsenttermsofusedate = lastconsenttermsofusedate;
|
||||
}
|
||||
|
||||
public Boolean getFulltextdownload() {
|
||||
return fulltextdownload;
|
||||
}
|
||||
|
||||
public void setFulltextdownload(final Boolean fulltextdownload) {
|
||||
this.fulltextdownload = fulltextdownload;
|
||||
}
|
||||
|
||||
public String getConsenttermsofusedate() {
|
||||
return consenttermsofusedate;
|
||||
}
|
||||
|
||||
public void setConsenttermsofusedate(final String consenttermsofusedate) {
|
||||
this.consenttermsofusedate = consenttermsofusedate;
|
||||
}
|
||||
|
||||
public List<EoscIfGuidelines> getEoscifguidelines() {
|
||||
return eoscifguidelines;
|
||||
}
|
||||
|
@ -565,10 +562,4 @@ public class Datasource extends OafEntity implements Serializable {
|
|||
public void setEoscifguidelines(List<EoscIfGuidelines> eoscifguidelines) {
|
||||
this.eoscifguidelines = eoscifguidelines;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(final OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,21 +5,49 @@ import java.io.Serializable;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class OafEntity extends Oaf implements Serializable {
|
||||
public abstract class Entity extends Oaf implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private List<String> originalId;
|
||||
|
||||
/**
|
||||
* The list of datasource id/name pairs providing this Oaf.
|
||||
*/
|
||||
private List<KeyValue> collectedfrom;
|
||||
|
||||
private Long lastupdatetimestamp;
|
||||
|
||||
private List<StructuredProperty> pid;
|
||||
|
||||
private String dateofcollection;
|
||||
|
||||
private String dateoftransformation;
|
||||
|
||||
/**
|
||||
* The Measures.
|
||||
*/
|
||||
private List<Measure> measures;
|
||||
|
||||
private List<ExtraInfo> extraInfo;
|
||||
|
||||
private OAIProvenance oaiprovenance;
|
||||
private EntityDataInfo dataInfo;
|
||||
|
||||
public List<KeyValue> getCollectedfrom() {
|
||||
return collectedfrom;
|
||||
}
|
||||
|
||||
public void setCollectedfrom(List<KeyValue> collectedfrom) {
|
||||
this.collectedfrom = collectedfrom;
|
||||
}
|
||||
|
||||
public Long getLastupdatetimestamp() {
|
||||
return lastupdatetimestamp;
|
||||
}
|
||||
|
||||
public void setLastupdatetimestamp(Long lastupdatetimestamp) {
|
||||
this.lastupdatetimestamp = lastupdatetimestamp;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -57,6 +85,24 @@ public abstract class OafEntity extends Oaf implements Serializable {
|
|||
return dateoftransformation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 void setDateoftransformation(String dateoftransformation) {
|
||||
this.dateoftransformation = dateoftransformation;
|
||||
}
|
||||
|
@ -69,43 +115,12 @@ public abstract class OafEntity extends Oaf implements Serializable {
|
|||
this.extraInfo = extraInfo;
|
||||
}
|
||||
|
||||
public OAIProvenance getOaiprovenance() {
|
||||
return oaiprovenance;
|
||||
public EntityDataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setOaiprovenance(OAIProvenance oaiprovenance) {
|
||||
this.oaiprovenance = oaiprovenance;
|
||||
}
|
||||
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
originalId = mergeLists(originalId, e.getOriginalId());
|
||||
|
||||
pid = mergeLists(pid, e.getPid());
|
||||
|
||||
if (e.getDateofcollection() != null && compareTrust(this, e) < 0)
|
||||
dateofcollection = e.getDateofcollection();
|
||||
|
||||
if (e.getDateoftransformation() != null && compareTrust(this, e) < 0)
|
||||
dateoftransformation = e.getDateoftransformation();
|
||||
|
||||
extraInfo = mergeLists(extraInfo, e.getExtraInfo());
|
||||
|
||||
if (e.getOaiprovenance() != null && compareTrust(this, e) < 0)
|
||||
oaiprovenance = e.getOaiprovenance();
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
protected final <T> List<T> mergeLists(final List<T>... lists) {
|
||||
|
||||
return Arrays
|
||||
.stream(lists)
|
||||
.filter(Objects::nonNull)
|
||||
.flatMap(List::stream)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
public void setDataInfo(EntityDataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,7 +131,7 @@ public abstract class OafEntity extends Oaf implements Serializable {
|
|||
return false;
|
||||
if (!super.equals(o))
|
||||
return false;
|
||||
OafEntity oafEntity = (OafEntity) o;
|
||||
Entity oafEntity = (Entity) o;
|
||||
return Objects.equals(id, oafEntity.id);
|
||||
}
|
||||
|
||||
|
@ -124,4 +139,5 @@ public abstract class OafEntity extends Oaf implements Serializable {
|
|||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode(), id);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class EntityDataInfo {
|
||||
private Boolean inferred;
|
||||
private Float trust;
|
||||
private String inferenceprovenance;
|
||||
private Qualifier provenanceaction;
|
||||
private Boolean invisible = false;
|
||||
private Boolean deletedbyinference = false;
|
||||
|
||||
public Boolean getInferred() {
|
||||
return inferred;
|
||||
}
|
||||
|
||||
public void setInferred(Boolean inferred) {
|
||||
this.inferred = inferred;
|
||||
}
|
||||
|
||||
public Float getTrust() {
|
||||
return trust;
|
||||
}
|
||||
|
||||
public void setTrust(Float trust) {
|
||||
this.trust = trust;
|
||||
}
|
||||
|
||||
public String getInferenceprovenance() {
|
||||
return inferenceprovenance;
|
||||
}
|
||||
|
||||
public void setInferenceprovenance(String inferenceprovenance) {
|
||||
this.inferenceprovenance = inferenceprovenance;
|
||||
}
|
||||
|
||||
public Qualifier getProvenanceaction() {
|
||||
return provenanceaction;
|
||||
}
|
||||
|
||||
public void setProvenanceaction(Qualifier provenanceaction) {
|
||||
this.provenanceaction = provenanceaction;
|
||||
}
|
||||
|
||||
public Boolean getInvisible() {
|
||||
return invisible;
|
||||
}
|
||||
|
||||
public void setInvisible(Boolean invisible) {
|
||||
this.invisible = invisible;
|
||||
}
|
||||
|
||||
public Boolean getDeletedbyinference() {
|
||||
return deletedbyinference;
|
||||
}
|
||||
|
||||
public void setDeletedbyinference(Boolean deletedbyinference) {
|
||||
this.deletedbyinference = deletedbyinference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
EntityDataInfo dataInfo = (EntityDataInfo) o;
|
||||
return Objects.equals(inferred, dataInfo.inferred)
|
||||
&& Objects.equals(trust, dataInfo.trust)
|
||||
&& Objects.equals(inferenceprovenance, dataInfo.inferenceprovenance)
|
||||
&& Objects.equals(provenanceaction, dataInfo.provenanceaction)
|
||||
&& Objects.equals(deletedbyinference, dataInfo.deletedbyinference)
|
||||
&& Objects.equals(invisible, dataInfo.invisible);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
inferred, trust, inferenceprovenance, provenanceaction, deletedbyinference, invisible);
|
||||
}
|
||||
|
||||
}
|
|
@ -27,9 +27,6 @@ public class ExternalReference implements Serializable {
|
|||
// maps the oaf:reference/@query attribute
|
||||
private String query;
|
||||
|
||||
// ExternalReferences might be also inferred
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public String getSitename() {
|
||||
return sitename;
|
||||
}
|
||||
|
@ -86,14 +83,6 @@ public class ExternalReference implements Serializable {
|
|||
this.query = query;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
|
@ -106,15 +95,14 @@ public class ExternalReference implements Serializable {
|
|||
&& Objects.equals(url, that.url)
|
||||
&& Objects.equals(qualifier, that.qualifier)
|
||||
&& Objects.equals(refidentifier, that.refidentifier)
|
||||
&& Objects.equals(query, that.query)
|
||||
&& Objects.equals(dataInfo, that.dataInfo);
|
||||
&& Objects.equals(query, that.query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects
|
||||
.hash(
|
||||
sitename, label, url, qualifier, refidentifier, query, dataInfo);
|
||||
sitename, label, url, qualifier, refidentifier, query);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Field<T> implements Serializable {
|
||||
|
||||
private T value;
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public T getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getValue() == null ? 0 : getValue().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Field<T> other = (Field<T>) obj;
|
||||
return Objects.equals(getValue(), other.getValue());
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
|
||||
public class Instance implements Serializable {
|
||||
|
||||
private Field<String> license;
|
||||
private License license;
|
||||
|
||||
private AccessRight accessright;
|
||||
|
||||
|
@ -16,6 +16,8 @@ public class Instance implements Serializable {
|
|||
|
||||
private List<String> url;
|
||||
|
||||
private List<String> fulltext;
|
||||
|
||||
// other research products specifc
|
||||
private String distributionlocation;
|
||||
|
||||
|
@ -25,25 +27,23 @@ public class Instance implements Serializable {
|
|||
|
||||
private List<StructuredProperty> alternateIdentifier;
|
||||
|
||||
private Field<String> dateofacceptance;
|
||||
private String dateofacceptance;
|
||||
|
||||
// ( article | book ) processing charges. Defined here to cope with possible wrongly typed
|
||||
// results
|
||||
private Field<String> processingchargeamount;
|
||||
private String processingchargeamount;
|
||||
|
||||
// currency - alphabetic code describe in ISO-4217. Defined here to cope with possible wrongly
|
||||
// typed results
|
||||
private Field<String> processingchargecurrency;
|
||||
private String processingchargecurrency;
|
||||
|
||||
private Qualifier refereed; // peer-review status
|
||||
|
||||
private List<Measure> measures;
|
||||
|
||||
public Field<String> getLicense() {
|
||||
public License getLicense() {
|
||||
return license;
|
||||
}
|
||||
|
||||
public void setLicense(Field<String> license) {
|
||||
public void setLicense(License license) {
|
||||
this.license = license;
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,14 @@ public class Instance implements Serializable {
|
|||
this.url = url;
|
||||
}
|
||||
|
||||
public List<String> getFulltext() {
|
||||
return fulltext;
|
||||
}
|
||||
|
||||
public void setFulltext(List<String> fulltext) {
|
||||
this.fulltext = fulltext;
|
||||
}
|
||||
|
||||
public String getDistributionlocation() {
|
||||
return distributionlocation;
|
||||
}
|
||||
|
@ -103,11 +111,11 @@ public class Instance implements Serializable {
|
|||
this.pid = pid;
|
||||
}
|
||||
|
||||
public Field<String> getDateofacceptance() {
|
||||
public String getDateofacceptance() {
|
||||
return dateofacceptance;
|
||||
}
|
||||
|
||||
public void setDateofacceptance(Field<String> dateofacceptance) {
|
||||
public void setDateofacceptance(String dateofacceptance) {
|
||||
this.dateofacceptance = dateofacceptance;
|
||||
}
|
||||
|
||||
|
@ -119,19 +127,19 @@ public class Instance implements Serializable {
|
|||
this.alternateIdentifier = alternateIdentifier;
|
||||
}
|
||||
|
||||
public Field<String> getProcessingchargeamount() {
|
||||
public String getProcessingchargeamount() {
|
||||
return processingchargeamount;
|
||||
}
|
||||
|
||||
public void setProcessingchargeamount(Field<String> processingchargeamount) {
|
||||
public void setProcessingchargeamount(String processingchargeamount) {
|
||||
this.processingchargeamount = processingchargeamount;
|
||||
}
|
||||
|
||||
public Field<String> getProcessingchargecurrency() {
|
||||
public String getProcessingchargecurrency() {
|
||||
return processingchargecurrency;
|
||||
}
|
||||
|
||||
public void setProcessingchargecurrency(Field<String> processingchargecurrency) {
|
||||
public void setProcessingchargecurrency(String processingchargecurrency) {
|
||||
this.processingchargecurrency = processingchargecurrency;
|
||||
}
|
||||
|
||||
|
@ -143,14 +151,6 @@ 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(
|
||||
|
|
|
@ -28,8 +28,6 @@ public class Journal implements Serializable {
|
|||
|
||||
private String conferencedate;
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -118,14 +116,6 @@ public class Journal implements Serializable {
|
|||
this.conferencedate = conferencedate;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
|
@ -143,8 +133,7 @@ public class Journal implements Serializable {
|
|||
&& Objects.equals(vol, journal.vol)
|
||||
&& Objects.equals(edition, journal.edition)
|
||||
&& Objects.equals(conferenceplace, journal.conferenceplace)
|
||||
&& Objects.equals(conferencedate, journal.conferencedate)
|
||||
&& Objects.equals(dataInfo, journal.dataInfo);
|
||||
&& Objects.equals(conferencedate, journal.conferencedate);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -161,7 +150,6 @@ public class Journal implements Serializable {
|
|||
vol,
|
||||
edition,
|
||||
conferenceplace,
|
||||
conferencedate,
|
||||
dataInfo);
|
||||
conferencedate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,6 @@ public class KeyValue implements Serializable {
|
|||
|
||||
private String value;
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
@ -31,14 +29,6 @@ public class KeyValue implements Serializable {
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
public String toComparableString() {
|
||||
return isBlank()
|
||||
? ""
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class License implements Serializable {
|
||||
|
||||
private String url;
|
||||
|
||||
|
||||
public License() {
|
||||
}
|
||||
|
||||
public License(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
|
@ -17,10 +17,10 @@ public class Measure implements Serializable {
|
|||
private String id;
|
||||
|
||||
/**
|
||||
* List of units associated with this measure. KeyValue provides a pair to store the label (key) and the value, plus
|
||||
* List of units associated with this measure. MeasureUnit provides a pair to store the label (key) and the value, plus
|
||||
* common provenance information.
|
||||
*/
|
||||
private List<KeyValue> unit;
|
||||
private List<MeasureUnit> unit;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -30,18 +30,14 @@ public class Measure implements Serializable {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public List<KeyValue> getUnit() {
|
||||
public List<MeasureUnit> getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(List<KeyValue> unit) {
|
||||
public void setUnit(List<MeasureUnit> unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public void mergeFrom(Measure m) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
public class MeasureUnit extends KeyValue {
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
}
|
|
@ -1,108 +1,6 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public abstract class Oaf implements Serializable {
|
||||
|
||||
/**
|
||||
* The list of datasource id/name pairs providing this relationship.
|
||||
*/
|
||||
protected List<KeyValue> collectedfrom;
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
private Long lastupdatetimestamp;
|
||||
|
||||
public List<KeyValue> getCollectedfrom() {
|
||||
return collectedfrom;
|
||||
}
|
||||
|
||||
public void setCollectedfrom(List<KeyValue> collectedfrom) {
|
||||
this.collectedfrom = collectedfrom;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
public Long getLastupdatetimestamp() {
|
||||
return lastupdatetimestamp;
|
||||
}
|
||||
|
||||
public void setLastupdatetimestamp(Long lastupdatetimestamp) {
|
||||
this.lastupdatetimestamp = lastupdatetimestamp;
|
||||
}
|
||||
|
||||
public void mergeFrom(Oaf o) {
|
||||
if (Objects.isNull(o)) {
|
||||
return;
|
||||
}
|
||||
setCollectedfrom(
|
||||
Stream
|
||||
.concat(
|
||||
Optional
|
||||
.ofNullable(getCollectedfrom())
|
||||
.map(Collection::stream)
|
||||
.orElse(Stream.empty()),
|
||||
Optional
|
||||
.ofNullable(o.getCollectedfrom())
|
||||
.map(Collection::stream)
|
||||
.orElse(Stream.empty()))
|
||||
.distinct() // relies on KeyValue.equals
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
setLastupdatetimestamp(
|
||||
Math
|
||||
.max(
|
||||
Optional.ofNullable(getLastupdatetimestamp()).orElse(0L),
|
||||
Optional.ofNullable(o.getLastupdatetimestamp()).orElse(0L)));
|
||||
}
|
||||
|
||||
public void mergeOAFDataInfo(Oaf o) {
|
||||
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) {
|
||||
if (e == null || e.getDataInfo() == null || e.getDataInfo().getTrust() == null)
|
||||
return "0.0";
|
||||
return e.getDataInfo().getTrust();
|
||||
}
|
||||
|
||||
protected int compareTrust(Oaf a, Oaf b) {
|
||||
return extractTrust(a).compareTo(extractTrust(b));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
Oaf oaf = (Oaf) o;
|
||||
return Objects.equals(getDataInfo(), oaf.getDataInfo())
|
||||
&& Objects.equals(lastupdatetimestamp, oaf.lastupdatetimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(dataInfo, lastupdatetimestamp);
|
||||
}
|
||||
public class Oaf implements Serializable {
|
||||
}
|
||||
|
|
|
@ -4,158 +4,158 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class Organization extends OafEntity implements Serializable {
|
||||
public class Organization extends Entity implements Serializable {
|
||||
|
||||
private Field<String> legalshortname;
|
||||
private String legalshortname;
|
||||
|
||||
private Field<String> legalname;
|
||||
private String legalname;
|
||||
|
||||
private List<Field<String>> alternativeNames;
|
||||
private List<String> alternativeNames;
|
||||
|
||||
private Field<String> websiteurl;
|
||||
private String websiteurl;
|
||||
|
||||
private Field<String> logourl;
|
||||
private String logourl;
|
||||
|
||||
private Field<String> eclegalbody;
|
||||
private String eclegalbody;
|
||||
|
||||
private Field<String> eclegalperson;
|
||||
private String eclegalperson;
|
||||
|
||||
private Field<String> ecnonprofit;
|
||||
private String ecnonprofit;
|
||||
|
||||
private Field<String> ecresearchorganization;
|
||||
private String ecresearchorganization;
|
||||
|
||||
private Field<String> echighereducation;
|
||||
private String echighereducation;
|
||||
|
||||
private Field<String> ecinternationalorganizationeurinterests;
|
||||
private String ecinternationalorganizationeurinterests;
|
||||
|
||||
private Field<String> ecinternationalorganization;
|
||||
private String ecinternationalorganization;
|
||||
|
||||
private Field<String> ecenterprise;
|
||||
private String ecenterprise;
|
||||
|
||||
private Field<String> ecsmevalidated;
|
||||
private String ecsmevalidated;
|
||||
|
||||
private Field<String> ecnutscode;
|
||||
private String ecnutscode;
|
||||
|
||||
private Qualifier country;
|
||||
|
||||
public Field<String> getLegalshortname() {
|
||||
public String getLegalshortname() {
|
||||
return legalshortname;
|
||||
}
|
||||
|
||||
public void setLegalshortname(Field<String> legalshortname) {
|
||||
public void setLegalshortname(String legalshortname) {
|
||||
this.legalshortname = legalshortname;
|
||||
}
|
||||
|
||||
public Field<String> getLegalname() {
|
||||
public String getLegalname() {
|
||||
return legalname;
|
||||
}
|
||||
|
||||
public void setLegalname(Field<String> legalname) {
|
||||
public void setLegalname(String legalname) {
|
||||
this.legalname = legalname;
|
||||
}
|
||||
|
||||
public List<Field<String>> getAlternativeNames() {
|
||||
public List<String> getAlternativeNames() {
|
||||
return alternativeNames;
|
||||
}
|
||||
|
||||
public void setAlternativeNames(List<Field<String>> alternativeNames) {
|
||||
public void setAlternativeNames(List<String> alternativeNames) {
|
||||
this.alternativeNames = alternativeNames;
|
||||
}
|
||||
|
||||
public Field<String> getWebsiteurl() {
|
||||
public String getWebsiteurl() {
|
||||
return websiteurl;
|
||||
}
|
||||
|
||||
public void setWebsiteurl(Field<String> websiteurl) {
|
||||
public void setWebsiteurl(String websiteurl) {
|
||||
this.websiteurl = websiteurl;
|
||||
}
|
||||
|
||||
public Field<String> getLogourl() {
|
||||
public String getLogourl() {
|
||||
return logourl;
|
||||
}
|
||||
|
||||
public void setLogourl(Field<String> logourl) {
|
||||
public void setLogourl(String logourl) {
|
||||
this.logourl = logourl;
|
||||
}
|
||||
|
||||
public Field<String> getEclegalbody() {
|
||||
public String getEclegalbody() {
|
||||
return eclegalbody;
|
||||
}
|
||||
|
||||
public void setEclegalbody(Field<String> eclegalbody) {
|
||||
public void setEclegalbody(String eclegalbody) {
|
||||
this.eclegalbody = eclegalbody;
|
||||
}
|
||||
|
||||
public Field<String> getEclegalperson() {
|
||||
public String getEclegalperson() {
|
||||
return eclegalperson;
|
||||
}
|
||||
|
||||
public void setEclegalperson(Field<String> eclegalperson) {
|
||||
public void setEclegalperson(String eclegalperson) {
|
||||
this.eclegalperson = eclegalperson;
|
||||
}
|
||||
|
||||
public Field<String> getEcnonprofit() {
|
||||
public String getEcnonprofit() {
|
||||
return ecnonprofit;
|
||||
}
|
||||
|
||||
public void setEcnonprofit(Field<String> ecnonprofit) {
|
||||
public void setEcnonprofit(String ecnonprofit) {
|
||||
this.ecnonprofit = ecnonprofit;
|
||||
}
|
||||
|
||||
public Field<String> getEcresearchorganization() {
|
||||
public String getEcresearchorganization() {
|
||||
return ecresearchorganization;
|
||||
}
|
||||
|
||||
public void setEcresearchorganization(Field<String> ecresearchorganization) {
|
||||
public void setEcresearchorganization(String ecresearchorganization) {
|
||||
this.ecresearchorganization = ecresearchorganization;
|
||||
}
|
||||
|
||||
public Field<String> getEchighereducation() {
|
||||
public String getEchighereducation() {
|
||||
return echighereducation;
|
||||
}
|
||||
|
||||
public void setEchighereducation(Field<String> echighereducation) {
|
||||
public void setEchighereducation(String echighereducation) {
|
||||
this.echighereducation = echighereducation;
|
||||
}
|
||||
|
||||
public Field<String> getEcinternationalorganizationeurinterests() {
|
||||
public String getEcinternationalorganizationeurinterests() {
|
||||
return ecinternationalorganizationeurinterests;
|
||||
}
|
||||
|
||||
public void setEcinternationalorganizationeurinterests(
|
||||
Field<String> ecinternationalorganizationeurinterests) {
|
||||
String ecinternationalorganizationeurinterests) {
|
||||
this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests;
|
||||
}
|
||||
|
||||
public Field<String> getEcinternationalorganization() {
|
||||
public String getEcinternationalorganization() {
|
||||
return ecinternationalorganization;
|
||||
}
|
||||
|
||||
public void setEcinternationalorganization(Field<String> ecinternationalorganization) {
|
||||
public void setEcinternationalorganization(String ecinternationalorganization) {
|
||||
this.ecinternationalorganization = ecinternationalorganization;
|
||||
}
|
||||
|
||||
public Field<String> getEcenterprise() {
|
||||
public String getEcenterprise() {
|
||||
return ecenterprise;
|
||||
}
|
||||
|
||||
public void setEcenterprise(Field<String> ecenterprise) {
|
||||
public void setEcenterprise(String ecenterprise) {
|
||||
this.ecenterprise = ecenterprise;
|
||||
}
|
||||
|
||||
public Field<String> getEcsmevalidated() {
|
||||
public String getEcsmevalidated() {
|
||||
return ecsmevalidated;
|
||||
}
|
||||
|
||||
public void setEcsmevalidated(Field<String> ecsmevalidated) {
|
||||
public void setEcsmevalidated(String ecsmevalidated) {
|
||||
this.ecsmevalidated = ecsmevalidated;
|
||||
}
|
||||
|
||||
public Field<String> getEcnutscode() {
|
||||
public String getEcnutscode() {
|
||||
return ecnutscode;
|
||||
}
|
||||
|
||||
public void setEcnutscode(Field<String> ecnutscode) {
|
||||
public void setEcnutscode(String ecnutscode) {
|
||||
this.ecnutscode = ecnutscode;
|
||||
}
|
||||
|
||||
|
@ -167,48 +167,4 @@ public class Organization extends OafEntity implements Serializable {
|
|||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
if (!Organization.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Organization o = (Organization) e;
|
||||
legalshortname = o.getLegalshortname() != null && compareTrust(this, e) < 0
|
||||
? o.getLegalshortname()
|
||||
: legalshortname;
|
||||
legalname = o.getLegalname() != null && compareTrust(this, e) < 0 ? o.getLegalname() : legalname;
|
||||
alternativeNames = mergeLists(o.getAlternativeNames(), alternativeNames);
|
||||
websiteurl = o.getWebsiteurl() != null && compareTrust(this, e) < 0 ? o.getWebsiteurl() : websiteurl;
|
||||
logourl = o.getLogourl() != null && compareTrust(this, e) < 0 ? o.getLogourl() : logourl;
|
||||
eclegalbody = o.getEclegalbody() != null && compareTrust(this, e) < 0 ? o.getEclegalbody() : eclegalbody;
|
||||
eclegalperson = o.getEclegalperson() != null && compareTrust(this, e) < 0
|
||||
? o.getEclegalperson()
|
||||
: eclegalperson;
|
||||
ecnonprofit = o.getEcnonprofit() != null && compareTrust(this, e) < 0 ? o.getEcnonprofit() : ecnonprofit;
|
||||
ecresearchorganization = o.getEcresearchorganization() != null && compareTrust(this, e) < 0
|
||||
? o.getEcresearchorganization()
|
||||
: ecresearchorganization;
|
||||
echighereducation = o.getEchighereducation() != null && compareTrust(this, e) < 0
|
||||
? o.getEchighereducation()
|
||||
: echighereducation;
|
||||
ecinternationalorganizationeurinterests = o.getEcinternationalorganizationeurinterests() != null
|
||||
&& compareTrust(this, e) < 0
|
||||
? o.getEcinternationalorganizationeurinterests()
|
||||
: ecinternationalorganizationeurinterests;
|
||||
ecinternationalorganization = o.getEcinternationalorganization() != null && compareTrust(this, e) < 0
|
||||
? o.getEcinternationalorganization()
|
||||
: ecinternationalorganization;
|
||||
ecenterprise = o.getEcenterprise() != null && compareTrust(this, e) < 0
|
||||
? o.getEcenterprise()
|
||||
: ecenterprise;
|
||||
ecsmevalidated = o.getEcsmevalidated() != null && compareTrust(this, e) < 0
|
||||
? o.getEcsmevalidated()
|
||||
: ecsmevalidated;
|
||||
ecnutscode = o.getEcnutscode() != null && compareTrust(this, e) < 0 ? o.getEcnutscode() : ecnutscode;
|
||||
country = o.getCountry() != null && compareTrust(this, e) < 0 ? o.getCountry() : country;
|
||||
mergeOAFDataInfo(o);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,57 +4,39 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
|
||||
public class OtherResearchProduct extends Result implements Serializable {
|
||||
|
||||
private List<Field<String>> contactperson;
|
||||
private List<String> contactperson;
|
||||
|
||||
private List<Field<String>> contactgroup;
|
||||
private List<String> contactgroup;
|
||||
|
||||
private List<Field<String>> tool;
|
||||
private List<String> tool;
|
||||
|
||||
public OtherResearchProduct() {
|
||||
setResulttype(ModelConstants.ORP_DEFAULT_RESULTTYPE);
|
||||
setResulttype(RESULTTYPE.otherresearchproduct);
|
||||
}
|
||||
|
||||
public List<Field<String>> getContactperson() {
|
||||
public List<String> getContactperson() {
|
||||
return contactperson;
|
||||
}
|
||||
|
||||
public void setContactperson(List<Field<String>> contactperson) {
|
||||
public void setContactperson(List<String> contactperson) {
|
||||
this.contactperson = contactperson;
|
||||
}
|
||||
|
||||
public List<Field<String>> getContactgroup() {
|
||||
public List<String> getContactgroup() {
|
||||
return contactgroup;
|
||||
}
|
||||
|
||||
public void setContactgroup(List<Field<String>> contactgroup) {
|
||||
public void setContactgroup(List<String> contactgroup) {
|
||||
this.contactgroup = contactgroup;
|
||||
}
|
||||
|
||||
public List<Field<String>> getTool() {
|
||||
public List<String> getTool() {
|
||||
return tool;
|
||||
}
|
||||
|
||||
public void setTool(List<Field<String>> tool) {
|
||||
public void setTool(List<String> tool) {
|
||||
this.tool = tool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
if (!OtherResearchProduct.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
OtherResearchProduct o = (OtherResearchProduct) e;
|
||||
|
||||
contactperson = mergeLists(contactperson, o.getContactperson());
|
||||
contactgroup = mergeLists(contactgroup, o.getContactgroup());
|
||||
tool = mergeLists(tool, o.getTool());
|
||||
mergeOAFDataInfo(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,57 +4,55 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
public class Project extends Entity implements Serializable {
|
||||
|
||||
public class Project extends OafEntity implements Serializable {
|
||||
private String websiteurl;
|
||||
|
||||
private Field<String> websiteurl;
|
||||
private String code;
|
||||
|
||||
private Field<String> code;
|
||||
private String acronym;
|
||||
|
||||
private Field<String> acronym;
|
||||
private String title;
|
||||
|
||||
private Field<String> title;
|
||||
private String startdate;
|
||||
|
||||
private Field<String> startdate;
|
||||
private String enddate;
|
||||
|
||||
private Field<String> enddate;
|
||||
private String callidentifier;
|
||||
|
||||
private Field<String> callidentifier;
|
||||
private String keywords;
|
||||
|
||||
private Field<String> keywords;
|
||||
private String duration;
|
||||
|
||||
private Field<String> duration;
|
||||
private String ecsc39;
|
||||
|
||||
private Field<String> ecsc39;
|
||||
private String oamandatepublications;
|
||||
|
||||
private Field<String> oamandatepublications;
|
||||
|
||||
private Field<String> ecarticle29_3;
|
||||
private String ecarticle29_3;
|
||||
|
||||
private List<StructuredProperty> subjects;
|
||||
|
||||
private List<Field<String>> fundingtree;
|
||||
private List<String> fundingtree;
|
||||
|
||||
private Qualifier contracttype;
|
||||
|
||||
private Field<String> optional1;
|
||||
private String optional1;
|
||||
|
||||
private Field<String> optional2;
|
||||
private String optional2;
|
||||
|
||||
private Field<String> jsonextrainfo;
|
||||
private String jsonextrainfo;
|
||||
|
||||
private Field<String> contactfullname;
|
||||
private String contactfullname;
|
||||
|
||||
private Field<String> contactfax;
|
||||
private String contactfax;
|
||||
|
||||
private Field<String> contactphone;
|
||||
private String contactphone;
|
||||
|
||||
private Field<String> contactemail;
|
||||
private String contactemail;
|
||||
|
||||
private Field<String> summary;
|
||||
private String summary;
|
||||
|
||||
private Field<String> currency;
|
||||
private String currency;
|
||||
|
||||
private Float totalcost;
|
||||
|
||||
|
@ -64,7 +62,7 @@ public class Project extends OafEntity implements Serializable {
|
|||
|
||||
private String h2020topicdescription;
|
||||
|
||||
private List<H2020Classification> h2020classification;
|
||||
private List<H2020Classification>h2020classification;
|
||||
|
||||
public String getH2020topicdescription() {
|
||||
return h2020topicdescription;
|
||||
|
@ -90,99 +88,99 @@ public class Project extends OafEntity implements Serializable {
|
|||
this.h2020classification = h2020classification;
|
||||
}
|
||||
|
||||
public Field<String> getWebsiteurl() {
|
||||
public String getWebsiteurl() {
|
||||
return websiteurl;
|
||||
}
|
||||
|
||||
public void setWebsiteurl(Field<String> websiteurl) {
|
||||
public void setWebsiteurl( String websiteurl) {
|
||||
this.websiteurl = websiteurl;
|
||||
}
|
||||
|
||||
public Field<String> getCode() {
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Field<String> code) {
|
||||
public void setCode( String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Field<String> getAcronym() {
|
||||
public String getAcronym() {
|
||||
return acronym;
|
||||
}
|
||||
|
||||
public void setAcronym(Field<String> acronym) {
|
||||
public void setAcronym( String acronym) {
|
||||
this.acronym = acronym;
|
||||
}
|
||||
|
||||
public Field<String> getTitle() {
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(Field<String> title) {
|
||||
public void setTitle( String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Field<String> getStartdate() {
|
||||
public String getStartdate() {
|
||||
return startdate;
|
||||
}
|
||||
|
||||
public void setStartdate(Field<String> startdate) {
|
||||
public void setStartdate( String startdate) {
|
||||
this.startdate = startdate;
|
||||
}
|
||||
|
||||
public Field<String> getEnddate() {
|
||||
public String getEnddate() {
|
||||
return enddate;
|
||||
}
|
||||
|
||||
public void setEnddate(Field<String> enddate) {
|
||||
public void setEnddate( String enddate) {
|
||||
this.enddate = enddate;
|
||||
}
|
||||
|
||||
public Field<String> getCallidentifier() {
|
||||
public String getCallidentifier() {
|
||||
return callidentifier;
|
||||
}
|
||||
|
||||
public void setCallidentifier(Field<String> callidentifier) {
|
||||
public void setCallidentifier( String callidentifier) {
|
||||
this.callidentifier = callidentifier;
|
||||
}
|
||||
|
||||
public Field<String> getKeywords() {
|
||||
public String getKeywords() {
|
||||
return keywords;
|
||||
}
|
||||
|
||||
public void setKeywords(Field<String> keywords) {
|
||||
public void setKeywords( String keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public Field<String> getDuration() {
|
||||
public String getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(Field<String> duration) {
|
||||
public void setDuration( String duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public Field<String> getEcsc39() {
|
||||
public String getEcsc39() {
|
||||
return ecsc39;
|
||||
}
|
||||
|
||||
public void setEcsc39(Field<String> ecsc39) {
|
||||
public void setEcsc39( String ecsc39) {
|
||||
this.ecsc39 = ecsc39;
|
||||
}
|
||||
|
||||
public Field<String> getOamandatepublications() {
|
||||
public String getOamandatepublications() {
|
||||
return oamandatepublications;
|
||||
}
|
||||
|
||||
public void setOamandatepublications(Field<String> oamandatepublications) {
|
||||
public void setOamandatepublications( String oamandatepublications) {
|
||||
this.oamandatepublications = oamandatepublications;
|
||||
}
|
||||
|
||||
public Field<String> getEcarticle29_3() {
|
||||
public String getEcarticle29_3() {
|
||||
return ecarticle29_3;
|
||||
}
|
||||
|
||||
public void setEcarticle29_3(Field<String> ecarticle29_3) {
|
||||
public void setEcarticle29_3( String ecarticle29_3) {
|
||||
this.ecarticle29_3 = ecarticle29_3;
|
||||
}
|
||||
|
||||
|
@ -194,11 +192,11 @@ public class Project extends OafEntity implements Serializable {
|
|||
this.subjects = subjects;
|
||||
}
|
||||
|
||||
public List<Field<String>> getFundingtree() {
|
||||
public List< String> getFundingtree() {
|
||||
return fundingtree;
|
||||
}
|
||||
|
||||
public void setFundingtree(List<Field<String>> fundingtree) {
|
||||
public void setFundingtree(List< String> fundingtree) {
|
||||
this.fundingtree = fundingtree;
|
||||
}
|
||||
|
||||
|
@ -210,75 +208,75 @@ public class Project extends OafEntity implements Serializable {
|
|||
this.contracttype = contracttype;
|
||||
}
|
||||
|
||||
public Field<String> getOptional1() {
|
||||
public String getOptional1() {
|
||||
return optional1;
|
||||
}
|
||||
|
||||
public void setOptional1(Field<String> optional1) {
|
||||
public void setOptional1( String optional1) {
|
||||
this.optional1 = optional1;
|
||||
}
|
||||
|
||||
public Field<String> getOptional2() {
|
||||
public String getOptional2() {
|
||||
return optional2;
|
||||
}
|
||||
|
||||
public void setOptional2(Field<String> optional2) {
|
||||
public void setOptional2( String optional2) {
|
||||
this.optional2 = optional2;
|
||||
}
|
||||
|
||||
public Field<String> getJsonextrainfo() {
|
||||
public String getJsonextrainfo() {
|
||||
return jsonextrainfo;
|
||||
}
|
||||
|
||||
public void setJsonextrainfo(Field<String> jsonextrainfo) {
|
||||
public void setJsonextrainfo( String jsonextrainfo) {
|
||||
this.jsonextrainfo = jsonextrainfo;
|
||||
}
|
||||
|
||||
public Field<String> getContactfullname() {
|
||||
public String getContactfullname() {
|
||||
return contactfullname;
|
||||
}
|
||||
|
||||
public void setContactfullname(Field<String> contactfullname) {
|
||||
public void setContactfullname( String contactfullname) {
|
||||
this.contactfullname = contactfullname;
|
||||
}
|
||||
|
||||
public Field<String> getContactfax() {
|
||||
public String getContactfax() {
|
||||
return contactfax;
|
||||
}
|
||||
|
||||
public void setContactfax(Field<String> contactfax) {
|
||||
public void setContactfax( String contactfax) {
|
||||
this.contactfax = contactfax;
|
||||
}
|
||||
|
||||
public Field<String> getContactphone() {
|
||||
public String getContactphone() {
|
||||
return contactphone;
|
||||
}
|
||||
|
||||
public void setContactphone(Field<String> contactphone) {
|
||||
public void setContactphone( String contactphone) {
|
||||
this.contactphone = contactphone;
|
||||
}
|
||||
|
||||
public Field<String> getContactemail() {
|
||||
public String getContactemail() {
|
||||
return contactemail;
|
||||
}
|
||||
|
||||
public void setContactemail(Field<String> contactemail) {
|
||||
public void setContactemail( String contactemail) {
|
||||
this.contactemail = contactemail;
|
||||
}
|
||||
|
||||
public Field<String> getSummary() {
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(Field<String> summary) {
|
||||
public void setSummary( String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public Field<String> getCurrency() {
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setCurrency(Field<String> currency) {
|
||||
public void setCurrency( String currency) {
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
|
@ -298,64 +296,4 @@ public class Project extends OafEntity implements Serializable {
|
|||
this.fundedamount = fundedamount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
if (!Project.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Project p = (Project) e;
|
||||
|
||||
websiteurl = p.getWebsiteurl() != null && compareTrust(this, e) < 0 ? p.getWebsiteurl() : websiteurl;
|
||||
code = p.getCode() != null && compareTrust(this, e) < 0 ? p.getCode() : code;
|
||||
acronym = p.getAcronym() != null && compareTrust(this, e) < 0 ? p.getAcronym() : acronym;
|
||||
title = p.getTitle() != null && compareTrust(this, e) < 0 ? p.getTitle() : title;
|
||||
startdate = p.getStartdate() != null && compareTrust(this, e) < 0 ? p.getStartdate() : startdate;
|
||||
enddate = p.getEnddate() != null && compareTrust(this, e) < 0 ? p.getEnddate() : enddate;
|
||||
callidentifier = p.getCallidentifier() != null && compareTrust(this, e) < 0
|
||||
? p.getCallidentifier()
|
||||
: callidentifier;
|
||||
keywords = p.getKeywords() != null && compareTrust(this, e) < 0 ? p.getKeywords() : keywords;
|
||||
duration = p.getDuration() != null && compareTrust(this, e) < 0 ? p.getDuration() : duration;
|
||||
ecsc39 = p.getEcsc39() != null && compareTrust(this, e) < 0 ? p.getEcsc39() : ecsc39;
|
||||
oamandatepublications = p.getOamandatepublications() != null && compareTrust(this, e) < 0
|
||||
? p.getOamandatepublications()
|
||||
: oamandatepublications;
|
||||
ecarticle29_3 = p.getEcarticle29_3() != null && compareTrust(this, e) < 0
|
||||
? p.getEcarticle29_3()
|
||||
: ecarticle29_3;
|
||||
subjects = mergeLists(subjects, p.getSubjects());
|
||||
fundingtree = mergeLists(fundingtree, p.getFundingtree());
|
||||
contracttype = p.getContracttype() != null && compareTrust(this, e) < 0
|
||||
? p.getContracttype()
|
||||
: contracttype;
|
||||
optional1 = p.getOptional1() != null && compareTrust(this, e) < 0 ? p.getOptional1() : optional1;
|
||||
optional2 = p.getOptional2() != null && compareTrust(this, e) < 0 ? p.getOptional2() : optional2;
|
||||
jsonextrainfo = p.getJsonextrainfo() != null && compareTrust(this, e) < 0
|
||||
? p.getJsonextrainfo()
|
||||
: jsonextrainfo;
|
||||
contactfullname = p.getContactfullname() != null && compareTrust(this, e) < 0
|
||||
? p.getContactfullname()
|
||||
: contactfullname;
|
||||
contactfax = p.getContactfax() != null && compareTrust(this, e) < 0 ? p.getContactfax() : contactfax;
|
||||
contactphone = p.getContactphone() != null && compareTrust(this, e) < 0
|
||||
? p.getContactphone()
|
||||
: contactphone;
|
||||
contactemail = p.getContactemail() != null && compareTrust(this, e) < 0
|
||||
? p.getContactemail()
|
||||
: contactemail;
|
||||
summary = p.getSummary() != null && compareTrust(this, e) < 0 ? p.getSummary() : summary;
|
||||
currency = p.getCurrency() != null && compareTrust(this, e) < 0 ? p.getCurrency() : currency;
|
||||
|
||||
if (p.getH2020topiccode() != null && StringUtils.isEmpty(h2020topiccode)){
|
||||
h2020topiccode = p.getH2020topiccode();
|
||||
h2020topicdescription = p.getH2020topicdescription();
|
||||
}
|
||||
|
||||
h2020classification = mergeLists(h2020classification, p.getH2020classification());
|
||||
|
||||
mergeOAFDataInfo(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Provenance implements Serializable {
|
||||
|
||||
private KeyValue collectedfrom;
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public KeyValue getCollectedfrom() {
|
||||
return collectedfrom;
|
||||
}
|
||||
|
||||
public void setCollectedfrom(KeyValue collectedfrom) {
|
||||
this.collectedfrom = collectedfrom;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
}
|
|
@ -3,37 +3,10 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
|
||||
public class Publication extends Result implements Serializable {
|
||||
|
||||
// publication specific
|
||||
private Journal journal;
|
||||
|
||||
public Publication() {
|
||||
setResulttype(ModelConstants.PUBLICATION_DEFAULT_RESULTTYPE);
|
||||
setResulttype(RESULTTYPE.publication);
|
||||
}
|
||||
|
||||
public Journal getJournal() {
|
||||
return journal;
|
||||
}
|
||||
|
||||
public void setJournal(Journal journal) {
|
||||
this.journal = journal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
if (!Publication.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Publication p = (Publication) e;
|
||||
|
||||
if (p.getJournal() != null && compareTrust(this, e) < 0)
|
||||
journal = p.getJournal();
|
||||
mergeOAFDataInfo(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Publisher implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
public Publisher() {
|
||||
}
|
||||
|
||||
public Publisher(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
|
@ -2,17 +2,18 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
public class Qualifier implements Serializable {
|
||||
|
||||
private String classid;
|
||||
private String classname;
|
||||
private String schemeid;
|
||||
private String schemename;
|
||||
|
||||
public String getClassid() {
|
||||
return classid;
|
||||
|
@ -38,32 +39,12 @@ public class Qualifier implements Serializable {
|
|||
this.schemeid = schemeid;
|
||||
}
|
||||
|
||||
public String getSchemename() {
|
||||
return schemename;
|
||||
}
|
||||
|
||||
public void setSchemename(String schemename) {
|
||||
this.schemename = schemename;
|
||||
}
|
||||
|
||||
public String toComparableString() {
|
||||
return isBlank()
|
||||
? ""
|
||||
: String
|
||||
.format(
|
||||
"%s::%s::%s::%s",
|
||||
classid != null ? classid : "",
|
||||
classname != null ? classname : "",
|
||||
schemeid != null ? schemeid : "",
|
||||
schemename != null ? schemename : "");
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isBlank() {
|
||||
return StringUtils.isBlank(classid)
|
||||
&& StringUtils.isBlank(classname)
|
||||
&& StringUtils.isBlank(schemeid)
|
||||
&& StringUtils.isBlank(schemename);
|
||||
return Joiner
|
||||
.on("::")
|
||||
.join(
|
||||
Stream.of(getClassid(), getClassname(), getSchemeid())
|
||||
.filter(StringUtils::isNotBlank).iterator());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,168 +1,451 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
import java.beans.Transient;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Relation models any edge between two nodes in the OpenAIRE graph. It has a source id and a target id pointing to
|
||||
* graph node identifiers and it is further characterised by the semantic of the link through the fields relType,
|
||||
* graph node identifiers, and it is further characterised by the semantic of the link through the fields relType,
|
||||
* subRelType and relClass. Provenance information is modeled according to the dataInfo element and collectedFrom, while
|
||||
* individual relationship types can provide extra information via the properties field.
|
||||
*/
|
||||
public class Relation extends Oaf {
|
||||
public class Relation extends Oaf implements Serializable {
|
||||
|
||||
/**
|
||||
* Main relationship classifier, values include 'resultResult', 'resultProject', 'resultOrganization', etc.
|
||||
*/
|
||||
private String relType;
|
||||
|
||||
/**
|
||||
* Further classifies a relationship, values include 'affiliation', 'similarity', 'supplement', etc.
|
||||
*/
|
||||
private String subRelType;
|
||||
public enum RELTYPE {
|
||||
resultResult,
|
||||
resultProject,
|
||||
resultOrganization,
|
||||
projectOrganization,
|
||||
datasourceOrganization,
|
||||
organizationOrganization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates the direction of the relationship, values include 'isSupplementTo', 'isSupplementedBy', 'merges,
|
||||
* 'isMergedIn'.
|
||||
*/
|
||||
private String relClass;
|
||||
public enum SUBRELTYPE {
|
||||
affiliation,
|
||||
citation,
|
||||
dedup,
|
||||
outcome,
|
||||
part,
|
||||
participation,
|
||||
provision,
|
||||
relationship,
|
||||
review,
|
||||
similarity,
|
||||
supplement,
|
||||
version;
|
||||
public static boolean exists(String subreltype) {
|
||||
try {
|
||||
SUBRELTYPE.valueOf(subreltype);
|
||||
return true;
|
||||
} catch (IllegalArgumentException | NullPointerException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The source entity id.
|
||||
*/
|
||||
private String source;
|
||||
public enum RELCLASS {
|
||||
IsVersionOf,
|
||||
IsSourceOf,
|
||||
isMergedIn,
|
||||
IsIdenticalTo,
|
||||
Documents,
|
||||
IsAmongTopNSimilarDocuments,
|
||||
IsSupplementedBy,
|
||||
IsObsoletedBy,
|
||||
Continues,
|
||||
IsParentOf,
|
||||
IsReferencedBy,
|
||||
IsCitedBy,
|
||||
Compiles,
|
||||
IsPreviousVersionOf,
|
||||
HasPart,
|
||||
IsDocumentedBy,
|
||||
HasAmongTopNSimilarDocuments,
|
||||
isParticipant,
|
||||
hasAuthorInstitution,
|
||||
IsRelatedTo,
|
||||
Requires,
|
||||
Describes,
|
||||
IsReviewedBy,
|
||||
IsContinuedBy,
|
||||
provides,
|
||||
IsChildOf,
|
||||
IsDescribedBy,
|
||||
IsNewVersionOf,
|
||||
IsPartOf,
|
||||
HasVersion,
|
||||
hasParticipant,
|
||||
isAuthorInstitutionOf,
|
||||
IsVariantFormOf,
|
||||
isProducedBy,
|
||||
IsMetadataFor,
|
||||
HasAssociationWith,
|
||||
Cites,
|
||||
IsRequiredBy,
|
||||
IsOriginalFormOf,
|
||||
IsSupplementTo,
|
||||
IsMetadataOf,
|
||||
References,
|
||||
IsCompiledBy,
|
||||
isProvidedBy,
|
||||
merges,
|
||||
IsDerivedFrom,
|
||||
Obsoletes,
|
||||
Reviews,
|
||||
isSimilarTo,
|
||||
isDifferentFrom,
|
||||
produces;
|
||||
|
||||
/**
|
||||
* The target entity id.
|
||||
*/
|
||||
private String target;
|
||||
public static boolean exists(String relclass) {
|
||||
try {
|
||||
RELCLASS.valueOf(relclass);
|
||||
return true;
|
||||
} catch (IllegalArgumentException | NullPointerException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Transient
|
||||
public SUBRELTYPE getSubRel() {
|
||||
switch (this) {
|
||||
case isParticipant:
|
||||
case hasParticipant:
|
||||
return SUBRELTYPE.participation;
|
||||
case isAuthorInstitutionOf:
|
||||
case hasAuthorInstitution:
|
||||
return SUBRELTYPE.affiliation;
|
||||
case isMergedIn:
|
||||
case merges:
|
||||
case isSimilarTo:
|
||||
case isDifferentFrom:
|
||||
return SUBRELTYPE.dedup;
|
||||
case isProducedBy:
|
||||
case produces:
|
||||
return SUBRELTYPE.outcome;
|
||||
case isProvidedBy:
|
||||
case provides:
|
||||
return SUBRELTYPE.provision;
|
||||
case IsAmongTopNSimilarDocuments:
|
||||
case HasAmongTopNSimilarDocuments:
|
||||
return SUBRELTYPE.similarity;
|
||||
case IsSupplementedBy:
|
||||
case IsSupplementTo:
|
||||
return SUBRELTYPE.supplement;
|
||||
case IsPartOf:
|
||||
case HasPart:
|
||||
return SUBRELTYPE.part;
|
||||
case IsCitedBy:
|
||||
case Cites:
|
||||
return SUBRELTYPE.citation;
|
||||
case IsIdenticalTo:
|
||||
case IsReferencedBy:
|
||||
case References:
|
||||
case IsContinuedBy:
|
||||
case Continues:
|
||||
case IsDocumentedBy:
|
||||
case Documents:
|
||||
case IsDerivedFrom:
|
||||
case IsSourceOf:
|
||||
case IsRelatedTo:
|
||||
case IsCompiledBy:
|
||||
case Compiles:
|
||||
case IsDescribedBy:
|
||||
case Describes:
|
||||
case IsMetadataFor:
|
||||
case IsMetadataOf:
|
||||
case HasAssociationWith:
|
||||
case IsRequiredBy:
|
||||
case Requires:
|
||||
case IsChildOf:
|
||||
case IsParentOf:
|
||||
return SUBRELTYPE.relationship;
|
||||
case IsPreviousVersionOf:
|
||||
case IsNewVersionOf:
|
||||
case IsVariantFormOf:
|
||||
case IsOriginalFormOf:
|
||||
case IsObsoletedBy:
|
||||
case Obsoletes:
|
||||
case IsVersionOf:
|
||||
case HasVersion:
|
||||
return SUBRELTYPE.version;
|
||||
case IsReviewedBy:
|
||||
case Reviews:
|
||||
return SUBRELTYPE.review;
|
||||
}
|
||||
// makes the compiler happy
|
||||
throw new IllegalArgumentException("missing SubRel mapping for" + this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Was this relationship authoritatively validated?
|
||||
*/
|
||||
private Boolean validated;
|
||||
/**
|
||||
* This mehtod is an implementation of the valueOF case insensitive
|
||||
* @param value the input Value
|
||||
* @return the RELCLASS
|
||||
*/
|
||||
public static RELCLASS lookUp(String value) {
|
||||
Optional<RELCLASS> rvlaue = Arrays.stream(RELCLASS.values()).filter(e -> e.name().equalsIgnoreCase(value)).findAny();
|
||||
if (rvlaue.isPresent())
|
||||
return rvlaue.get();
|
||||
throw new IllegalArgumentException("value: "+value+" not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* When was this relationship authoritatively validated.
|
||||
*/
|
||||
private String validationDate;
|
||||
@Transient
|
||||
public RELCLASS getInverse() {
|
||||
switch (this) {
|
||||
case IsVersionOf:
|
||||
return HasVersion;
|
||||
case IsSourceOf:
|
||||
return IsDerivedFrom;
|
||||
case isMergedIn:
|
||||
return merges;
|
||||
case IsIdenticalTo:
|
||||
return IsIdenticalTo;
|
||||
case Documents:
|
||||
return IsDocumentedBy;
|
||||
case IsAmongTopNSimilarDocuments:
|
||||
return HasAmongTopNSimilarDocuments;
|
||||
case IsSupplementedBy:
|
||||
return IsSupplementTo;
|
||||
case IsObsoletedBy:
|
||||
return Obsoletes;
|
||||
case Continues:
|
||||
return IsContinuedBy;
|
||||
case IsParentOf:
|
||||
return IsChildOf;
|
||||
case IsReferencedBy:
|
||||
return References;
|
||||
case IsCitedBy:
|
||||
return Cites;
|
||||
case Compiles:
|
||||
return IsCompiledBy;
|
||||
case IsPreviousVersionOf:
|
||||
return IsNewVersionOf;
|
||||
case HasPart:
|
||||
return IsPartOf;
|
||||
case IsDocumentedBy:
|
||||
return Documents;
|
||||
case HasAmongTopNSimilarDocuments:
|
||||
return IsAmongTopNSimilarDocuments;
|
||||
case isParticipant:
|
||||
return hasParticipant;
|
||||
case hasAuthorInstitution:
|
||||
return isAuthorInstitutionOf;
|
||||
case IsRelatedTo:
|
||||
return IsRelatedTo;
|
||||
case Requires:
|
||||
return IsRequiredBy;
|
||||
case Describes:
|
||||
return IsDescribedBy;
|
||||
case IsReviewedBy:
|
||||
return Reviews;
|
||||
case IsContinuedBy:
|
||||
return Continues;
|
||||
case provides:
|
||||
return isProvidedBy;
|
||||
case IsChildOf:
|
||||
return IsParentOf;
|
||||
case IsDescribedBy:
|
||||
return Describes;
|
||||
case IsNewVersionOf:
|
||||
return IsPreviousVersionOf;
|
||||
case IsPartOf:
|
||||
return HasPart;
|
||||
case HasVersion:
|
||||
return IsVersionOf;
|
||||
case hasParticipant:
|
||||
return isParticipant;
|
||||
case isAuthorInstitutionOf:
|
||||
return hasAuthorInstitution;
|
||||
case IsVariantFormOf:
|
||||
return IsOriginalFormOf;
|
||||
case isProducedBy:
|
||||
return produces;
|
||||
case IsMetadataFor:
|
||||
return IsMetadataOf;
|
||||
case Cites:
|
||||
return IsCitedBy;
|
||||
case IsRequiredBy:
|
||||
return Requires;
|
||||
case IsOriginalFormOf:
|
||||
return IsVariantFormOf;
|
||||
case IsSupplementTo:
|
||||
return IsSupplementedBy;
|
||||
case IsMetadataOf:
|
||||
return IsMetadataFor;
|
||||
case References:
|
||||
return IsReferencedBy;
|
||||
case IsCompiledBy:
|
||||
return Compiles;
|
||||
case isProvidedBy:
|
||||
return provides;
|
||||
case merges:
|
||||
return isMergedIn;
|
||||
case IsDerivedFrom:
|
||||
return IsSourceOf;
|
||||
case Obsoletes:
|
||||
return IsObsoletedBy;
|
||||
case Reviews:
|
||||
return IsReviewedBy;
|
||||
case produces:
|
||||
return isProducedBy;
|
||||
case isSimilarTo:
|
||||
return isSimilarTo;
|
||||
case isDifferentFrom:
|
||||
return isDifferentFrom;
|
||||
}
|
||||
// makes the compiler happy
|
||||
throw new IllegalArgumentException("missing inverse mapping for" + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List of relation specific properties. Values include 'similarityLevel', indicating the similarity score between a
|
||||
* pair of publications.
|
||||
*/
|
||||
private List<KeyValue> properties = new ArrayList<>();
|
||||
/**
|
||||
* Main relationship classifier, values include 'resultResult', 'resultProject', 'resultOrganization', etc.
|
||||
*/
|
||||
private RELTYPE relType;
|
||||
|
||||
public String getRelType() {
|
||||
return relType;
|
||||
}
|
||||
/**
|
||||
* Further classifies a relationship, values include 'affiliation', 'similarity', 'supplement', etc.
|
||||
*/
|
||||
private SUBRELTYPE subRelType;
|
||||
|
||||
public void setRelType(final String relType) {
|
||||
this.relType = relType;
|
||||
}
|
||||
/**
|
||||
* Indicates the direction of the relationship, values include 'isSupplementTo', 'isSupplementedBy', 'merges,
|
||||
* 'isMergedIn'.
|
||||
*/
|
||||
private RELCLASS relClass;
|
||||
|
||||
public String getSubRelType() {
|
||||
return subRelType;
|
||||
}
|
||||
/**
|
||||
* The source entity id.
|
||||
*/
|
||||
private String source;
|
||||
|
||||
public void setSubRelType(final String subRelType) {
|
||||
this.subRelType = subRelType;
|
||||
}
|
||||
/**
|
||||
* The target entity id.
|
||||
*/
|
||||
private String target;
|
||||
|
||||
public String getRelClass() {
|
||||
return relClass;
|
||||
}
|
||||
/**
|
||||
* Was this relationship authoritatively validated?
|
||||
*/
|
||||
private Boolean validated;
|
||||
|
||||
public void setRelClass(final String relClass) {
|
||||
this.relClass = relClass;
|
||||
}
|
||||
/**
|
||||
* When was this relationship authoritatively validated.
|
||||
*/
|
||||
private String validationDate;
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
private List<Provenance> provenance;
|
||||
|
||||
public void setSource(final String source) {
|
||||
this.source = source;
|
||||
}
|
||||
/**
|
||||
* List of relation specific properties. Values include 'similarityLevel', indicating the similarity score between a
|
||||
* pair of publications.
|
||||
*/
|
||||
private List<KeyValue> properties = new ArrayList<>();
|
||||
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
public RELTYPE getRelType() {
|
||||
return relType;
|
||||
}
|
||||
|
||||
public void setTarget(final String target) {
|
||||
this.target = target;
|
||||
}
|
||||
public void setRelType(final RELTYPE relType) {
|
||||
this.relType = relType;
|
||||
}
|
||||
|
||||
public List<KeyValue> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
public SUBRELTYPE getSubRelType() {
|
||||
return subRelType;
|
||||
}
|
||||
|
||||
public void setProperties(List<KeyValue> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
public void setSubRelType(final SUBRELTYPE subRelType) {
|
||||
this.subRelType = subRelType;
|
||||
}
|
||||
|
||||
public Boolean getValidated() {
|
||||
return Objects.nonNull(validated) && validated;
|
||||
}
|
||||
public RELCLASS getRelClass() {
|
||||
return relClass;
|
||||
}
|
||||
|
||||
public void setValidated(Boolean validated) {
|
||||
this.validated = validated;
|
||||
}
|
||||
public void setRelClass(final RELCLASS relClass) {
|
||||
this.relClass = relClass;
|
||||
}
|
||||
|
||||
public String getValidationDate() {
|
||||
return validationDate;
|
||||
}
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setValidationDate(String validationDate) {
|
||||
this.validationDate = validationDate;
|
||||
}
|
||||
public void setSource(final String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public void mergeFrom(final Relation r) {
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
checkArgument(Objects.equals(getSource(), r.getSource()), "source ids must be equal");
|
||||
checkArgument(Objects.equals(getTarget(), r.getTarget()), "target ids must be equal");
|
||||
checkArgument(Objects.equals(getRelType(), r.getRelType()), "relType(s) must be equal");
|
||||
checkArgument(
|
||||
Objects.equals(getSubRelType(), r.getSubRelType()), "subRelType(s) must be equal");
|
||||
checkArgument(Objects.equals(getRelClass(), r.getRelClass()), "relClass(es) must be equal");
|
||||
public void setTarget(final String target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
setValidated(getValidated() || r.getValidated());
|
||||
try {
|
||||
setValidationDate(ModelSupport.oldest(getValidationDate(), r.getValidationDate()));
|
||||
} catch (ParseException e) {
|
||||
throw new IllegalArgumentException(String
|
||||
.format(
|
||||
"invalid validation date format in relation [s:%s, t:%s]: %s", getSource(), getTarget(),
|
||||
getValidationDate()));
|
||||
}
|
||||
public List<KeyValue> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
super.mergeFrom(r);
|
||||
}
|
||||
public void setProperties(List<KeyValue> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
Relation relation = (Relation) o;
|
||||
return relType.equals(relation.relType)
|
||||
&& subRelType.equals(relation.subRelType)
|
||||
&& relClass.equals(relation.relClass)
|
||||
&& source.equals(relation.source)
|
||||
&& target.equals(relation.target);
|
||||
}
|
||||
public Boolean getValidated() {
|
||||
return Objects.nonNull(validated) && validated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(relType, subRelType, relClass, source, target, collectedfrom);
|
||||
}
|
||||
public void setValidated(Boolean validated) {
|
||||
this.validated = validated;
|
||||
}
|
||||
|
||||
public String getValidationDate() {
|
||||
return validationDate;
|
||||
}
|
||||
|
||||
public void setValidationDate(String validationDate) {
|
||||
this.validationDate = validationDate;
|
||||
}
|
||||
|
||||
public List<Provenance> getProvenance() {
|
||||
return provenance;
|
||||
}
|
||||
|
||||
public void setProvenance(List<Provenance> provenance) {
|
||||
this.provenance = provenance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
Relation relation = (Relation) o;
|
||||
return relType.equals(relation.relType)
|
||||
&& subRelType.equals(relation.subRelType)
|
||||
&& relClass.equals(relation.relClass)
|
||||
&& source.equals(relation.source)
|
||||
&& target.equals(relation.target);
|
||||
}
|
||||
|
||||
public Relation inverse() {
|
||||
final Relation inverse = new Relation();
|
||||
inverse.setSource(this.target);
|
||||
inverse.setTarget(this.source);
|
||||
inverse.setRelClass(this.relClass.getInverse());
|
||||
inverse.setRelType(this.relType);
|
||||
inverse.setSubRelType(this.subRelType);
|
||||
inverse.setProperties(this.properties);
|
||||
inverse.setValidated(validated);
|
||||
inverse.setProvenance(provenance);
|
||||
inverse.setValidationDate(validationDate);
|
||||
return inverse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(relType, subRelType, relClass, source, target, provenance);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,38 +2,29 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The type Result.
|
||||
*/
|
||||
public class Result extends OafEntity implements Serializable {
|
||||
public class Result extends Entity implements Serializable {
|
||||
|
||||
public enum RESULTTYPE {
|
||||
publication,
|
||||
dataset,
|
||||
software,
|
||||
otherresearchproduct
|
||||
}
|
||||
|
||||
/**
|
||||
* ( article | book ) processing charges.
|
||||
*/
|
||||
|
||||
private Field<String> processingchargeamount;
|
||||
|
||||
private String processingchargeamount;
|
||||
|
||||
/**
|
||||
* currency - alphabetic code describe in ISO-4217.
|
||||
*/
|
||||
private Field<String> processingchargecurrency;
|
||||
|
||||
/**
|
||||
* The Measures.
|
||||
*/
|
||||
private List<Measure> measures;
|
||||
private String processingchargecurrency;
|
||||
|
||||
/**
|
||||
* The Author.
|
||||
|
@ -41,15 +32,13 @@ public class Result extends OafEntity implements Serializable {
|
|||
private List<Author> author;
|
||||
|
||||
/**
|
||||
* The Resulttype.
|
||||
* The Resulttype. It allows subclassing results into publications | datasets | software | orp
|
||||
*/
|
||||
// resulttype allows subclassing results into publications | datasets | software
|
||||
private Qualifier resulttype;
|
||||
private RESULTTYPE resulttype;
|
||||
|
||||
/**
|
||||
* The Language.
|
||||
*/
|
||||
// common fields
|
||||
private Qualifier language;
|
||||
|
||||
/**
|
||||
|
@ -75,42 +64,42 @@ public class Result extends OafEntity implements Serializable {
|
|||
/**
|
||||
* The Description.
|
||||
*/
|
||||
private List<Field<String>> description;
|
||||
private List<String> description;
|
||||
|
||||
/**
|
||||
* The Dateofacceptance.
|
||||
*/
|
||||
private Field<String> dateofacceptance;
|
||||
private String dateofacceptance;
|
||||
|
||||
/**
|
||||
* The Publisher.
|
||||
*/
|
||||
private Field<String> publisher;
|
||||
private Publisher publisher;
|
||||
|
||||
/**
|
||||
* The Embargoenddate.
|
||||
*/
|
||||
private Field<String> embargoenddate;
|
||||
private String embargoenddate;
|
||||
|
||||
/**
|
||||
* The Source.
|
||||
*/
|
||||
private List<Field<String>> source;
|
||||
private List<String> source;
|
||||
|
||||
/**
|
||||
* The Fulltext.
|
||||
*/
|
||||
private List<Field<String>> fulltext; // remove candidate
|
||||
private List<String> fulltext;
|
||||
|
||||
/**
|
||||
* The Format.
|
||||
*/
|
||||
private List<Field<String>> format;
|
||||
private List<String> format;
|
||||
|
||||
/**
|
||||
* The Contributor.
|
||||
*/
|
||||
private List<Field<String>> contributor;
|
||||
private List<String> contributor;
|
||||
|
||||
/**
|
||||
* The Resourcetype.
|
||||
|
@ -120,13 +109,15 @@ public class Result extends OafEntity implements Serializable {
|
|||
/**
|
||||
* The Coverage.
|
||||
*/
|
||||
private List<Field<String>> coverage;
|
||||
private List<String> coverage;
|
||||
|
||||
/**
|
||||
* The Bestaccessright.
|
||||
*/
|
||||
private Qualifier bestaccessright;
|
||||
|
||||
private Journal journal;
|
||||
|
||||
/**
|
||||
* The Context.
|
||||
*/
|
||||
|
@ -147,37 +138,21 @@ public class Result extends OafEntity implements Serializable {
|
|||
*/
|
||||
private List<EoscIfGuidelines> eoscifguidelines;
|
||||
|
||||
/**
|
||||
* Gets measures.
|
||||
*
|
||||
* @return the measures
|
||||
*/
|
||||
public List<Measure> getMeasures() {
|
||||
return measures;
|
||||
}
|
||||
private OAIProvenance oaiprovenance;
|
||||
|
||||
/**
|
||||
* Sets measures.
|
||||
*
|
||||
* @param measures the measures
|
||||
*/
|
||||
public void setMeasures(List<Measure> measures) {
|
||||
this.measures = measures;
|
||||
}
|
||||
|
||||
public Field<String> getProcessingchargeamount() {
|
||||
public String getProcessingchargeamount() {
|
||||
return processingchargeamount;
|
||||
}
|
||||
|
||||
public void setProcessingchargeamount(Field<String> processingchargeamount) {
|
||||
public void setProcessingchargeamount(String processingchargeamount) {
|
||||
this.processingchargeamount = processingchargeamount;
|
||||
}
|
||||
|
||||
public Field<String> getProcessingchargecurrency() {
|
||||
public String getProcessingchargecurrency() {
|
||||
return processingchargecurrency;
|
||||
}
|
||||
|
||||
public void setProcessingchargecurrency(Field<String> processingchargecurrency) {
|
||||
public void setProcessingchargecurrency(String processingchargecurrency) {
|
||||
this.processingchargecurrency = processingchargecurrency;
|
||||
}
|
||||
|
||||
|
@ -204,7 +179,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the resulttype
|
||||
*/
|
||||
public Qualifier getResulttype() {
|
||||
public RESULTTYPE getResulttype() {
|
||||
return resulttype;
|
||||
}
|
||||
|
||||
|
@ -213,7 +188,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param resulttype the resulttype
|
||||
*/
|
||||
public void setResulttype(Qualifier resulttype) {
|
||||
public void setResulttype(RESULTTYPE resulttype) {
|
||||
this.resulttype = resulttype;
|
||||
}
|
||||
|
||||
|
@ -312,7 +287,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the description
|
||||
*/
|
||||
public List<Field<String>> getDescription() {
|
||||
public List<String> getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
|
@ -321,7 +296,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param description the description
|
||||
*/
|
||||
public void setDescription(List<Field<String>> description) {
|
||||
public void setDescription(List<String> description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
@ -330,7 +305,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the dateofacceptance
|
||||
*/
|
||||
public Field<String> getDateofacceptance() {
|
||||
public String getDateofacceptance() {
|
||||
return dateofacceptance;
|
||||
}
|
||||
|
||||
|
@ -339,7 +314,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param dateofacceptance the dateofacceptance
|
||||
*/
|
||||
public void setDateofacceptance(Field<String> dateofacceptance) {
|
||||
public void setDateofacceptance(String dateofacceptance) {
|
||||
this.dateofacceptance = dateofacceptance;
|
||||
}
|
||||
|
||||
|
@ -348,7 +323,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the publisher
|
||||
*/
|
||||
public Field<String> getPublisher() {
|
||||
public Publisher getPublisher() {
|
||||
return publisher;
|
||||
}
|
||||
|
||||
|
@ -357,7 +332,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param publisher the publisher
|
||||
*/
|
||||
public void setPublisher(Field<String> publisher) {
|
||||
public void setPublisher(Publisher publisher) {
|
||||
this.publisher = publisher;
|
||||
}
|
||||
|
||||
|
@ -366,7 +341,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the embargoenddate
|
||||
*/
|
||||
public Field<String> getEmbargoenddate() {
|
||||
public String getEmbargoenddate() {
|
||||
return embargoenddate;
|
||||
}
|
||||
|
||||
|
@ -375,7 +350,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param embargoenddate the embargoenddate
|
||||
*/
|
||||
public void setEmbargoenddate(Field<String> embargoenddate) {
|
||||
public void setEmbargoenddate(String embargoenddate) {
|
||||
this.embargoenddate = embargoenddate;
|
||||
}
|
||||
|
||||
|
@ -384,7 +359,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the source
|
||||
*/
|
||||
public List<Field<String>> getSource() {
|
||||
public List<String> getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
|
@ -393,7 +368,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param source the source
|
||||
*/
|
||||
public void setSource(List<Field<String>> source) {
|
||||
public void setSource(List<String> source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
|
@ -402,7 +377,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the fulltext
|
||||
*/
|
||||
public List<Field<String>> getFulltext() {
|
||||
public List<String> getFulltext() {
|
||||
return fulltext;
|
||||
}
|
||||
|
||||
|
@ -411,7 +386,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param fulltext the fulltext
|
||||
*/
|
||||
public void setFulltext(List<Field<String>> fulltext) {
|
||||
public void setFulltext(List<String> fulltext) {
|
||||
this.fulltext = fulltext;
|
||||
}
|
||||
|
||||
|
@ -420,7 +395,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the format
|
||||
*/
|
||||
public List<Field<String>> getFormat() {
|
||||
public List<String> getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
|
@ -429,7 +404,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param format the format
|
||||
*/
|
||||
public void setFormat(List<Field<String>> format) {
|
||||
public void setFormat(List<String> format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
|
@ -438,7 +413,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the contributor
|
||||
*/
|
||||
public List<Field<String>> getContributor() {
|
||||
public List<String> getContributor() {
|
||||
return contributor;
|
||||
}
|
||||
|
||||
|
@ -447,7 +422,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param contributor the contributor
|
||||
*/
|
||||
public void setContributor(List<Field<String>> contributor) {
|
||||
public void setContributor(List<String> contributor) {
|
||||
this.contributor = contributor;
|
||||
}
|
||||
|
||||
|
@ -474,7 +449,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @return the coverage
|
||||
*/
|
||||
public List<Field<String>> getCoverage() {
|
||||
public List<String> getCoverage() {
|
||||
return coverage;
|
||||
}
|
||||
|
||||
|
@ -483,7 +458,7 @@ public class Result extends OafEntity implements Serializable {
|
|||
*
|
||||
* @param coverage the coverage
|
||||
*/
|
||||
public void setCoverage(List<Field<String>> coverage) {
|
||||
public void setCoverage(List<String> coverage) {
|
||||
this.coverage = coverage;
|
||||
}
|
||||
|
||||
|
@ -505,6 +480,14 @@ public class Result extends OafEntity implements Serializable {
|
|||
this.bestaccessright = bestaccessright;
|
||||
}
|
||||
|
||||
public Journal getJournal() {
|
||||
return journal;
|
||||
}
|
||||
|
||||
public void setJournal(Journal journal) {
|
||||
this.journal = journal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets context.
|
||||
*
|
||||
|
@ -567,332 +550,11 @@ public class Result extends OafEntity implements Serializable {
|
|||
this.eoscifguidelines = eoscifguidelines;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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());
|
||||
public OAIProvenance getOaiprovenance() {
|
||||
return oaiprovenance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
if (!Result.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Result r = (Result) e;
|
||||
|
||||
if(processingchargeamount == null || StringUtils.isBlank(processingchargeamount.getValue() )){
|
||||
processingchargeamount = r.getProcessingchargeamount();
|
||||
processingchargecurrency = r.getProcessingchargecurrency();
|
||||
}
|
||||
|
||||
measures = mergeLists(measures, r.getMeasures());
|
||||
|
||||
eoscifguidelines = mergeLists(eoscifguidelines, r.getEoscifguidelines());
|
||||
|
||||
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)
|
||||
bestaccessright = r.getBestaccessright();
|
||||
|
||||
if (r.getResulttype() != null && compareTrust(this, r) < 0)
|
||||
resulttype = r.getResulttype();
|
||||
|
||||
if (r.getLanguage() != null && compareTrust(this, r) < 0)
|
||||
language = r.getLanguage();
|
||||
|
||||
if (Objects.nonNull(r.getDateofacceptance())) {
|
||||
if (Objects.isNull(getDateofacceptance())) {
|
||||
dateofacceptance = r.getDateofacceptance();
|
||||
} else if (compareTrust(this, r) < 0) {
|
||||
dateofacceptance = r.getDateofacceptance();
|
||||
}
|
||||
}
|
||||
|
||||
country = mergeLists(country, r.getCountry());
|
||||
|
||||
subject = mergeLists(subject, r.getSubject());
|
||||
|
||||
// merge title lists: main title with higher trust and distinct between the others
|
||||
StructuredProperty baseMainTitle = null;
|
||||
if (title != null) {
|
||||
baseMainTitle = getMainTitle(title);
|
||||
if (baseMainTitle != null) {
|
||||
final StructuredProperty p = baseMainTitle;
|
||||
title = title.stream().filter(t -> t != p).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
StructuredProperty newMainTitle = null;
|
||||
if (r.getTitle() != null) {
|
||||
newMainTitle = getMainTitle(r.getTitle());
|
||||
if (newMainTitle != null) {
|
||||
final StructuredProperty p = newMainTitle;
|
||||
r.setTitle(r.getTitle().stream().filter(t -> t != p).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
if (newMainTitle != null && compareTrust(this, r) < 0) {
|
||||
baseMainTitle = newMainTitle;
|
||||
}
|
||||
|
||||
title = mergeLists(title, r.getTitle());
|
||||
if (title != null && baseMainTitle != null) {
|
||||
title.add(baseMainTitle);
|
||||
}
|
||||
|
||||
relevantdate = mergeLists(relevantdate, r.getRelevantdate());
|
||||
|
||||
description = longestLists(description, r.getDescription());
|
||||
|
||||
if (r.getPublisher() != null && compareTrust(this, r) < 0)
|
||||
publisher = r.getPublisher();
|
||||
|
||||
if (r.getEmbargoenddate() != null && compareTrust(this, r) < 0)
|
||||
embargoenddate = r.getEmbargoenddate();
|
||||
|
||||
source = mergeLists(source, r.getSource());
|
||||
|
||||
fulltext = mergeLists(fulltext, r.getFulltext());
|
||||
|
||||
format = mergeLists(format, r.getFormat());
|
||||
|
||||
contributor = mergeLists(contributor, r.getContributor());
|
||||
|
||||
if (r.getResourcetype() != null)
|
||||
resourcetype = r.getResourcetype();
|
||||
|
||||
coverage = mergeLists(coverage, r.getCoverage());
|
||||
|
||||
context = mergeLists(context, r.getContext());
|
||||
|
||||
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;
|
||||
if (a.size() == b.size()) {
|
||||
int msa = a
|
||||
.stream()
|
||||
.filter(i -> i != null && i.getValue() != null)
|
||||
.map(i -> i.getValue().length())
|
||||
.max(Comparator.naturalOrder())
|
||||
.orElse(0);
|
||||
int msb = b
|
||||
.stream()
|
||||
.filter(i -> i != null && i.getValue() != null)
|
||||
.map(i -> i.getValue().length())
|
||||
.max(Comparator.naturalOrder())
|
||||
.orElse(0);
|
||||
return msa > msb ? a : b;
|
||||
}
|
||||
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)
|
||||
for (StructuredProperty t : titles) {
|
||||
if (t.getQualifier() != null && t.getQualifier().getClassid() != null)
|
||||
if (t.getQualifier().getClassid().equals("main title"))
|
||||
return t;
|
||||
}
|
||||
return null;
|
||||
public void setOaiprovenance(OAIProvenance oaiprovenance) {
|
||||
this.oaiprovenance = oaiprovenance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,45 +4,32 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
|
||||
public class Software extends Result implements Serializable {
|
||||
|
||||
private List<Field<String>> documentationUrl;
|
||||
private List<String> documentationUrl;
|
||||
|
||||
// candidate for removal
|
||||
private List<StructuredProperty> license;
|
||||
|
||||
// candidate for removal
|
||||
private Field<String> codeRepositoryUrl;
|
||||
private String codeRepositoryUrl;
|
||||
|
||||
private Qualifier programmingLanguage;
|
||||
|
||||
public Software() {
|
||||
setResulttype(ModelConstants.SOFTWARE_DEFAULT_RESULTTYPE);
|
||||
setResulttype(RESULTTYPE.software);
|
||||
}
|
||||
|
||||
public List<Field<String>> getDocumentationUrl() {
|
||||
public List<String> getDocumentationUrl() {
|
||||
return documentationUrl;
|
||||
}
|
||||
|
||||
public void setDocumentationUrl(List<Field<String>> documentationUrl) {
|
||||
public void setDocumentationUrl(List<String> documentationUrl) {
|
||||
this.documentationUrl = documentationUrl;
|
||||
}
|
||||
|
||||
public List<StructuredProperty> getLicense() {
|
||||
return license;
|
||||
}
|
||||
|
||||
public void setLicense(List<StructuredProperty> license) {
|
||||
this.license = license;
|
||||
}
|
||||
|
||||
public Field<String> getCodeRepositoryUrl() {
|
||||
public String getCodeRepositoryUrl() {
|
||||
return codeRepositoryUrl;
|
||||
}
|
||||
|
||||
public void setCodeRepositoryUrl(Field<String> codeRepositoryUrl) {
|
||||
public void setCodeRepositoryUrl(String codeRepositoryUrl) {
|
||||
this.codeRepositoryUrl = codeRepositoryUrl;
|
||||
}
|
||||
|
||||
|
@ -53,28 +40,4 @@ public class Software extends Result implements Serializable {
|
|||
public void setProgrammingLanguage(Qualifier programmingLanguage) {
|
||||
this.programmingLanguage = programmingLanguage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeFrom(OafEntity e) {
|
||||
super.mergeFrom(e);
|
||||
|
||||
if (!Software.class.isAssignableFrom(e.getClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Software s = (Software) e;
|
||||
documentationUrl = mergeLists(documentationUrl, s.getDocumentationUrl());
|
||||
|
||||
license = mergeLists(license, s.getLicense());
|
||||
|
||||
codeRepositoryUrl = s.getCodeRepositoryUrl() != null && compareTrust(this, s) < 0
|
||||
? s.getCodeRepositoryUrl()
|
||||
: codeRepositoryUrl;
|
||||
|
||||
programmingLanguage = s.getProgrammingLanguage() != null && compareTrust(this, s) < 0
|
||||
? s.getProgrammingLanguage()
|
||||
: programmingLanguage;
|
||||
|
||||
mergeOAFDataInfo(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,6 @@ public class StructuredProperty implements Serializable {
|
|||
|
||||
private Qualifier qualifier;
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
@ -32,18 +30,10 @@ public class StructuredProperty implements Serializable {
|
|||
this.qualifier = qualifier;
|
||||
}
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
|
||||
public String toComparableString() {
|
||||
return Stream
|
||||
.of(
|
||||
getQualifier().toComparableString(),
|
||||
Optional.ofNullable(getQualifier()).map(q -> q.toComparableString()).orElse(""),
|
||||
Optional.ofNullable(getValue()).map(String::toLowerCase).orElse(""))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.joining("||"));
|
||||
|
|
|
@ -3,4 +3,14 @@ package eu.dnetlib.dhp.schema.oaf;
|
|||
import java.io.Serializable;
|
||||
|
||||
public class Subject extends StructuredProperty implements Serializable {
|
||||
|
||||
private DataInfo dataInfo;
|
||||
|
||||
public DataInfo getDataInfo() {
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
public void setDataInfo(DataInfo dataInfo) {
|
||||
this.dataInfo = dataInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
||||
|
||||
public class CleaningFunctions {
|
||||
|
||||
public static final String DOI_PREFIX_REGEX = "(^10\\.|\\/10\\.)";
|
||||
public static final String DOI_PREFIX = "10.";
|
||||
|
||||
public static final Set<String> PID_BLACKLIST = new HashSet<>();
|
||||
|
||||
static {
|
||||
PID_BLACKLIST.add("none");
|
||||
PID_BLACKLIST.add("na");
|
||||
}
|
||||
|
||||
public CleaningFunctions() {}
|
||||
|
||||
/**
|
||||
* Utility method that filter PID values on a per-type basis.
|
||||
* @param s the PID whose value will be checked.
|
||||
* @return false if the pid matches the filter criteria, true otherwise.
|
||||
*/
|
||||
public static boolean pidFilter(StructuredProperty s) {
|
||||
final String pidValue = s.getValue();
|
||||
if (Objects.isNull(s.getQualifier()) ||
|
||||
StringUtils.isBlank(pidValue) ||
|
||||
StringUtils.isBlank(pidValue.replaceAll("(?:\\n|\\r|\\t|\\s)", ""))) {
|
||||
return false;
|
||||
}
|
||||
if (CleaningFunctions.PID_BLACKLIST.contains(pidValue)) {
|
||||
return false;
|
||||
}
|
||||
return !PidBlacklistProvider.getBlacklist(s.getQualifier().getClassid()).contains(pidValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method that normalises PID values on a per-type basis.
|
||||
* @param pid the PID whose value will be normalised.
|
||||
* @return the PID containing the normalised value.
|
||||
*/
|
||||
public static StructuredProperty normalizePidValue(StructuredProperty pid) {
|
||||
pid.setValue(
|
||||
normalizePidValue(
|
||||
pid.getQualifier().getClassid(),
|
||||
pid.getValue()));
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
||||
public static String normalizePidValue(String pidType, String pidValue) {
|
||||
String value = Optional
|
||||
.ofNullable(pidValue)
|
||||
.map(String::trim)
|
||||
.orElseThrow(() -> new IllegalArgumentException("PID value cannot be empty"));
|
||||
|
||||
switch (pidType) {
|
||||
|
||||
// TODO add cleaning for more PID types as needed
|
||||
case "doi":
|
||||
return value.toLowerCase().replaceFirst(DOI_PREFIX_REGEX, DOI_PREFIX);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,292 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static eu.dnetlib.dhp.schema.common.ModelConstants.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
import eu.dnetlib.dhp.schema.oaf.*;
|
||||
|
||||
/**
|
||||
* Factory class for OpenAIRE identifiers in the Graph
|
||||
*/
|
||||
public class IdentifierFactory implements Serializable {
|
||||
|
||||
public static final String ID_SEPARATOR = "::";
|
||||
public static final String ID_PREFIX_SEPARATOR = "|";
|
||||
|
||||
public static final int ID_PREFIX_LEN = 12;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
static {
|
||||
PID_AUTHORITY.put(PidType.doi, HashBiMap.create());
|
||||
PID_AUTHORITY.get(PidType.doi).put(CROSSREF_ID, "Crossref");
|
||||
PID_AUTHORITY.get(PidType.doi).put(DATACITE_ID, "Datacite");
|
||||
PID_AUTHORITY.get(PidType.doi).put(ZENODO_OD_ID, "ZENODO");
|
||||
PID_AUTHORITY.get(PidType.doi).put(ZENODO_R3_ID, "Zenodo");
|
||||
|
||||
PID_AUTHORITY.put(PidType.pmc, HashBiMap.create());
|
||||
PID_AUTHORITY.get(PidType.pmc).put(EUROPE_PUBMED_CENTRAL_ID, "Europe PubMed Central");
|
||||
PID_AUTHORITY.get(PidType.pmc).put(PUBMED_CENTRAL_ID, "PubMed Central");
|
||||
|
||||
PID_AUTHORITY.put(PidType.pmid, HashBiMap.create());
|
||||
PID_AUTHORITY.get(PidType.pmid).put(EUROPE_PUBMED_CENTRAL_ID, "Europe PubMed Central");
|
||||
PID_AUTHORITY.get(PidType.pmid).put(PUBMED_CENTRAL_ID, "PubMed Central");
|
||||
|
||||
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();
|
||||
|
||||
static {
|
||||
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");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
public static <T extends Result> String createDOIBoostIdentifier(T entity) {
|
||||
if (entity == null)
|
||||
return null;
|
||||
|
||||
StructuredProperty pid = null;
|
||||
if (entity.getPid() != null) {
|
||||
pid = entity
|
||||
.getPid()
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(s -> s.getQualifier() != null && "doi".equalsIgnoreCase(s.getQualifier().getClassid()))
|
||||
.filter(CleaningFunctions::pidFilter)
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
} else {
|
||||
if (entity.getInstance() != null) {
|
||||
pid = entity
|
||||
.getInstance()
|
||||
.stream()
|
||||
.filter(i -> i.getPid() != null)
|
||||
.flatMap(i -> i.getPid().stream())
|
||||
.filter(CleaningFunctions::pidFilter)
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
if (pid != null)
|
||||
return idFromPid(entity, pid, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an identifier from the most relevant PID (if available) provided by a known PID authority in the given
|
||||
* entity T. Returns entity.id when none of the PIDs meet the selection criteria is available.
|
||||
*
|
||||
* @param entity the entity providing PIDs and a default ID.
|
||||
* @param <T> the specific entity type. Currently Organization and Result subclasses are supported.
|
||||
* @param md5 indicates whether should hash the PID value or not.
|
||||
* @return an identifier from the most relevant PID, entity.id otherwise
|
||||
*/
|
||||
public static <T extends OafEntity> String createIdentifier(T entity, boolean md5) {
|
||||
|
||||
checkArgument(StringUtils.isNoneBlank(entity.getId()), "missing entity identifier");
|
||||
|
||||
final Map<String, Set<StructuredProperty>> pids = extractPids(entity);
|
||||
|
||||
return pids
|
||||
.values()
|
||||
.stream()
|
||||
.flatMap(Set::stream)
|
||||
.min(new PidComparator<>(entity))
|
||||
.map(
|
||||
min -> Optional
|
||||
.ofNullable(pids.get(min.getQualifier().getClassid()))
|
||||
.map(
|
||||
p -> p
|
||||
.stream()
|
||||
.sorted(new PidValueComparator())
|
||||
.findFirst()
|
||||
.map(s -> idFromPid(entity, s, md5))
|
||||
.orElseGet(entity::getId))
|
||||
.orElseGet(entity::getId))
|
||||
.orElseGet(entity::getId);
|
||||
}
|
||||
|
||||
private static <T extends OafEntity> Map<String, Set<StructuredProperty>> extractPids(T entity) {
|
||||
if (entity instanceof Result) {
|
||||
return Optional
|
||||
.ofNullable(((Result) entity).getInstance())
|
||||
.map(IdentifierFactory::mapPids)
|
||||
.orElse(new HashMap<>());
|
||||
} else {
|
||||
return entity
|
||||
.getPid()
|
||||
.stream()
|
||||
.map(CleaningFunctions::normalizePidValue)
|
||||
.filter(CleaningFunctions::pidFilter)
|
||||
.collect(
|
||||
Collectors
|
||||
.groupingBy(
|
||||
p -> p.getQualifier().getClassid(),
|
||||
Collectors.mapping(p -> p, Collectors.toCollection(HashSet::new))));
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, Set<StructuredProperty>> mapPids(List<Instance> instance) {
|
||||
return instance
|
||||
.stream()
|
||||
.map(i -> pidFromInstance(i.getPid(), i.getCollectedfrom(), false))
|
||||
.flatMap(Function.identity())
|
||||
.collect(
|
||||
Collectors
|
||||
.groupingBy(
|
||||
p -> p.getQualifier().getClassid(),
|
||||
Collectors.mapping(p -> p, Collectors.toCollection(HashSet::new))));
|
||||
}
|
||||
|
||||
private static Stream<StructuredProperty> pidFromInstance(List<StructuredProperty> pid, KeyValue collectedFrom,
|
||||
boolean mapHandles) {
|
||||
return Optional
|
||||
.ofNullable(pid)
|
||||
.map(
|
||||
pp -> pp
|
||||
.stream()
|
||||
// filter away PIDs provided by a DS that is not considered an authority for the
|
||||
// given PID Type
|
||||
.filter(p -> shouldFilterPidByCriteria(collectedFrom, p, mapHandles))
|
||||
.map(CleaningFunctions::normalizePidValue)
|
||||
.filter(p -> isNotFromDelegatedAuthority(collectedFrom, p))
|
||||
.filter(CleaningFunctions::pidFilter))
|
||||
.orElse(Stream.empty());
|
||||
}
|
||||
|
||||
|
||||
private static boolean shouldFilterPidByCriteria(KeyValue collectedFrom, StructuredProperty p, boolean mapHandles) {
|
||||
final PidType pType = PidType.tryValueOf(p.getQualifier().getClassid());
|
||||
|
||||
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) {
|
||||
final PidType pType = PidType.tryValueOf(p.getQualifier().getClassid());
|
||||
|
||||
final Map<String, String> da = DELEGATED_PID_AUTHORITY.get(pType);
|
||||
if (Objects.isNull(da)) {
|
||||
return true;
|
||||
}
|
||||
if (!da.containsKey(collectedFrom.getKey())) {
|
||||
return true;
|
||||
}
|
||||
return StringUtils.contains(p.getValue(), da.get(collectedFrom.getKey()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link IdentifierFactory#createIdentifier(OafEntity, boolean)}
|
||||
*/
|
||||
public static <T extends OafEntity> String createIdentifier(T entity) {
|
||||
|
||||
return createIdentifier(entity, true);
|
||||
}
|
||||
|
||||
private static <T extends OafEntity> String idFromPid(T entity, StructuredProperty s, boolean md5) {
|
||||
return idFromPid(ModelSupport.getIdPrefix(entity.getClass()), s.getQualifier().getClassid(), s.getValue(), md5);
|
||||
}
|
||||
|
||||
public static String idFromPid(String numericPrefix, String pidType, String pidValue, boolean md5) {
|
||||
return new StringBuilder()
|
||||
.append(numericPrefix)
|
||||
.append(ID_PREFIX_SEPARATOR)
|
||||
.append(createPrefix(pidType))
|
||||
.append(ID_SEPARATOR)
|
||||
.append(md5 ? md5(pidValue) : pidValue)
|
||||
.toString();
|
||||
}
|
||||
|
||||
// create the prefix (length = 12)
|
||||
private static String createPrefix(String pidType) {
|
||||
StringBuilder prefix = new StringBuilder(StringUtils.left(pidType, ID_PREFIX_LEN));
|
||||
while (prefix.length() < ID_PREFIX_LEN) {
|
||||
prefix.append("_");
|
||||
}
|
||||
return prefix.substring(0, ID_PREFIX_LEN);
|
||||
}
|
||||
|
||||
public static String md5(final String s) {
|
||||
try {
|
||||
final MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(s.getBytes(StandardCharsets.UTF_8));
|
||||
return new String(Hex.encodeHex(md.digest()));
|
||||
} catch (final Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
public class ModelHardLimits {
|
||||
|
||||
private ModelHardLimits() {}
|
||||
|
||||
public static final String LAYOUT = "index";
|
||||
public static final String INTERPRETATION = "openaire";
|
||||
public static final String SEPARATOR = "-";
|
||||
|
||||
public static final int MAX_EXTERNAL_ENTITIES = 50;
|
||||
public static final int MAX_AUTHORS = 200;
|
||||
public static final int MAX_AUTHOR_FULLNAME_LENGTH = 1000;
|
||||
public static final int MAX_TITLE_LENGTH = 5000;
|
||||
public static final int MAX_TITLES = 10;
|
||||
public static final int MAX_ABSTRACT_LENGTH = 150000;
|
||||
public static final int MAX_INSTANCES = 10;
|
||||
|
||||
public static String getCollectionName(String format) {
|
||||
return format + SEPARATOR + LAYOUT + SEPARATOR + INTERPRETATION;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
||||
|
||||
public class OrganizationPidComparator implements Comparator<StructuredProperty> {
|
||||
|
||||
@Override
|
||||
public int compare(StructuredProperty left, StructuredProperty right) {
|
||||
|
||||
PidType lClass = PidType.tryValueOf(left.getQualifier().getClassid());
|
||||
PidType rClass = PidType.tryValueOf(right.getQualifier().getClassid());
|
||||
|
||||
if (lClass.equals(PidType.openorgs))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.openorgs))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.GRID))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.GRID))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.mag_id))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.mag_id))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.urn))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.urn))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class PidBlacklist extends HashMap<String, HashSet<String>> {
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class PidBlacklistProvider {
|
||||
|
||||
private static final PidBlacklist blacklist;
|
||||
|
||||
static {
|
||||
try {
|
||||
String json = IOUtils.toString(IdentifierFactory.class.getResourceAsStream("pid_blacklist.json"));
|
||||
blacklist = new ObjectMapper().readValue(json, PidBlacklist.class);
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static PidBlacklist getBlacklist() {
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
public static Set<String> getBlacklist(String pidType) {
|
||||
return Optional
|
||||
.ofNullable(getBlacklist().get(pidType))
|
||||
.orElse(new HashSet<>());
|
||||
}
|
||||
|
||||
private PidBlacklistProvider() {}
|
||||
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelSupport;
|
||||
import eu.dnetlib.dhp.schema.oaf.OafEntity;
|
||||
import eu.dnetlib.dhp.schema.oaf.Organization;
|
||||
import eu.dnetlib.dhp.schema.oaf.Result;
|
||||
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
||||
|
||||
public class PidComparator<T extends OafEntity> implements Comparator<StructuredProperty> {
|
||||
|
||||
private final T entity;
|
||||
|
||||
public PidComparator(T entity) {
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(StructuredProperty left, StructuredProperty right) {
|
||||
|
||||
if (left == null && right == null)
|
||||
return 0;
|
||||
if (left == null)
|
||||
return 1;
|
||||
if (right == null)
|
||||
return -1;
|
||||
|
||||
if (ModelSupport.isSubClass(entity, Result.class)) {
|
||||
return compareResultPids(left, right);
|
||||
}
|
||||
if (ModelSupport.isSubClass(entity, Organization.class)) {
|
||||
return compareOrganizationtPids(left, right);
|
||||
}
|
||||
|
||||
// Else (but unlikely), lexicographical ordering will do.
|
||||
return left.getQualifier().getClassid().compareTo(right.getQualifier().getClassid());
|
||||
}
|
||||
|
||||
private int compareResultPids(StructuredProperty left, StructuredProperty right) {
|
||||
return new ResultPidComparator().compare(left, right);
|
||||
}
|
||||
|
||||
private int compareOrganizationtPids(StructuredProperty left, StructuredProperty right) {
|
||||
return new OrganizationPidComparator().compare(left, right);
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import org.apache.commons.lang3.EnumUtils;
|
||||
|
||||
public enum PidType {
|
||||
|
||||
/**
|
||||
* The DOI syntax shall be made up of a DOI prefix and a DOI suffix separated by a forward slash.
|
||||
*
|
||||
* There is no defined limit on the length of the DOI name, or of the DOI prefix or DOI suffix.
|
||||
*
|
||||
* The DOI name is case-insensitive and can incorporate any printable characters from the legal graphic characters
|
||||
* of Unicode. Further constraints on character use (e.g. use of language-specific alphanumeric characters) can be
|
||||
* defined for an application by the ISO 26324 Registration Authority.
|
||||
*
|
||||
*
|
||||
* DOI prefix: The DOI prefix shall be composed of a directory indicator followed by a registrant code.
|
||||
* These two components shall be separated by a full stop (period). The directory indicator shall be "10" and
|
||||
* distinguishes the entire set of character strings (prefix and suffix) as digital object identifiers within the
|
||||
* resolution system.
|
||||
*
|
||||
* Registrant code: The second element of the DOI prefix shall be the registrant code. The registrant code is a
|
||||
* unique string assigned to a registrant.
|
||||
*
|
||||
* DOI suffix: The DOI suffix shall consist of a character string of any length chosen by the registrant.
|
||||
* Each suffix shall be unique to the prefix element that precedes it. The unique suffix can be a sequential number,
|
||||
* or it might incorporate an identifier generated from or based on another system used by the registrant
|
||||
* (e.g. ISAN, ISBN, ISRC, ISSN, ISTC, ISNI; in such cases, a preferred construction for such a suffix can be
|
||||
* specified, as in Example 1).
|
||||
*
|
||||
* Source: https://www.doi.org/doi_handbook/2_Numbering.html#2.2
|
||||
*/
|
||||
doi,
|
||||
|
||||
/**
|
||||
* PubMed Unique Identifier (PMID)
|
||||
*
|
||||
* This field is a 1-to-8 digit accession number with no leading zeros. It is present on all records and is the
|
||||
* accession number for managing and disseminating records. PMIDs are not reused after records are deleted.
|
||||
*
|
||||
* Beginning in February 2012 PMIDs include extensions following a decimal point to account for article versions
|
||||
* (e.g., 21804956.2). All citations are considered version 1 until replaced. The extended PMID is not displayed
|
||||
* on the MEDLINE format.
|
||||
*
|
||||
* View the citation in abstract format in PubMed to access additional versions when available (see the article in
|
||||
* the Jan-Feb 2012 NLM Technical Bulletin).
|
||||
*
|
||||
* Source: https://www.nlm.nih.gov/bsd/mms/medlineelements.html#pmid
|
||||
*/
|
||||
pmid,
|
||||
|
||||
/**
|
||||
* This field contains the unique identifier for the cited article in PubMed Central. The identifier begins with the
|
||||
* prefix PMC.
|
||||
*
|
||||
* Source: https://www.nlm.nih.gov/bsd/mms/medlineelements.html#pmc
|
||||
*/
|
||||
pmc, handle, arXiv, nct, pdb, w3id,
|
||||
|
||||
// Organization
|
||||
openorgs, corda, corda_h2020, GRID, mag_id, urn,
|
||||
|
||||
// Used by dedup
|
||||
undefined, original;
|
||||
|
||||
public static boolean isValid(String type) {
|
||||
return EnumUtils.isValidEnum(PidType.class, type);
|
||||
}
|
||||
|
||||
public static PidType tryValueOf(String s) {
|
||||
try {
|
||||
return PidType.valueOf(s);
|
||||
} catch (Exception e) {
|
||||
return PidType.original;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Optional;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
||||
|
||||
public class PidValueComparator implements Comparator<StructuredProperty> {
|
||||
|
||||
@Override
|
||||
public int compare(StructuredProperty left, StructuredProperty right) {
|
||||
|
||||
if (left == null && right == null)
|
||||
return 0;
|
||||
if (left == null)
|
||||
return 1;
|
||||
if (right == null)
|
||||
return -1;
|
||||
|
||||
StructuredProperty l = CleaningFunctions.normalizePidValue(left);
|
||||
StructuredProperty r = CleaningFunctions.normalizePidValue(right);
|
||||
|
||||
return Optional
|
||||
.ofNullable(l.getValue())
|
||||
.map(
|
||||
lv -> Optional
|
||||
.ofNullable(r.getValue())
|
||||
.map(rv -> lv.compareTo(rv))
|
||||
.orElse(-1))
|
||||
.orElse(1);
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
||||
|
||||
public class ResultPidComparator implements Comparator<StructuredProperty> {
|
||||
|
||||
@Override
|
||||
public int compare(StructuredProperty left, StructuredProperty right) {
|
||||
|
||||
PidType lClass = PidType.tryValueOf(left.getQualifier().getClassid());
|
||||
PidType rClass = PidType.tryValueOf(right.getQualifier().getClassid());
|
||||
|
||||
if (lClass.equals(PidType.doi))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.doi))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.pmid))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.pmid))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.pmc))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.pmc))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.handle))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.handle))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.arXiv))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.arXiv))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.nct))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.nct))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(PidType.pdb))
|
||||
return -1;
|
||||
if (rClass.equals(PidType.pdb))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import static eu.dnetlib.dhp.schema.common.ModelConstants.CROSSREF_ID;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import eu.dnetlib.dhp.schema.oaf.KeyValue;
|
||||
import eu.dnetlib.dhp.schema.oaf.Result;
|
||||
|
||||
public class ResultTypeComparator implements Comparator<Result> {
|
||||
|
||||
@Override
|
||||
public int compare(Result left, Result right) {
|
||||
|
||||
if (left == null && right == null)
|
||||
return 0;
|
||||
if (left == null)
|
||||
return 1;
|
||||
if (right == null)
|
||||
return -1;
|
||||
|
||||
HashSet<String> lCf = getCollectedFromIds(left);
|
||||
HashSet<String> rCf = getCollectedFromIds(right);
|
||||
|
||||
if (lCf.contains(CROSSREF_ID) && !rCf.contains(CROSSREF_ID)) {
|
||||
return -1;
|
||||
}
|
||||
if (!lCf.contains(CROSSREF_ID) && rCf.contains(CROSSREF_ID)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
String lClass = left.getResulttype().getClassid();
|
||||
String rClass = right.getResulttype().getClassid();
|
||||
|
||||
if (lClass.equals(rClass))
|
||||
return 0;
|
||||
|
||||
if (lClass.equals(ModelConstants.PUBLICATION_RESULTTYPE_CLASSID))
|
||||
return -1;
|
||||
if (rClass.equals(ModelConstants.PUBLICATION_RESULTTYPE_CLASSID))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(ModelConstants.DATASET_RESULTTYPE_CLASSID))
|
||||
return -1;
|
||||
if (rClass.equals(ModelConstants.DATASET_RESULTTYPE_CLASSID))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(ModelConstants.SOFTWARE_RESULTTYPE_CLASSID))
|
||||
return -1;
|
||||
if (rClass.equals(ModelConstants.SOFTWARE_RESULTTYPE_CLASSID))
|
||||
return 1;
|
||||
|
||||
if (lClass.equals(ModelConstants.ORP_RESULTTYPE_CLASSID))
|
||||
return -1;
|
||||
if (rClass.equals(ModelConstants.ORP_RESULTTYPE_CLASSID))
|
||||
return 1;
|
||||
|
||||
// Else (but unlikely), lexicographical ordering will do.
|
||||
return lClass.compareTo(rClass);
|
||||
}
|
||||
|
||||
protected HashSet<String> getCollectedFromIds(Result left) {
|
||||
return Optional
|
||||
.ofNullable(left.getCollectedfrom())
|
||||
.map(
|
||||
cf -> cf
|
||||
.stream()
|
||||
.map(KeyValue::getKey)
|
||||
.collect(Collectors.toCollection(HashSet::new)))
|
||||
.orElse(new HashSet<>());
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
package eu.dnetlib.dhp.schema.sx
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants
|
||||
import eu.dnetlib.dhp.schema.oaf.{AccessRight, DataInfo, Field, KeyValue, Qualifier, StructuredProperty}
|
||||
|
||||
object OafUtils {
|
||||
|
||||
|
||||
|
||||
def generateKeyValue(key: String, value: String): KeyValue = {
|
||||
val kv: KeyValue = new KeyValue()
|
||||
kv.setKey(key)
|
||||
kv.setValue(value)
|
||||
kv.setDataInfo(generateDataInfo("0.9"))
|
||||
kv
|
||||
}
|
||||
|
||||
|
||||
def generateDataInfo(trust: String = "0.9", invisible: Boolean = false): DataInfo = {
|
||||
val di = new DataInfo
|
||||
di.setDeletedbyinference(false)
|
||||
di.setInferred(false)
|
||||
di.setInvisible(invisible)
|
||||
di.setTrust(trust)
|
||||
di.setProvenanceaction(createQualifier(ModelConstants.SYSIMPORT_ACTIONSET, ModelConstants.DNET_PROVENANCE_ACTIONS))
|
||||
di
|
||||
}
|
||||
|
||||
def createQualifier(cls: String, sch: String): Qualifier = {
|
||||
createQualifier(cls, cls, sch, sch)
|
||||
}
|
||||
|
||||
|
||||
def createQualifier(classId: String, className: String, schemeId: String, schemeName: String): Qualifier = {
|
||||
val q: Qualifier = new Qualifier
|
||||
q.setClassid(classId)
|
||||
q.setClassname(className)
|
||||
q.setSchemeid(schemeId)
|
||||
q.setSchemename(schemeName)
|
||||
q
|
||||
}
|
||||
|
||||
def createAccessRight(classId: String, className: String, schemeId: String, schemeName: String): AccessRight = {
|
||||
val accessRight: AccessRight = new AccessRight
|
||||
accessRight.setClassid(classId)
|
||||
accessRight.setClassname(className)
|
||||
accessRight.setSchemeid(schemeId)
|
||||
accessRight.setSchemename(schemeName)
|
||||
accessRight
|
||||
}
|
||||
|
||||
|
||||
def asField[T](value: T): Field[T] = {
|
||||
val tmp = new Field[T]
|
||||
tmp.setValue(value)
|
||||
tmp
|
||||
|
||||
|
||||
}
|
||||
|
||||
def createSP(value: String, classId: String,className:String, schemeId: String, schemeName:String): StructuredProperty = {
|
||||
val sp = new StructuredProperty
|
||||
sp.setQualifier(createQualifier(classId,className, schemeId, schemeName))
|
||||
sp.setValue(value)
|
||||
sp
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
def createSP(value: String, classId: String,className:String, schemeId: String, schemeName:String, dataInfo: DataInfo): StructuredProperty = {
|
||||
val sp = new StructuredProperty
|
||||
sp.setQualifier(createQualifier(classId,className, schemeId, schemeName))
|
||||
sp.setValue(value)
|
||||
sp.setDataInfo(dataInfo)
|
||||
sp
|
||||
|
||||
}
|
||||
|
||||
def createSP(value: String, classId: String, schemeId: String): StructuredProperty = {
|
||||
val sp = new StructuredProperty
|
||||
sp.setQualifier(createQualifier(classId, schemeId))
|
||||
sp.setValue(value)
|
||||
sp
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
def createSP(value: String, classId: String, schemeId: String, dataInfo: DataInfo): StructuredProperty = {
|
||||
val sp = new StructuredProperty
|
||||
sp.setQualifier(createQualifier(classId, schemeId))
|
||||
sp.setValue(value)
|
||||
sp.setDataInfo(dataInfo)
|
||||
sp
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -10,7 +10,6 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import eu.dnetlib.dhp.schema.oaf.Relation;
|
||||
|
||||
/** @author claudio.atzori */
|
||||
|
@ -23,9 +22,9 @@ class AtomicActionTest {
|
|||
Relation rel = new Relation();
|
||||
rel.setSource("1");
|
||||
rel.setTarget("2");
|
||||
rel.setRelType(ModelConstants.RESULT_RESULT);
|
||||
rel.setSubRelType(ModelConstants.DEDUP);
|
||||
rel.setRelClass(ModelConstants.MERGES);
|
||||
rel.setRelType(Relation.RELTYPE.resultResult);
|
||||
rel.setSubRelType(Relation.SUBRELTYPE.dedup);
|
||||
rel.setRelClass(Relation.RELCLASS.merges);
|
||||
|
||||
AtomicAction aa1 = new AtomicAction(Relation.class, rel);
|
||||
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.OafEntity;
|
||||
import eu.dnetlib.dhp.schema.oaf.Relation;
|
||||
import eu.dnetlib.dhp.schema.oaf.Result;
|
||||
|
||||
public class ModelSupportTest {
|
||||
|
||||
@Nested
|
||||
class IsSubClass {
|
||||
|
||||
@Test
|
||||
void shouldReturnFalseWhenSubClassDoesNotExtendSuperClass() {
|
||||
// when
|
||||
Boolean result = ModelSupport.isSubClass(Relation.class, OafEntity.class);
|
||||
|
||||
// then
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReturnTrueWhenSubClassExtendsSuperClass() {
|
||||
// when
|
||||
Boolean result = ModelSupport.isSubClass(Result.class, OafEntity.class);
|
||||
|
||||
// then
|
||||
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"));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,7 +39,6 @@ class MeasureTest {
|
|||
List<Measure> m = Lists.newArrayList(popularity, influence);
|
||||
|
||||
String s = OBJECT_MAPPER.writeValueAsString(m);
|
||||
System.out.println(s);
|
||||
|
||||
List<Measure> mm = OBJECT_MAPPER.readValue(s, new TypeReference<List<Measure>>() {
|
||||
});
|
||||
|
@ -47,8 +46,8 @@ class MeasureTest {
|
|||
Assertions.assertNotNull(mm);
|
||||
}
|
||||
|
||||
private KeyValue unit(String key, String value) {
|
||||
KeyValue unit = new KeyValue();
|
||||
private MeasureUnit unit(String key, String value) {
|
||||
MeasureUnit unit = new MeasureUnit();
|
||||
unit.setKey(key);
|
||||
unit.setValue(value);
|
||||
return unit;
|
||||
|
|
|
@ -1,682 +0,0 @@
|
|||
|
||||
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;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
|
||||
// string list merge test
|
||||
List<String> a = Arrays.asList("a", "b", "c", "e");
|
||||
List<String> b = Arrays.asList("a", "b", "c", "d");
|
||||
List<String> c = null;
|
||||
|
||||
System.out.println("merge result 1 = " + oaf.mergeLists(a, b));
|
||||
|
||||
System.out.println("merge result 2 = " + oaf.mergeLists(a, c));
|
||||
|
||||
System.out.println("merge result 3 = " + oaf.mergeLists(c, c));
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication collected from test.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationCollectedFromTest() {
|
||||
|
||||
Publication a = publication();
|
||||
Publication b = publication();
|
||||
|
||||
a.setCollectedfrom(Arrays.asList(setKV("a", "open"), setKV("b", "closed")));
|
||||
b.setCollectedfrom(Arrays.asList(setKV("A", "open"), setKV("b", "Open")));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getCollectedfrom());
|
||||
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() {
|
||||
|
||||
Publication a = publication();
|
||||
Publication b = publication();
|
||||
|
||||
a.setDateofacceptance(field("2021-06-18"));
|
||||
b.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-18", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test both present 1.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_bothPresent_1() {
|
||||
|
||||
Publication a = publication("0.8");
|
||||
Publication b = publication("0.9");
|
||||
|
||||
a.setDateofacceptance(field("2021-06-18"));
|
||||
b.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test both present 2.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_bothPresent_2() {
|
||||
|
||||
Publication a = publication("0.9");
|
||||
Publication b = publication("0.8");
|
||||
|
||||
a.setDateofacceptance(field("2021-06-18"));
|
||||
b.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-18", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test left missing.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_leftMissing() {
|
||||
|
||||
Publication a = publication();
|
||||
Publication b = publication();
|
||||
|
||||
b.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test left missing 1.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_leftMissing_1() {
|
||||
|
||||
Publication a = publication("0.9");
|
||||
Publication b = publication("0.8");
|
||||
|
||||
b.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test left missing 2.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_leftMissing_2() {
|
||||
|
||||
Publication a = publication("0.8");
|
||||
Publication b = publication("0.9");
|
||||
|
||||
b.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test right missing.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_rightMissing() {
|
||||
|
||||
Publication a = publication();
|
||||
Publication b = publication();
|
||||
|
||||
a.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test right missing 1.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_rightMissing_1() {
|
||||
|
||||
Publication a = publication("0.8");
|
||||
Publication b = publication("0.9");
|
||||
|
||||
a.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication date of acceptance test right missing 2.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationDateOfAcceptanceTest_rightMissing_2() {
|
||||
|
||||
Publication a = publication("0.9");
|
||||
Publication b = publication("0.8");
|
||||
|
||||
a.setDateofacceptance(field("2021-06-19"));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getDateofacceptance());
|
||||
assertEquals("2021-06-19", a.getDateofacceptance().getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication subject test.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationSubjectTest() {
|
||||
|
||||
Publication a = publication();
|
||||
Publication b = publication();
|
||||
|
||||
a.setSubject(Arrays.asList(setSub("a", "open", "classe"), setSub("b", "open", "classe")));
|
||||
b.setSubject(Arrays.asList(setSub("A", "open", "classe"), setSub("c", "open", "classe")));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getSubject());
|
||||
assertEquals(3, a.getSubject().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge publication EoscIfGuidelines test.
|
||||
*/
|
||||
@Test
|
||||
void mergePublicationEoscIfGuidelinesTest() {
|
||||
|
||||
Publication a = publication();
|
||||
Publication b = publication();
|
||||
|
||||
a.setEoscifguidelines(Lists.newArrayList(eoscifg("a", "label a", "https://aaa.aa", "semRelA")));
|
||||
b.setEoscifguidelines(Lists.newArrayList(eoscifg("a", "label a", "https://aaa.aa", "semRelA")));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getEoscifguidelines());
|
||||
assertEquals(1, a.getEoscifguidelines().size());
|
||||
|
||||
a.getEoscifguidelines().clear();
|
||||
b.getEoscifguidelines().clear();
|
||||
|
||||
a.setEoscifguidelines(Lists.newArrayList(eoscifg("a", "label a", "https://aaa.aa", "semRelA")));
|
||||
b.setEoscifguidelines(Lists.newArrayList(eoscifg("a", "label a", "https://aaa.aa", "semRelA")));
|
||||
|
||||
b.mergeFrom(a);
|
||||
|
||||
assertNotNull(a.getEoscifguidelines());
|
||||
assertEquals(1, a.getEoscifguidelines().size());
|
||||
|
||||
EoscIfGuidelines e = b.getEoscifguidelines().get(0);
|
||||
assertEquals("a", e.getCode());
|
||||
assertEquals("label a", e.getLabel());
|
||||
assertEquals("https://aaa.aa", e.getUrl());
|
||||
assertEquals("semRelA", e.getSemanticRelation());
|
||||
|
||||
a.getEoscifguidelines().clear();
|
||||
b.getEoscifguidelines().clear();
|
||||
|
||||
a.setEoscifguidelines(Lists.newArrayList(eoscifg("a", "label a", "https://aaa.aa", "semRelA")));
|
||||
b.setEoscifguidelines(Lists.newArrayList(eoscifg("b", "label b", "https://bbb.bb", "semRelB")));
|
||||
|
||||
a.mergeFrom(b);
|
||||
|
||||
assertNotNull(a.getEoscifguidelines());
|
||||
assertEquals(2, a.getEoscifguidelines().size());
|
||||
}
|
||||
|
||||
private EoscIfGuidelines eoscifg(String code, String label, String url, String semrel) {
|
||||
EoscIfGuidelines e = new EoscIfGuidelines();
|
||||
e.setCode(code);
|
||||
e.setLabel(label);
|
||||
e.setUrl(url);
|
||||
e.setSemanticRelation(semrel);
|
||||
return e;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge relation test.
|
||||
*/
|
||||
@Test
|
||||
void mergeRelationTest() {
|
||||
|
||||
Relation a = createRel(null, null);
|
||||
Relation b = createRel(null, null);
|
||||
a.mergeFrom(b);
|
||||
assertEquals(a, b);
|
||||
|
||||
a = createRel(true, null);
|
||||
b = createRel(null, null);
|
||||
a.mergeFrom(b);
|
||||
assertEquals(true, a.getValidated());
|
||||
|
||||
a = createRel(true, null);
|
||||
b = createRel(false, null);
|
||||
a.mergeFrom(b);
|
||||
assertEquals(true, a.getValidated());
|
||||
|
||||
a = createRel(true, null);
|
||||
b = createRel(true, "2016-04-05T12:41:19.202Z");
|
||||
a.mergeFrom(b);
|
||||
assertEquals("2016-04-05T12:41:19.202Z", a.getValidationDate());
|
||||
|
||||
a = createRel(true, "2016-05-07T12:41:19.202Z");
|
||||
b = createRel(true, "2016-04-05T12:41:19.202Z");
|
||||
a.mergeFrom(b);
|
||||
assertEquals("2016-04-05T12:41:19.202Z", a.getValidationDate());
|
||||
|
||||
a = createRel(true, "2020-09-10 11:08:52");
|
||||
b = createRel(true, "2021-09-10 11:08:52");
|
||||
a.mergeFrom(b);
|
||||
assertEquals("2020-09-10 11:08:52", a.getValidationDate());
|
||||
|
||||
a = createRel(true, "2021-03-16T10:32:42Z");
|
||||
b = createRel(true, "2020-03-16T10:32:42Z");
|
||||
a.mergeFrom(b);
|
||||
assertEquals("2020-03-16T10:32:42Z", a.getValidationDate());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge relation test parse exception.
|
||||
*/
|
||||
@Test
|
||||
void mergeRelationTestParseException() {
|
||||
assertThrows(DateTimeParseException.class, () -> {
|
||||
Relation a = createRel(true, "Once upon a time ...");
|
||||
Relation b = createRel(true, "... in a far away land");
|
||||
a.mergeFrom(b);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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");
|
||||
rel.setTarget("2");
|
||||
rel.setRelType("reltype");
|
||||
rel.setSubRelType("subreltype");
|
||||
rel.setRelClass("relclass");
|
||||
rel.setValidated(validated);
|
||||
rel.setValidationDate(validationDate);
|
||||
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();
|
||||
|
||||
k.setKey(key);
|
||||
k.setValue(value);
|
||||
|
||||
return k;
|
||||
}
|
||||
|
||||
private Subject setSub(final String value, final String schema, final String classname) {
|
||||
Subject s = new Subject();
|
||||
s.setValue(value);
|
||||
Qualifier q = new Qualifier();
|
||||
q.setClassname(classname);
|
||||
q.setClassid(classname);
|
||||
q.setSchemename(schema);
|
||||
q.setSchemeid(schema);
|
||||
s.setQualifier(q);
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
s.setValue(value);
|
||||
Qualifier q = new Qualifier();
|
||||
q.setClassname(classname);
|
||||
q.setClassid(classname);
|
||||
q.setSchemename(schema);
|
||||
q.setSchemeid(schema);
|
||||
s.setQualifier(q);
|
||||
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);
|
||||
return d;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class RelationTest {
|
||||
|
||||
@Test
|
||||
public void checkExistRelType() {
|
||||
assertTrue(Relation.SUBRELTYPE.exists(Relation.SUBRELTYPE.dedup.toString()));
|
||||
assertFalse(Relation.SUBRELTYPE.exists("foo"));
|
||||
|
||||
}
|
||||
@Test
|
||||
public void checkSubRelType() {
|
||||
Relation.RELCLASS rc = Relation.RELCLASS.merges;
|
||||
assertEquals(Relation.SUBRELTYPE.dedup, rc.getSubRel());
|
||||
|
||||
for (Relation.RELCLASS value : Relation.RELCLASS.values()) {
|
||||
System.out.printf("%s => %s\n", value, value.getSubRel());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lookRelClassUpTest() {
|
||||
Assertions.assertEquals(Relation.RELCLASS.Compiles, Relation.RELCLASS.lookUp("compiles"));
|
||||
Assertions.assertEquals(Relation.RELCLASS.IsMetadataFor, Relation.RELCLASS.lookUp("isMetaDATAFOr"));
|
||||
Assertions.assertThrows(IllegalArgumentException.class, () -> Relation.RELCLASS.lookUp("hello"));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class BlackListProviderTest {
|
||||
|
||||
@Test
|
||||
void blackListTest() {
|
||||
|
||||
Assertions.assertNotNull(PidBlacklistProvider.getBlacklist());
|
||||
Assertions.assertNotNull(PidBlacklistProvider.getBlacklist().get("doi"));
|
||||
Assertions.assertTrue(PidBlacklistProvider.getBlacklist().get("doi").size() > 0);
|
||||
final Set<String> xxx = PidBlacklistProvider.getBlacklist("xxx");
|
||||
Assertions.assertNotNull(xxx);
|
||||
Assertions.assertEquals(0, xxx.size());
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
|
||||
package eu.dnetlib.dhp.schema.oaf.utils;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.Publication;
|
||||
|
||||
class IdentifierFactoryTest {
|
||||
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
@Test
|
||||
void testCreateIdentifierForPublication() throws IOException {
|
||||
|
||||
verifyIdentifier(
|
||||
"publication_doi1.json", "50|doi_________::79dbc7a2a56dc1532659f9038843256e", true);
|
||||
|
||||
verifyIdentifier(
|
||||
"publication_doi2.json", "50|doi_________::79dbc7a2a56dc1532659f9038843256e", true);
|
||||
|
||||
verifyIdentifier(
|
||||
"publication_doi3.json", "50|pmc_________::94e4cb08c93f8733b48e2445d04002ac", true);
|
||||
|
||||
verifyIdentifier(
|
||||
"publication_doi4.json", "50|od______2852::38861c44e6052a8d49f59a4c39ba5e66", true);
|
||||
|
||||
verifyIdentifier(
|
||||
"publication_doi5.json", "50|doi_________::3bef95c0ca26dd55451fc8839ea69d27", true);
|
||||
|
||||
verifyIdentifier(
|
||||
"publication_pmc1.json", "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f", true);
|
||||
|
||||
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);
|
||||
verifyIdentifier("publication_5.json", defaultID, true);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateIdentifierForPublicationNoHash() throws IOException {
|
||||
|
||||
verifyIdentifier("publication_doi1.json", "50|doi_________::10.1016/j.cmet.2010.03.013", false);
|
||||
verifyIdentifier("publication_doi2.json", "50|doi_________::10.1016/j.cmet.2010.03.013", false);
|
||||
verifyIdentifier("publication_pmc1.json", "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f", false);
|
||||
verifyIdentifier(
|
||||
"publication_urn1.json", "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f", false);
|
||||
|
||||
final String defaultID = "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f";
|
||||
verifyIdentifier("publication_3.json", defaultID, false);
|
||||
verifyIdentifier("publication_4.json", defaultID, false);
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1g", "resuttype" : { "classid" : "dataset" }, "pid":[{"qualifier":{"classid":"doi"},"value":"10.1016/j.cmet.2011.03.013"},{"qualifier":{"classid":"urn"},"value":"urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"},{"qualifier":{"classid":"scp-number"},"value":"79953761260"},{"qualifier":{"classid":"pmc"},"value":"21459329"}], "collectedfrom" : [ { "key" : "10|openaire____::081b82f96300b6a6e3d282bad31cb6e2", "value" : "Crossref"} ]}
|
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1g", "resuttype" : { "classid" : "dataset" }, "pid":[{"qualifier":{"classid":"doi"},"value":"10.1016/j.cmet.2011.03.013"},{"qualifier":{"classid":"urn"},"value":"urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"},{"qualifier":{"classid":"scp-number"},"value":"79953761260"},{"qualifier":{"classid":"pmc"},"value":"21459329"}], "collectedfrom" : [ { "key" : "10|openaire____::081b82f96300b6a6e3d282bad31cb6e3", "value" : "Repository B"} ]}
|
|
@ -1,12 +0,0 @@
|
|||
{"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
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f", "resuttype" : { "classid" : "publication" }, "pid":[{"qualifier":{"classid":"doi"},"value":"10.1016/j.cmet.2011.03.013"},{"qualifier":{"classid":"urn"},"value":"urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"},{"qualifier":{"classid":"scp-number"},"value":"79953761260"},{"qualifier":{"classid":"pmc"},"value":"21459329"}], "collectedfrom" : [ { "key" : "10|openaire____::081b82f96300b6a6e3d282bad31cb6e2", "value" : "Crossref"} ]}
|
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f", "resuttype" : { "classid" : "publication" }, "pid":[{"qualifier":{"classid":"doi"},"value":"10.1016/j.cmet.2011.03.013"},{"qualifier":{"classid":"urn"},"value":"urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"},{"qualifier":{"classid":"scp-number"},"value":"79953761260"},{"qualifier":{"classid":"pmc"},"value":"21459329"}], "collectedfrom" : [ { "key" : "10|openaire____::081b82f96300b6a6e3d282bad31cb6e3", "value" : "Repository A"} ]}
|
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f","pid":[{"qualifier":{"classid":"scp-number"},"value":"79953761260"}]}
|
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f","pid":[]}
|
|
@ -1 +0,0 @@
|
|||
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"id": "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"instance": [
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|openaire____::081b82f96300b6a6e3d282bad31cb6e2",
|
||||
"value": "Crossref"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "doi"},
|
||||
"value": "10.1016/j.cmet.2010.03.013"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "urn"},
|
||||
"value": "urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "scp-number"},
|
||||
"value": "79953761260"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "pmc"},
|
||||
"value": "21459329"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"id": "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"instance": [
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|openaire____::081b82f96300b6a6e3d282bad31cb6e2",
|
||||
"value": "Crossref"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "doi"},
|
||||
"value": "10.1016/j.cmet.2010.03.013"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::8b6dd7db9af49e67306feb59a8bdc52c",
|
||||
"value": "Europe PubMed Central"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "urn"},
|
||||
"value": "urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "scp-number"},
|
||||
"value": "79953761260"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "pmc"},
|
||||
"value": "21459329"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"id": "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"instance": [
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::358aee4cc897452c00244351e4d91f69",
|
||||
"value": "Zenodo"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "doi"},
|
||||
"value": "10.1016/j.cmet.2010.03.013"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::8b6dd7db9af49e67306feb59a8bdc52c",
|
||||
"value": "Europe PubMed Central"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "urn"},
|
||||
"value": "urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "scp-number"},
|
||||
"value": "79953761260"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "pmc"},
|
||||
"value": "21459329"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"id": "50|od______2852::38861c44e6052a8d49f59a4c39ba5e66",
|
||||
"instance": [
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::358aee4cc897452c00244351e4d91f69",
|
||||
"value": "Zenodo"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "doi"},
|
||||
"value": "10.1016/j.cmet.2010.03.013"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "handle"},
|
||||
"value": "11012/83840"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::2852",
|
||||
"value": "Digital library of Brno University of Technology"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "pmc"},
|
||||
"value": "21459329"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "handle"},
|
||||
"value": "11012/83840"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"id": "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"instance": [
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::358aee4cc897452c00244351e4d91f69",
|
||||
"value": "Zenodo"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "doi"},
|
||||
"value": "10.5281/zenodo.5121485"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::8b6dd7db9af49e67306feb59a8bdc52c",
|
||||
"value": "Europe PubMed Central"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "urn"},
|
||||
"value": "urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "scp-number"},
|
||||
"value": "79953761260"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "pmc"},
|
||||
"value": "21459329"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"id": "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "urn"},
|
||||
"value": "urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "scp-number"},
|
||||
"value": "79953761260"
|
||||
},
|
||||
{
|
||||
"qualifier": {"classid": "pmc"},
|
||||
"value": "21459329"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"instance": [
|
||||
{
|
||||
"collectedfrom": {
|
||||
"key": "10|opendoar____::8b6dd7db9af49e67306feb59a8bdc52c",
|
||||
"value": "Europe PubMed Central"
|
||||
},
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {"classid": "doi"},
|
||||
"value": "10.1016/j.cmet.2010.03.013"
|
||||
},
|
||||
{
|
||||
"qualifier":{"classid":"pmc"},
|
||||
"value":"21459329"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"id": "50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f",
|
||||
"pid": [
|
||||
{
|
||||
"qualifier": {
|
||||
"classid": "urn"
|
||||
},
|
||||
"value": "urn:nbn:nl:ui:29-f3ed5f9e-edf6-457e-8848-61b58a4075e2"
|
||||
},
|
||||
{
|
||||
"qualifier": {
|
||||
"classid": "scp-number"
|
||||
},
|
||||
"value": "79953761260"
|
||||
},
|
||||
{
|
||||
"qualifier": {
|
||||
"classid": "pmcid"
|
||||
},
|
||||
"value": "21459329"
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue