Merge remote-tracking branch 'origin/master' into doidoost_dismiss

This commit is contained in:
Sandro La Bruzzo 2024-04-11 17:39:22 +02:00
commit b336c40970
106 changed files with 3038 additions and 3047 deletions

View File

@ -4,6 +4,7 @@
| **Version** | **Changes** | **Readiness** | | **Version** | **Changes** | **Readiness** |
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| |-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| 6.1.0 | [Graph model] </br> <ul><li>Introduced model classes to provide a JSON representation of records embedding information from the related entities.</li></ul> | beta |
| 5.17.3 | [Graph model] </br> <ul><li>added result level textual field to store the transformative agreement information.</li></ul> | beta | | 5.17.3 | [Graph model] </br> <ul><li>added result level textual field to store the transformative agreement information.</li></ul> | beta |
| 4.17.3 | [Graph model] </br> <ul><li>moved context at the level of the entity. </li></ul> | beta | | 4.17.3 | [Graph model] </br> <ul><li>moved context at the level of the entity. </li></ul> | beta |
| 4.17.2 | [Graph model] </br> <ul><li>added InstaceTypeMapping field on the instance level.</li><li>new result level fields to support the activities in the Irish tender `isGreen`, `openAccessColor`, `isInDiamondJournal`, `publiclyFunded`</li><ul> | production | | 4.17.2 | [Graph model] </br> <ul><li>added InstaceTypeMapping field on the instance level.</li><li>new result level fields to support the activities in the Irish tender `isGreen`, `openAccessColor`, `isInDiamondJournal`, `publiclyFunded`</li><ul> | production |

View File

@ -13,9 +13,11 @@ This project defines **object schemas** of the OpenAIRE main entities and the re
Namely it defines the model for Namely it defines the model for
- the graph internal representation, defined under the package `eu.dnetlib.dhp.schema.oaf` - 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 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` - the ORCID common schemas, defined under the package `eu.dnetlib.dhp.schema.orcid`
- the Solr common schemas used to represent the information returned to the Explore portal and the APIs, defined under
the package `eu.dnetlib.dhp.schema.solr`
Te serialization of such objects (data store files) are used to pass data between workflow nodes in the processing pipeline. The serialization of such objects (data store files) are used to pass data between workflow nodes in the processing pipeline
and / or intended to be shared across components.

View File

@ -5,7 +5,7 @@
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-schemas</artifactId> <artifactId>dhp-schemas</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>5.17.4-SNAPSHOT</version> <version>6.1.1-SNAPSHOT</version>
<licenses> <licenses>
<license> <license>

View File

@ -1,6 +1,7 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
/** /**
@ -8,6 +9,7 @@ import java.util.Optional;
*/ */
public class AccessRight extends Qualifier { public class AccessRight extends Qualifier {
private static final long serialVersionUID = -8945177777173510134L;
private OpenAccessRoute openAccessRoute; private OpenAccessRoute openAccessRoute;
public OpenAccessRoute getOpenAccessRoute() { public OpenAccessRoute getOpenAccessRoute() {
@ -18,32 +20,4 @@ public class AccessRight extends Qualifier {
this.openAccessRoute = openAccessRoute; this.openAccessRoute = openAccessRoute;
} }
@Override
public String toComparableString() {
String s = super.toComparableString();
return Optional
.ofNullable(getOpenAccessRoute())
.map(x -> s + "::" + x)
.orElse(s);
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Qualifier other = (Qualifier) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -6,6 +6,7 @@ import java.util.*;
public class Author implements Serializable { public class Author implements Serializable {
private static final long serialVersionUID = 1625492739044457437L;
private String fullname; private String fullname;
private String name; private String name;
@ -67,24 +68,4 @@ public class Author implements Serializable {
this.affiliation = affiliation; this.affiliation = affiliation;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Author author = (Author) o;
return Objects.equals(fullname, author.fullname)
&& 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);
}
@Override
public int hashCode() {
return Objects.hash(fullname, name, surname, rank, pid, affiliation);
}
} }

View File

@ -3,8 +3,11 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Objects;
public class Context implements Serializable { public class Context implements Serializable {
private static final long serialVersionUID = -778899398223144398L;
private String id; private String id;
private List<DataInfo> dataInfo; private List<DataInfo> dataInfo;
@ -25,22 +28,4 @@ public class Context implements Serializable {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
} }
@Override
public int hashCode() {
return id == null ? 0 : id.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Context other = (Context) obj;
return id.equals(other.getId());
}
} }

View File

@ -1,10 +1,9 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.util.Objects;
public class Country extends Qualifier { public class Country extends Qualifier {
private static final long serialVersionUID = 1587334433446567175L;
private DataInfo dataInfo; private DataInfo dataInfo;
public DataInfo getDataInfo() { public DataInfo getDataInfo() {
@ -15,20 +14,4 @@ public class Country extends Qualifier {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
if (!super.equals(o))
return false;
Country country = (Country) o;
return Objects.equals(dataInfo, country.dataInfo);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), dataInfo);
}
} }

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class DataInfo implements Serializable { public class DataInfo implements Serializable {
private static final long serialVersionUID = -277099962930866451L;
private Boolean invisible = false; private Boolean invisible = false;
private Boolean inferred; private Boolean inferred;
private Boolean deletedbyinference = false; private Boolean deletedbyinference = false;
@ -61,25 +63,4 @@ public class DataInfo implements Serializable {
this.provenanceaction = provenanceaction; this.provenanceaction = provenanceaction;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
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)
&& Objects.equals(trust, dataInfo.trust)
&& Objects.equals(inferenceprovenance, dataInfo.inferenceprovenance)
&& Objects.equals(provenanceaction, dataInfo.provenanceaction);
}
@Override
public int hashCode() {
return Objects
.hash(
invisible, inferred, deletedbyinference, trust, inferenceprovenance, provenanceaction);
}
} }

View File

@ -8,6 +8,7 @@ import eu.dnetlib.dhp.schema.common.ModelConstants;
public class Dataset extends Result implements Serializable { public class Dataset extends Result implements Serializable {
private static final long serialVersionUID = 916526716184645549L;
private Field<String> storagedate; private Field<String> storagedate;
// candidate for removal // candidate for removal
@ -83,34 +84,4 @@ public class Dataset extends Result implements Serializable {
this.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);
}
} }

View File

@ -6,9 +6,6 @@ import java.util.List;
public class Datasource extends OafEntity implements Serializable { public class Datasource extends OafEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1019089598408414496L; private static final long serialVersionUID = 1019089598408414496L;
@Deprecated @Deprecated
@ -566,9 +563,4 @@ public class Datasource extends OafEntity implements Serializable {
this.eoscifguidelines = eoscifguidelines; this.eoscifguidelines = eoscifguidelines;
} }
@Override
public void mergeFrom(final OafEntity e) {
super.mergeFrom(e);
}
} }

View File

@ -1,6 +1,7 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -12,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
*/ */
public class EoscIfGuidelines implements Serializable { public class EoscIfGuidelines implements Serializable {
private static final long serialVersionUID = -2166497471601245048L;
/** /**
* EOSC-IF local code. Later on it could be populated with a PID (e.g. DOI), but for the time being we stick to * EOSC-IF local code. Later on it could be populated with a PID (e.g. DOI), but for the time being we stick to
* a more loose definition. * a more loose definition.
@ -65,33 +67,4 @@ public class EoscIfGuidelines implements Serializable {
this.semanticRelation = semanticRelation; this.semanticRelation = semanticRelation;
} }
private String toComparableString() {
return Stream
.of(
Optional.ofNullable(getCode()).orElse(""),
Optional.ofNullable(getLabel()).orElse(""),
Optional.ofNullable(getUrl()).orElse(""),
Optional.ofNullable(getSemanticRelation()).orElse(""))
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining("||"));
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EoscIfGuidelines other = (EoscIfGuidelines) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -6,6 +6,8 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
public class ExternalReference implements Serializable { public class ExternalReference implements Serializable {
private static final long serialVersionUID = -3711445600549155961L;
// source // source
private String sitename; private String sitename;
@ -94,27 +96,4 @@ public class ExternalReference implements Serializable {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ExternalReference that = (ExternalReference) o;
return Objects.equals(sitename, that.sitename)
&& Objects.equals(label, that.label)
&& 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);
}
@Override
public int hashCode() {
return Objects
.hash(
sitename, label, url, qualifier, refidentifier, query, dataInfo);
}
} }

View File

@ -5,6 +5,8 @@ import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
public class ExtraInfo implements Serializable { public class ExtraInfo implements Serializable {
private static final long serialVersionUID = 8689244676887698486L;
private String name; private String name;
private String typology; private String typology;
@ -56,22 +58,4 @@ public class ExtraInfo implements Serializable {
this.value = value; this.value = value;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ExtraInfo extraInfo = (ExtraInfo) o;
return Objects.equals(name, extraInfo.name)
&& Objects.equals(typology, extraInfo.typology)
&& Objects.equals(provenance, extraInfo.provenance)
&& Objects.equals(trust, extraInfo.trust)
&& Objects.equals(value, extraInfo.value);
}
@Override
public int hashCode() {
return Objects.hash(name, typology, provenance, trust, value);
}
} }

View File

@ -6,6 +6,7 @@ import java.util.Objects;
public class Field<T> implements Serializable { public class Field<T> implements Serializable {
private static final long serialVersionUID = -4255501306375330131L;
private T value; private T value;
private DataInfo dataInfo; private DataInfo dataInfo;

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -9,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
public class GeoLocation implements Serializable { public class GeoLocation implements Serializable {
private static final long serialVersionUID = 8096534610208458404L;
private String point; private String point;
private String box; private String box;
@ -39,38 +41,4 @@ public class GeoLocation implements Serializable {
this.place = place; this.place = place;
} }
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(point) && StringUtils.isBlank(box) && StringUtils.isBlank(place);
}
public String toComparableString() {
return isBlank()
? ""
: String
.format(
"%s::%s%s",
point != null ? point.toLowerCase() : "",
box != null ? box.toLowerCase() : "",
place != null ? place.toLowerCase() : "");
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GeoLocation other = (GeoLocation) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -21,8 +21,9 @@ import java.util.Objects;
* - private String level3 to store the information about the level3 of the classification * - private String level3 to store the information about the level3 of the classification
* - private String classification to store the entire classification related to the programme * - private String classification to store the entire classification related to the programme
*/ */
public class H2020Classification implements Serializable { public class H2020Classification implements Serializable {
private static final long serialVersionUID = 1062734689288369769L;
private H2020Programme h2020Programme; private H2020Programme h2020Programme;
private String level1; private String level1;
private String level2; private String level2;
@ -70,19 +71,4 @@ public class H2020Classification implements Serializable {
this.classification = classification; this.classification = classification;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
H2020Classification h2020classification = (H2020Classification) o;
return Objects.equals(level1, h2020classification.level1) &&
Objects.equals(level2, h2020classification.level2) &&
Objects.equals(level3, h2020classification.level3) &&
Objects.equals(classification, h2020classification.classification) &&
h2020Programme.equals(h2020classification.h2020Programme);
}
} }

View File

@ -9,8 +9,9 @@ import java.util.Objects;
* - private String code to store the code of the programme * - private String code to store the code of the programme
* - private String description to store the description of the programme * - private String description to store the description of the programme
*/ */
public class H2020Programme implements Serializable { public class H2020Programme implements Serializable {
private static final long serialVersionUID = -7851791644568592481L;
private String code; private String code;
private String description; private String description;
@ -30,15 +31,4 @@ public class H2020Programme implements Serializable {
this.description = description; this.description = description;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
H2020Programme h2020Programme = (H2020Programme) o;
return Objects.equals(code, h2020Programme.code);
}
} }

View File

@ -3,9 +3,13 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Optional;
import com.google.common.base.Joiner;
public class Instance implements Serializable { public class Instance implements Serializable {
private static final long serialVersionUID = 3918544870298859300L;
private Field<String> license; private Field<String> license;
private AccessRight accessright; private AccessRight accessright;
@ -174,33 +178,4 @@ public class Instance implements Serializable {
this.fulltext = fulltext; this.fulltext = fulltext;
} }
public String toComparableString() {
return String
.format(
"%s::%s::%s::%s",
hostedby != null && hostedby.getKey() != null ? hostedby.getKey().toLowerCase() : "",
accessright != null && accessright.getClassid() != null ? accessright.getClassid() : "",
instancetype != null && instancetype.getClassid() != null ? instancetype.getClassid() : "",
url != null ? url : "");
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Instance other = (Instance) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -7,6 +7,7 @@ import java.io.Serializable;
*/ */
public class InstanceTypeMapping implements Serializable { public class InstanceTypeMapping implements Serializable {
private static final long serialVersionUID = -8209930054790495309L;
/** /**
* Original resource type, typically mapped from dc:type, datacite:resourceType. * Original resource type, typically mapped from dc:type, datacite:resourceType.
*/ */

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class Journal implements Serializable { public class Journal implements Serializable {
private static final long serialVersionUID = -8476321782780781681L;
private String name; private String name;
private String issnPrinted; private String issnPrinted;
@ -126,42 +128,4 @@ public class Journal implements Serializable {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Journal journal = (Journal) o;
return Objects.equals(name, journal.name)
&& Objects.equals(issnPrinted, journal.issnPrinted)
&& Objects.equals(issnOnline, journal.issnOnline)
&& Objects.equals(issnLinking, journal.issnLinking)
&& Objects.equals(ep, journal.ep)
&& Objects.equals(iss, journal.iss)
&& Objects.equals(sp, journal.sp)
&& 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);
}
@Override
public int hashCode() {
return Objects
.hash(
name,
issnPrinted,
issnOnline,
issnLinking,
ep,
iss,
sp,
vol,
edition,
conferenceplace,
conferencedate,
dataInfo);
}
} }

View File

@ -2,13 +2,17 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
public class KeyValue implements Serializable { public class KeyValue implements Serializable {
private static final long serialVersionUID = 1905267445569591240L;
private String key; private String key;
private String value; private String value;
@ -39,36 +43,4 @@ public class KeyValue implements Serializable {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
} }
public String toComparableString() {
return isBlank()
? ""
: String
.format(
"%s::%s",
key != null ? key.toLowerCase() : "", value != null ? value.toLowerCase() : "");
}
@JsonIgnore
public boolean isBlank() {
return StringUtils.isBlank(key) && StringUtils.isBlank(value);
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
KeyValue other = (KeyValue) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -11,6 +11,7 @@ import com.google.common.base.Objects;
*/ */
public class Measure implements Serializable { public class Measure implements Serializable {
private static final long serialVersionUID = 8383308453679722661L;
/** /**
* Unique measure identifier. * Unique measure identifier.
*/ */
@ -38,23 +39,4 @@ public class Measure implements Serializable {
this.unit = unit; this.unit = unit;
} }
public void mergeFrom(Measure m) {
// TODO
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Measure measure = (Measure) o;
return Objects.equal(id, measure.id) &&
Objects.equal(unit, measure.unit);
}
@Override
public int hashCode() {
return Objects.hashCode(id, unit);
}
} }

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class OAIProvenance implements Serializable { public class OAIProvenance implements Serializable {
private static final long serialVersionUID = -767252660700352729L;
private OriginDescription originDescription; private OriginDescription originDescription;
public OriginDescription getOriginDescription() { public OriginDescription getOriginDescription() {
@ -16,18 +18,4 @@ public class OAIProvenance implements Serializable {
this.originDescription = originDescription; this.originDescription = originDescription;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
OAIProvenance that = (OAIProvenance) o;
return Objects.equals(originDescription, that.originDescription);
}
@Override
public int hashCode() {
return Objects.hash(originDescription);
}
} }

View File

@ -11,6 +11,7 @@ import java.util.stream.Stream;
public abstract class Oaf implements Serializable { public abstract class Oaf implements Serializable {
private static final long serialVersionUID = 94599232915572420L;
/** /**
* The list of datasource id/name pairs providing this relationship. * The list of datasource id/name pairs providing this relationship.
*/ */
@ -44,65 +45,4 @@ public abstract class Oaf implements Serializable {
this.lastupdatetimestamp = 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);
}
} }

View File

@ -7,6 +7,8 @@ import java.util.stream.Collectors;
public abstract class OafEntity extends Oaf implements Serializable { public abstract class OafEntity extends Oaf implements Serializable {
private static final long serialVersionUID = -7793594664115821897L;
private String id; private String id;
private List<String> originalId; private List<String> originalId;
@ -123,55 +125,19 @@ public abstract class OafEntity extends Oaf implements Serializable {
this.oaiprovenance = oaiprovenance; this.oaiprovenance = oaiprovenance;
} }
public void mergeFrom(OafEntity e) { @Override
super.mergeFrom(e); public int hashCode() {
return Objects.hash(getId());
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();
measures = mergeLists(measures, e.getMeasures());
context = mergeLists(context, e.getContext());
}
@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());
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o)
return true; return true;
if (o == null || getClass() != o.getClass()) if (!(o instanceof OafEntity))
return false;
if (!super.equals(o))
return false; return false;
OafEntity oafEntity = (OafEntity) o; OafEntity oafEntity = (OafEntity) o;
return Objects.equals(id, oafEntity.id); return Objects.equals(getId(), oafEntity.getId());
} }
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), id);
}
} }

View File

@ -1,11 +1,12 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable;
/** /**
* The OpenAccess color meant to be used on the result level * The OpenAccess color meant to be used on the result level
*/ */
public enum OpenAccessColor { public enum OpenAccessColor implements Serializable {
gold, hybrid, bronze gold, hybrid, bronze
} }

View File

@ -6,6 +6,8 @@ import java.util.List;
public class Organization extends OafEntity implements Serializable { public class Organization extends OafEntity implements Serializable {
private static final long serialVersionUID = -9048723860770504113L;
private Field<String> legalshortname; private Field<String> legalshortname;
private Field<String> legalname; private Field<String> legalname;
@ -167,48 +169,4 @@ public class Organization extends OafEntity implements Serializable {
this.country = country; 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);
}
} }

View File

@ -6,6 +6,8 @@ import java.util.Objects;
public class OriginDescription implements Serializable { public class OriginDescription implements Serializable {
private static final long serialVersionUID = -7256156902727658863L;
private String harvestDate; private String harvestDate;
private Boolean altered = true; private Boolean altered = true;
@ -66,23 +68,4 @@ public class OriginDescription implements Serializable {
this.metadataNamespace = metadataNamespace; this.metadataNamespace = metadataNamespace;
} }
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
OriginDescription that = (OriginDescription) o;
return Objects.equals(harvestDate, that.harvestDate)
&& Objects.equals(altered, that.altered)
&& Objects.equals(baseURL, that.baseURL)
&& Objects.equals(identifier, that.identifier)
&& Objects.equals(datestamp, that.datestamp)
&& Objects.equals(metadataNamespace, that.metadataNamespace);
}
@Override
public int hashCode() {
return Objects.hash(harvestDate, altered, baseURL, identifier, datestamp, metadataNamespace);
}
} }

View File

@ -8,6 +8,8 @@ import eu.dnetlib.dhp.schema.common.ModelConstants;
public class OtherResearchProduct extends Result implements Serializable { public class OtherResearchProduct extends Result implements Serializable {
private static final long serialVersionUID = -7611546868867175491L;
private List<Field<String>> contactperson; private List<Field<String>> contactperson;
private List<Field<String>> contactgroup; private List<Field<String>> contactgroup;
@ -42,19 +44,4 @@ public class OtherResearchProduct extends Result implements Serializable {
this.tool = 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);
}
} }

View File

@ -8,6 +8,8 @@ import org.apache.commons.lang3.StringUtils;
public class Project extends OafEntity implements Serializable { public class Project extends OafEntity implements Serializable {
private static final long serialVersionUID = 5783959097903529424L;
private Field<String> websiteurl; private Field<String> websiteurl;
private Field<String> code; private Field<String> code;
@ -298,64 +300,4 @@ public class Project extends OafEntity implements Serializable {
this.fundedamount = fundedamount; 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);
}
} }

View File

@ -7,6 +7,8 @@ import eu.dnetlib.dhp.schema.common.ModelConstants;
public class Publication extends Result implements Serializable { public class Publication extends Result implements Serializable {
private static final long serialVersionUID = 4155353046627214846L;
// publication specific // publication specific
private Journal journal; private Journal journal;
@ -22,18 +24,4 @@ public class Publication extends Result implements Serializable {
this.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);
}
} }

View File

@ -2,13 +2,15 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.google.common.base.Joiner;
public class Qualifier implements Serializable { public class Qualifier implements Serializable {
private static final long serialVersionUID = 6632548656644563076L;
private String classid; private String classid;
private String classname; private String classname;
private String schemeid; private String schemeid;
@ -46,42 +48,4 @@ public class Qualifier implements Serializable {
this.schemename = 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);
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Qualifier other = (Qualifier) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -18,6 +18,8 @@ import eu.dnetlib.dhp.schema.common.ModelSupport;
*/ */
public class Relation extends Oaf { public class Relation extends Oaf {
private static final long serialVersionUID = -7061565324218172207L;
/** /**
* Main relationship classifier, values include 'resultResult', 'resultProject', 'resultOrganization', etc. * Main relationship classifier, values include 'resultResult', 'resultProject', 'resultOrganization', etc.
*/ */
@ -124,26 +126,9 @@ public class Relation extends Oaf {
this.validationDate = validationDate; this.validationDate = validationDate;
} }
public void mergeFrom(final Relation r) { @Override
public int hashCode() {
checkArgument(Objects.equals(getSource(), r.getSource()), "source ids must be equal"); return Objects.hash(getRelType(), getSubRelType(), getRelClass(), getSource(), getTarget());
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");
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()));
}
super.mergeFrom(r);
} }
@Override @Override
@ -153,16 +138,11 @@ public class Relation extends Oaf {
if (o == null || getClass() != o.getClass()) if (o == null || getClass() != o.getClass())
return false; return false;
Relation relation = (Relation) o; Relation relation = (Relation) o;
return relType.equals(relation.relType) return Objects.equals(getRelType(), relation.getRelType()) &&
&& subRelType.equals(relation.subRelType) Objects.equals(getSubRelType(), relation.getSubRelType()) &&
&& relClass.equals(relation.relClass) Objects.equals(getRelClass(), relation.getRelClass()) &&
&& source.equals(relation.source) Objects.equals(getSource(), relation.getSource()) &&
&& target.equals(relation.target); Objects.equals(getTarget(), relation.getTarget());
}
@Override
public int hashCode() {
return Objects.hash(relType, subRelType, relClass, source, target, collectedfrom);
} }
} }

View File

@ -1,28 +1,18 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import static java.util.Objects.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.dhp.schema.common.AccessRightComparator;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.oaf.utils.CleaningFunctions;
/** /**
* The type Result. * The type Result.
*/ */
public class Result extends OafEntity implements Serializable { public class Result extends OafEntity implements Serializable {
private static final long serialVersionUID = 5597290552671699408L;
/** /**
* ( article | book ) processing charges. * ( article | book ) processing charges.
*/ */
@ -589,353 +579,4 @@ public class Result extends OafEntity implements Serializable {
this.publiclyFunded = publiclyFunded; this.publiclyFunded = publiclyFunded;
} }
/**
* Is an enrichment boolean.
*
* @param e the e
* @return the boolean
*/
public static boolean isAnEnrichment(OafEntity e) {
return e.getDataInfo()!= null &&
e.getDataInfo().getProvenanceaction()!= null
&& ModelConstants.PROVENANCE_ENRICH.equalsIgnoreCase(e.getDataInfo().getProvenanceaction().getClassid());
}
/**
* Normalize pid string.
*
* @param pid the pid
* @return the string
*/
private static String extractKeyFromPid(final StructuredProperty pid) {
if (pid == null)
return null;
final StructuredProperty normalizedPid = CleaningFunctions.normalizePidValue(pid);
return String.format("%s::%s", normalizedPid.getQualifier().getClassid(), normalizedPid.getValue());
}
/**
* Valid pid boolean.
*
* @param p the p
* @return the boolean
*/
private static boolean validPid(final StructuredProperty p) {
return p.getValue()!= null && p.getQualifier()!= null && p.getQualifier().getClassid()!=null;
}
/**
* This method converts the list of instance enrichments
* into a Map where the key is the normalized identifier
* and the value is the instance itself
*
* @param ri the list of enrichment instances
* @return the result map
*/
public static Map<String, Instance> toInstanceMap(final List<Instance> ri) {
return ri
.stream()
.filter(i -> i.getPid() != null || i.getAlternateIdentifier() != null)
.flatMap(i -> {
final List<Pair<String, Instance>> result = new ArrayList<>();
if (i.getPid() != null)
i.getPid().stream().filter(Result::validPid).forEach(p -> result.add(new ImmutablePair<>(extractKeyFromPid(p), i)));
if (i.getAlternateIdentifier() != null)
i.getAlternateIdentifier().stream().filter(Result::validPid).forEach(p -> result.add(new ImmutablePair<>(extractKeyFromPid(p), i)));
return result.stream();
}).collect(Collectors.toMap(
Pair::getLeft,
Pair::getRight,
(a, b) -> a
));
}
/**
* This utility method finds the list of enrichment instances
* that match one or more PIDs in the input list
*
* @param pids the list of PIDs
* @param enrichments the List of enrichment instances having the same pid
* @return the list
*/
private static List<Instance> findEnrichmentsByPID(final List<StructuredProperty> pids, final Map<String,Instance> enrichments) {
if (pids == null || enrichments == null)
return null;
return pids
.stream()
.map(Result::extractKeyFromPid)
.map(enrichments::get)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
/**
* This method apply enrichment on a single instance
* The enrichment consists of replacing values on
* single attribute only if in the current instance is missing
* The only repeatable field enriched is measures
*
* @param currentInstance the current instance
* @param enrichment the enrichment instance
*/
private static void applyEnrichment(final Instance currentInstance, final Instance enrichment) {
if (currentInstance == null || enrichment == null)
return;
//ENRICH accessright
if (enrichment.getAccessright()!=null && currentInstance.getAccessright() == null)
currentInstance.setAccessright(enrichment.getAccessright());
//ENRICH license
if (enrichment.getLicense()!=null && currentInstance.getLicense() == null)
currentInstance.setLicense(enrichment.getLicense());
//ENRICH instanceType
if (enrichment.getInstancetype()!=null && currentInstance.getInstancetype() == null)
currentInstance.setInstancetype(enrichment.getInstancetype());
//ENRICH hostedby
if (enrichment.getHostedby()!=null && currentInstance.getHostedby() == null)
currentInstance.setHostedby(enrichment.getHostedby());
//ENRICH distributionlocation
if (enrichment.getDistributionlocation()!=null && currentInstance.getDistributionlocation() == null)
currentInstance.setDistributionlocation(enrichment.getDistributionlocation());
//ENRICH collectedfrom
if (enrichment.getCollectedfrom()!=null && currentInstance.getCollectedfrom() == null)
currentInstance.setCollectedfrom(enrichment.getCollectedfrom());
//ENRICH dateofacceptance
if (enrichment.getDateofacceptance()!=null && currentInstance.getDateofacceptance() == null)
currentInstance.setDateofacceptance(enrichment.getDateofacceptance());
//ENRICH processingchargeamount
if (enrichment.getProcessingchargeamount()!=null && currentInstance.getProcessingchargeamount() == null)
currentInstance.setProcessingchargeamount(enrichment.getProcessingchargeamount());
//ENRICH refereed
if (enrichment.getRefereed()!=null && currentInstance.getRefereed() == null)
currentInstance.setRefereed(enrichment.getRefereed());
//ENRICH measures
if (enrichment.getMeasures()!=null)
if (currentInstance.getMeasures() == null) {
currentInstance.setMeasures(enrichment.getMeasures());
} else {
enrichment.getMeasures().forEach(currentInstance.getMeasures()::add);
}
}
/**
* This main method apply the enrichment of the instances
*
* @param toEnrichInstances the instances that could be enriched
* @param enrichmentInstances the enrichment instances
* @return list of instances possibly enriched
*/
private static List<Instance> enrichInstances(final List<Instance> toEnrichInstances,final List<Instance> enrichmentInstances) {
final List<Instance> enrichmentResult = new ArrayList<>();
if (toEnrichInstances == null) {
return enrichmentResult;
}
if (enrichmentInstances == null) {
return toEnrichInstances;
}
Map<String, Instance> ri = toInstanceMap(enrichmentInstances);
toEnrichInstances.forEach(i -> {
final List<Instance> e = findEnrichmentsByPID(i.getPid(), ri);
if (e!= null && !e.isEmpty()) {
e.forEach(enr -> applyEnrichment(i, enr));
} else {
final List<Instance> a = findEnrichmentsByPID(i.getAlternateIdentifier(), ri);
if (a!= null && !a.isEmpty()) {
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();
}
if (Objects.isNull(getTransformativeAgreement()) && Objects.nonNull(r.getTransformativeAgreement())) {
setTransformativeAgreement(r.getTransformativeAgreement());
}
eoscifguidelines = mergeLists(eoscifguidelines, r.getEoscifguidelines());
setIsGreen(mergeBooleanOR(getIsGreen(), r.getIsGreen()));
setIsInDiamondJournal(mergeBooleanOR(getIsInDiamondJournal(), r.getIsInDiamondJournal()));
setPubliclyFunded(mergeBooleanOR(getPubliclyFunded(), r.getPubliclyFunded()));
if (Boolean.logicalXor(nonNull(getOpenAccessColor()), nonNull(r.getOpenAccessColor()))) {
setOpenAccessColor(ObjectUtils.firstNonNull(getOpenAccessColor(), r.getOpenAccessColor()));
} else if (!Objects.equals(getOpenAccessColor(), r.getOpenAccessColor())) {
setOpenAccessColor(null);
}
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 (nonNull(r.getDateofacceptance())) {
if (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());
externalReference = mergeLists(externalReference, r.getExternalReference());
}
private Boolean mergeBooleanOR(Boolean a, Boolean b) {
if (Boolean.logicalXor(isNull(a), isNull(b))) {
return ObjectUtils.firstNonNull(a, b);
} else if (nonNull(a) & nonNull(b)) {
return a || b;
} else {
return null;
}
}
/**
* 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;
}
} }

View File

@ -8,6 +8,8 @@ import eu.dnetlib.dhp.schema.common.ModelConstants;
public class Software extends Result implements Serializable { public class Software extends Result implements Serializable {
private static final long serialVersionUID = -3096641763359312576L;
private List<Field<String>> documentationUrl; private List<Field<String>> documentationUrl;
// candidate for removal // candidate for removal
@ -54,27 +56,4 @@ public class Software extends Result implements Serializable {
this.programmingLanguage = 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);
}
} }

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -10,6 +11,8 @@ import org.apache.commons.lang3.StringUtils;
public class StructuredProperty implements Serializable { public class StructuredProperty implements Serializable {
private static final long serialVersionUID = -8490243153237377762L;
private String value; private String value;
private Qualifier qualifier; private Qualifier qualifier;
@ -40,31 +43,4 @@ public class StructuredProperty implements Serializable {
this.dataInfo = dataInfo; this.dataInfo = dataInfo;
} }
public String toComparableString() {
return Stream
.of(
getQualifier().toComparableString(),
Optional.ofNullable(getValue()).map(String::toLowerCase).orElse(""))
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining("||"));
}
@Override
public int hashCode() {
return toComparableString().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
StructuredProperty other = (StructuredProperty) obj;
return toComparableString().equals(other.toComparableString());
}
} }

View File

@ -3,4 +3,7 @@ package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
public class Subject extends StructuredProperty implements Serializable { public class Subject extends StructuredProperty implements Serializable {
private static final long serialVersionUID = 5072481219939207428L;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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, ROR, GRID, PIC, ISNI, Wikidata, FundRef, corda, corda_h2020, 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;
}
}
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,39 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* Used to refer to the Article Processing Charge information. It contains two parameters: -
* currency of type String to store the currency of the APC - amount of type String to stores the charged amount
*/
public class APC implements Serializable {
private static final long serialVersionUID = 8324447899738993669L;
private String currency;
private String amount;
public static APC newInstance(String currency, String amount) {
APC apc = new APC();
apc.setCurrency(currency);
apc.setAmount(amount);
return apc;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
}

View File

@ -0,0 +1,41 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* This class models the access rights of research products.
*/
public class AccessRight implements Serializable {
private static final long serialVersionUID = 7995566912611238604L;
private String value;
private OpenAccessRoute openAccessRoute;
public static AccessRight newInstance(String value, OpenAccessRoute openAccessRoute) {
AccessRight accessRight = new AccessRight();
accessRight.setValue(value);
accessRight.setOpenAccessRoute(openAccessRoute);
return accessRight;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public OpenAccessRoute getOpenAccessRoute() {
return openAccessRoute;
}
public void setOpenAccessRoute(OpenAccessRoute openAccessRoute) {
this.openAccessRoute = openAccessRoute;
}
}

View File

@ -0,0 +1,72 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Author implements Serializable {
private static final long serialVersionUID = 5482727671039062564L;
private String fullname;
private String name;
private String surname;
private Integer rank;
/**
* The author's persistent identifiers
*/
private List<Pid> pid;
public static Author newInstance(String fullname, String name, String surname, int rank, List<Pid> pid) {
Author a = new Author();
a.setFullname(fullname);
a.setName(name);
a.setSurname(surname);
a.setRank(rank);
a.setPid(pid);
return a;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public Integer getRank() {
return rank;
}
public void setRank(Integer rank) {
this.rank = rank;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
}

View File

@ -0,0 +1,44 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* BestAccessRight. Used to represent the result best access rights.
*/
public class BestAccessRight implements Serializable {
private static final long serialVersionUID = 689431927147731065L;
/**
* AccessRight code
*/
private String code; // the classid in the Qualifier
/**
* Label for the access mode
*/
private String label; // the classname in the Qualifier
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public static BestAccessRight newInstance(String code, String label) {
BestAccessRight ar = new BestAccessRight();
ar.code = code;
ar.label = label;
return ar;
}
}

View File

@ -0,0 +1,44 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
public class Category implements Serializable {
private String id;
private String label;
private List<Concept> concept = Lists.newArrayList();
public static Category newInstance(String id, String label) {
Category category = new Category();
category.setId(id);
category.setLabel(label);
return category;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public List<Concept> getConcept() {
return concept;
}
public void setConcept(List<Concept> concept) {
this.concept = concept;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class CodeLabel implements Serializable {
private static final long serialVersionUID = 8182033641583483845L;
private String code;
private String label;
public static CodeLabel newInstance(String code, String label) {
CodeLabel cl = new CodeLabel();
cl.setCode(code);
cl.setLabel(label);
return cl;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,34 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Concept implements Serializable {
private static final long serialVersionUID = -2309379406128410374L;
private String id;
private String label;
public static Concept newInstance(String id, String label) {
Concept concept = new Concept();
concept.setId(id);
concept.setLabel(label);
return concept;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,55 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
public class Context implements Serializable {
private String id;
private String label;
private String type;
private List<Category> category = Lists.newArrayList();
public static Context newInstance(String id, String label, String type, List<Category> category) {
Context context = new Context();
context.setId(id);
context.setLabel(label);
context.setType(type);
context.setCategory(category);
return context;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<Category> getCategory() {
return category;
}
public void setCategory(List<Category> category) {
this.category = category;
}
}

View File

@ -0,0 +1,49 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* Represents the country associated to the generic entity. The value for this element correspond to: - code corresponds
* to the classid of eu.dnetlib.dhp.schema.oaf.Country - label corresponds to the classname of
* eu.dnetlib.dhp.schema.oaf.Country - provenance set only if the dataInfo associated to the Country of the result to be
* dumped is not null. In this case : - provenance corresponds to dataInfo.provenanceaction.classid (to be modified with
* datainfo.provenanceaction.classname) - trust corresponds to dataInfo.trust
*/
public class Country implements Serializable {
private static final long serialVersionUID = 544249673120027949L;
/**
* ISO 3166-1 alpha-2 country code (i.e. IT)
*/
private String code; // the classid in the Qualifier
/**
* The label for that code (i.e. Italy)
*/
private String label; // the classname in the Qualifier
public static Country newInstance(String code, String label) {
Country c = new Country();
c.setCode(code);
c.setLabel(label);
return c;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,538 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Datasource implements Serializable {
private static final long serialVersionUID = -5817484869244344681L;
private CodeLabel datasourcetype;
private CodeLabel datasourcetypeui;
private CodeLabel eosctype; // Data Source | Service
private CodeLabel eoscdatasourcetype;
private CodeLabel openairecompatibility;
private String officialname;
private String englishname;
private String websiteurl;
private String logourl;
private String contactemail;
private String namespaceprefix;
private String latitude;
private String longitude;
private String dateofvalidation;
private String description;
private List<Subject> subjects;
private String odnumberofitems;
private String odnumberofitemsdate;
private String odpolicies;
private List<String> odlanguages;
private List<String> languages;
private List<String> odcontenttypes;
private List<String> accessinfopackage;
// re3data fields
private String releasestartdate;
private String releaseenddate;
private String missionstatementurl;
private Boolean dataprovider;
private Boolean serviceprovider;
// {open, restricted or closed}
private String databaseaccesstype;
// {open, restricted or closed}
private String datauploadtype;
// {feeRequired, registration, other}
private String databaseaccessrestriction;
// {feeRequired, registration, other}
private String datauploadrestriction;
private Boolean versioning;
private Boolean versioncontrol;
private String citationguidelineurl;
private String pidsystems;
private String certificates;
private List<CodeLabel> policies;
private Journal journal;
// New field for EOSC
private List<String> researchentitytypes;
// New field for EOSC
private List<String> providedproducttypes;
// New field for EOSC
private CodeLabel jurisdiction;
// New field for EOSC
private Boolean thematic;
// New field for EOSC
private List<CodeLabel> contentpolicies;
private String submissionpolicyurl;
private String preservationpolicyurl;
private List<String> researchproductaccesspolicies;
private List<String> researchproductmetadataaccesspolicies;
private Boolean consenttermsofuse;
private Boolean fulltextdownload;
private String consenttermsofusedate;
private String lastconsenttermsofusedate;
public CodeLabel getDatasourcetype() {
return datasourcetype;
}
public void setDatasourcetype(CodeLabel datasourcetype) {
this.datasourcetype = datasourcetype;
}
public CodeLabel getDatasourcetypeui() {
return datasourcetypeui;
}
public void setDatasourcetypeui(CodeLabel datasourcetypeui) {
this.datasourcetypeui = datasourcetypeui;
}
public CodeLabel getEosctype() {
return eosctype;
}
public void setEosctype(CodeLabel eosctype) {
this.eosctype = eosctype;
}
public CodeLabel getEoscdatasourcetype() {
return eoscdatasourcetype;
}
public void setEoscdatasourcetype(CodeLabel eoscdatasourcetype) {
this.eoscdatasourcetype = eoscdatasourcetype;
}
public CodeLabel getOpenairecompatibility() {
return openairecompatibility;
}
public void setOpenairecompatibility(CodeLabel openairecompatibility) {
this.openairecompatibility = openairecompatibility;
}
public String getOfficialname() {
return officialname;
}
public void setOfficialname(String officialname) {
this.officialname = officialname;
}
public String getEnglishname() {
return englishname;
}
public void setEnglishname(String englishname) {
this.englishname = englishname;
}
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getLogourl() {
return logourl;
}
public void setLogourl(String logourl) {
this.logourl = logourl;
}
public String getContactemail() {
return contactemail;
}
public void setContactemail(String contactemail) {
this.contactemail = contactemail;
}
public String getNamespaceprefix() {
return namespaceprefix;
}
public void setNamespaceprefix(String namespaceprefix) {
this.namespaceprefix = namespaceprefix;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getDateofvalidation() {
return dateofvalidation;
}
public void setDateofvalidation(String dateofvalidation) {
this.dateofvalidation = dateofvalidation;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Subject> getSubjects() {
return subjects;
}
public void setSubjects(List<Subject> subjects) {
this.subjects = subjects;
}
public String getOdnumberofitems() {
return odnumberofitems;
}
public void setOdnumberofitems(String odnumberofitems) {
this.odnumberofitems = odnumberofitems;
}
public String getOdnumberofitemsdate() {
return odnumberofitemsdate;
}
public void setOdnumberofitemsdate(String odnumberofitemsdate) {
this.odnumberofitemsdate = odnumberofitemsdate;
}
public String getOdpolicies() {
return odpolicies;
}
public void setOdpolicies(String odpolicies) {
this.odpolicies = odpolicies;
}
public List<String> getOdlanguages() {
return odlanguages;
}
public void setOdlanguages(List<String> odlanguages) {
this.odlanguages = odlanguages;
}
public List<String> getLanguages() {
return languages;
}
public void setLanguages(List<String> languages) {
this.languages = languages;
}
public List<String> getOdcontenttypes() {
return odcontenttypes;
}
public void setOdcontenttypes(List<String> odcontenttypes) {
this.odcontenttypes = odcontenttypes;
}
public List<String> getAccessinfopackage() {
return accessinfopackage;
}
public void setAccessinfopackage(List<String> accessinfopackage) {
this.accessinfopackage = accessinfopackage;
}
public String getReleasestartdate() {
return releasestartdate;
}
public void setReleasestartdate(String releasestartdate) {
this.releasestartdate = releasestartdate;
}
public String getReleaseenddate() {
return releaseenddate;
}
public void setReleaseenddate(String releaseenddate) {
this.releaseenddate = releaseenddate;
}
public String getMissionstatementurl() {
return missionstatementurl;
}
public void setMissionstatementurl(String missionstatementurl) {
this.missionstatementurl = missionstatementurl;
}
public Boolean getDataprovider() {
return dataprovider;
}
public void setDataprovider(Boolean dataprovider) {
this.dataprovider = dataprovider;
}
public Boolean getServiceprovider() {
return serviceprovider;
}
public void setServiceprovider(Boolean serviceprovider) {
this.serviceprovider = serviceprovider;
}
public String getDatabaseaccesstype() {
return databaseaccesstype;
}
public void setDatabaseaccesstype(String databaseaccesstype) {
this.databaseaccesstype = databaseaccesstype;
}
public String getDatauploadtype() {
return datauploadtype;
}
public void setDatauploadtype(String datauploadtype) {
this.datauploadtype = datauploadtype;
}
public String getDatabaseaccessrestriction() {
return databaseaccessrestriction;
}
public void setDatabaseaccessrestriction(String databaseaccessrestriction) {
this.databaseaccessrestriction = databaseaccessrestriction;
}
public String getDatauploadrestriction() {
return datauploadrestriction;
}
public void setDatauploadrestriction(String datauploadrestriction) {
this.datauploadrestriction = datauploadrestriction;
}
public Boolean getVersioning() {
return versioning;
}
public void setVersioning(Boolean versioning) {
this.versioning = versioning;
}
public Boolean getVersioncontrol() {
return versioncontrol;
}
public void setVersioncontrol(Boolean versioncontrol) {
this.versioncontrol = versioncontrol;
}
public String getCitationguidelineurl() {
return citationguidelineurl;
}
public void setCitationguidelineurl(String citationguidelineurl) {
this.citationguidelineurl = citationguidelineurl;
}
public String getPidsystems() {
return pidsystems;
}
public void setPidsystems(String pidsystems) {
this.pidsystems = pidsystems;
}
public String getCertificates() {
return certificates;
}
public void setCertificates(String certificates) {
this.certificates = certificates;
}
public List<CodeLabel> getPolicies() {
return policies;
}
public void setPolicies(List<CodeLabel> policies) {
this.policies = policies;
}
public Journal getJournal() {
return journal;
}
public void setJournal(Journal journal) {
this.journal = journal;
}
public List<String> getResearchentitytypes() {
return researchentitytypes;
}
public void setResearchentitytypes(List<String> researchentitytypes) {
this.researchentitytypes = researchentitytypes;
}
public List<String> getProvidedproducttypes() {
return providedproducttypes;
}
public void setProvidedproducttypes(List<String> providedproducttypes) {
this.providedproducttypes = providedproducttypes;
}
public CodeLabel getJurisdiction() {
return jurisdiction;
}
public void setJurisdiction(CodeLabel jurisdiction) {
this.jurisdiction = jurisdiction;
}
public Boolean getThematic() {
return thematic;
}
public void setThematic(Boolean thematic) {
this.thematic = thematic;
}
public List<CodeLabel> getContentpolicies() {
return contentpolicies;
}
public void setContentpolicies(List<CodeLabel> contentpolicies) {
this.contentpolicies = contentpolicies;
}
public String getSubmissionpolicyurl() {
return submissionpolicyurl;
}
public void setSubmissionpolicyurl(String submissionpolicyurl) {
this.submissionpolicyurl = submissionpolicyurl;
}
public String getPreservationpolicyurl() {
return preservationpolicyurl;
}
public void setPreservationpolicyurl(String preservationpolicyurl) {
this.preservationpolicyurl = preservationpolicyurl;
}
public List<String> getResearchproductaccesspolicies() {
return researchproductaccesspolicies;
}
public void setResearchproductaccesspolicies(List<String> researchproductaccesspolicies) {
this.researchproductaccesspolicies = researchproductaccesspolicies;
}
public List<String> getResearchproductmetadataaccesspolicies() {
return researchproductmetadataaccesspolicies;
}
public void setResearchproductmetadataaccesspolicies(List<String> researchproductmetadataaccesspolicies) {
this.researchproductmetadataaccesspolicies = researchproductmetadataaccesspolicies;
}
public Boolean getConsenttermsofuse() {
return consenttermsofuse;
}
public void setConsenttermsofuse(Boolean consenttermsofuse) {
this.consenttermsofuse = consenttermsofuse;
}
public Boolean getFulltextdownload() {
return fulltextdownload;
}
public void setFulltextdownload(Boolean fulltextdownload) {
this.fulltextdownload = fulltextdownload;
}
public String getConsenttermsofusedate() {
return consenttermsofusedate;
}
public void setConsenttermsofusedate(String consenttermsofusedate) {
this.consenttermsofusedate = consenttermsofusedate;
}
public String getLastconsenttermsofusedate() {
return lastconsenttermsofusedate;
}
public void setLastconsenttermsofusedate(String lastconsenttermsofusedate) {
this.lastconsenttermsofusedate = lastconsenttermsofusedate;
}
}

View File

@ -0,0 +1,79 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
/**
* Describes a reference to the EOSC Interoperability Framework (IF) Guidelines
*/
public class EoscIfGuidelines implements Serializable {
private static final long serialVersionUID = -6460491699309783829L;
/**
* EOSC-IF local code. Later on it could be populated with a PID (e.g. DOI), but for the time being we stick to
* a more loose definition.
*/
private String code;
/**
* EOSC-IF label
*/
private String label;
/**
* EOSC-IF url
*/
private String url;
/**
* EOSC-IF semantic relation (e.g. compliesWith). Values shall be controlled by a dedicated vocabulary.
*/
private String semanticRelation;
public static EoscIfGuidelines newInstance(String code, String label, String url, String semanticRelation) {
EoscIfGuidelines e = new EoscIfGuidelines();
e.setCode(code);
e.setLabel(label);
e.setUrl(url);
e.setSemanticRelation(semanticRelation);
return e;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getSemanticRelation() {
return semanticRelation;
}
public void setSemanticRelation(String semanticRelation) {
this.semanticRelation = semanticRelation;
}
}

View File

@ -0,0 +1,10 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class ExtraInfo implements Serializable {
private static final long serialVersionUID = -6627854860189757709L;
//TODO define me!
}

View File

@ -0,0 +1,66 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Funder implements Serializable {
private static final long serialVersionUID = -8008317145200052214L;
private String id;
private String shortname;
private String name;
private Country jurisdiction;
private List<Pid> pid;
public static Funder newInstance(String id, String shortname, String name, Country jurisdiction, List<Pid> pid) {
Funder funder = new Funder();
funder.setId(id);
funder.setShortname(shortname);
funder.setName(name);
funder.setJurisdiction(jurisdiction);
funder.setPid(pid);
return funder;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getShortname() {
return shortname;
}
public void setShortname(String shortname) {
this.shortname = shortname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Country getJurisdiction() {
return jurisdiction;
}
public void setJurisdiction(Country jurisdiction) {
this.jurisdiction = jurisdiction;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
}

View File

@ -0,0 +1,62 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Funding implements Serializable {
private static final long serialVersionUID = 1811734787904369695L;
private Funder funder;
private FundingLevel level0;
private FundingLevel level1;
private FundingLevel level2;
public static Funding newInstance(Funder funder, FundingLevel level0) {
return newInstance(funder, level0, null, null);
}
public static Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1) {
return newInstance(funder, level0, level1, null);
}
public static Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1, FundingLevel level2) {
Funding funding = new Funding();
funding.setFunder(funder);
funding.setLevel0(level0);
funding.setLevel1(level1);
funding.setLevel2(level2);
return funding;
}
public Funder getFunder() {
return funder;
}
public void setFunder(Funder funder) {
this.funder = funder;
}
public FundingLevel getLevel0() {
return level0;
}
public void setLevel0(FundingLevel level0) {
this.level0 = level0;
}
public FundingLevel getLevel1() {
return level1;
}
public void setLevel1(FundingLevel level1) {
this.level1 = level1;
}
public FundingLevel getLevel2() {
return level2;
}
public void setLevel2(FundingLevel level2) {
this.level2 = level2;
}
}

View File

@ -0,0 +1,46 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class FundingLevel implements Serializable {
private static final long serialVersionUID = 8270506546250477574L;
private String id;
private String description;
private String name;
public static FundingLevel newInstance(String id, String description, String name) {
FundingLevel level = new FundingLevel();
level.setId(id);
level.setDescription(description);
level.setName(name);
return level;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,155 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Instance implements Serializable {
private static final long serialVersionUID = 7440831757124257169L;
private String license;
private AccessRight accessright;
private String instancetype;
private Provenance hostedby;
private List<String> url;
// other research products specifc
private String distributionlocation;
private Provenance collectedfrom;
private List<Pid> pid;
private List<Pid> alternateIdentifier;
private String dateofacceptance;
// ( article | book ) processing charges. Defined here to cope with possible wrongly typed
// results
private APC processingcharges;
private String refereed; // peer-review status
private List<Measure> measures;
/**
* Direct fulltext URL.
*/
private String fulltext;
public String getLicense() {
return license;
}
public void setLicense(String license) {
this.license = license;
}
public AccessRight getAccessright() {
return accessright;
}
public void setAccessright(AccessRight accessright) {
this.accessright = accessright;
}
public String getInstancetype() {
return instancetype;
}
public void setInstancetype(String instancetype) {
this.instancetype = instancetype;
}
public Provenance getHostedby() {
return hostedby;
}
public void setHostedby(Provenance hostedby) {
this.hostedby = hostedby;
}
public List<String> getUrl() {
return url;
}
public void setUrl(List<String> url) {
this.url = url;
}
public String getDistributionlocation() {
return distributionlocation;
}
public void setDistributionlocation(String distributionlocation) {
this.distributionlocation = distributionlocation;
}
public Provenance getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(Provenance collectedfrom) {
this.collectedfrom = collectedfrom;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public List<Pid> getAlternateIdentifier() {
return alternateIdentifier;
}
public void setAlternateIdentifier(List<Pid> alternateIdentifier) {
this.alternateIdentifier = alternateIdentifier;
}
public String getDateofacceptance() {
return dateofacceptance;
}
public void setDateofacceptance(String dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
public APC getProcessingcharges() {
return processingcharges;
}
public void setProcessingcharges(APC processingcharges) {
this.processingcharges = processingcharges;
}
public String getRefereed() {
return refereed;
}
public void setRefereed(String refereed) {
this.refereed = refereed;
}
public List<Measure> getMeasures() {
return measures;
}
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public String getFulltext() {
return fulltext;
}
public void setFulltext(String fulltext) {
this.fulltext = fulltext;
}
}

View File

@ -0,0 +1,145 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Journal implements Serializable {
private static final long serialVersionUID = -103050431178898773L;
/**
* Name of the journal or conference
*/
private String name;
/**
* The issn
*/
private String issnPrinted;
/**
* The e-issn
*/
private String issnOnline;
/**
* The kinking issn
*/
private String issnLinking;
/**
* Start page
*/
private String sp;
/**
* End page
*/
private String ep;
/**
* Journal issue number
*/
private String iss;
/**
* Volume
*/
private String vol;
/**
* Edition of the journal or conference proceeding
*/
private String edition;
private String conferenceplace;
private String conferencedate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIssnPrinted() {
return issnPrinted;
}
public void setIssnPrinted(String issnPrinted) {
this.issnPrinted = issnPrinted;
}
public String getIssnOnline() {
return issnOnline;
}
public void setIssnOnline(String issnOnline) {
this.issnOnline = issnOnline;
}
public String getIssnLinking() {
return issnLinking;
}
public void setIssnLinking(String issnLinking) {
this.issnLinking = issnLinking;
}
public String getSp() {
return sp;
}
public void setSp(String sp) {
this.sp = sp;
}
public String getEp() {
return ep;
}
public void setEp(String ep) {
this.ep = ep;
}
public String getIss() {
return iss;
}
public void setIss(String iss) {
this.iss = iss;
}
public String getVol() {
return vol;
}
public void setVol(String vol) {
this.vol = vol;
}
public String getEdition() {
return edition;
}
public void setEdition(String edition) {
this.edition = edition;
}
public String getConferenceplace() {
return conferenceplace;
}
public void setConferenceplace(String conferenceplace) {
this.conferenceplace = conferenceplace;
}
public String getConferencedate() {
return conferencedate;
}
public void setConferencedate(String conferencedate) {
this.conferencedate = conferencedate;
}
}

View File

@ -0,0 +1,42 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Language implements Serializable {
private static final long serialVersionUID = -8308628905005193974L;
/**
* alpha-3/ISO 639-2 code of the language
*/
private String code; // the classid in the Qualifier
/**
* Language label in English
*/
private String label; // the classname in the Qualifier
public static Language newInstance(String code, String label) {
Language lang = new Language();
lang.setCode(code);
lang.setLabel(label);
return lang;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}

View File

@ -0,0 +1,10 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Measure implements Serializable {
private static final long serialVersionUID = 57939927121851504L;
//TODO define me!
}

View File

@ -0,0 +1,13 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* The OpenAccess color meant to be used on the result level
*/
public enum OpenAccessColor implements Serializable {
gold, hybrid, bronze
}

View File

@ -0,0 +1,15 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
/**
* This Enum models the OpenAccess status, currently including only the values from Unpaywall
*
* https://support.unpaywall.org/support/solutions/articles/44001777288-what-do-the-types-of-oa-status-green-gold-hybrid-and-bronze-mean-
*/
public enum OpenAccessRoute implements Serializable {
gold, green, hybrid, bronze
}

View File

@ -0,0 +1,169 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Organization implements Serializable {
private static final long serialVersionUID = -4287924905285274034L;
private String legalshortname;
private String legalname;
private List<String> alternativeNames;
private String websiteurl;
private String logourl;
private String eclegalbody;
private String eclegalperson;
private String ecnonprofit;
private String ecresearchorganization;
private String echighereducation;
private String ecinternationalorganizationeurinterests;
private String ecinternationalorganization;
private String ecenterprise;
private String ecsmevalidated;
private String ecnutscode;
private CodeLabel country;
public String getLegalshortname() {
return legalshortname;
}
public void setLegalshortname(String legalshortname) {
this.legalshortname = legalshortname;
}
public String getLegalname() {
return legalname;
}
public void setLegalname(String legalname) {
this.legalname = legalname;
}
public List<String> getAlternativeNames() {
return alternativeNames;
}
public void setAlternativeNames(List<String> alternativeNames) {
this.alternativeNames = alternativeNames;
}
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getLogourl() {
return logourl;
}
public void setLogourl(String logourl) {
this.logourl = logourl;
}
public String getEclegalbody() {
return eclegalbody;
}
public void setEclegalbody(String eclegalbody) {
this.eclegalbody = eclegalbody;
}
public String getEclegalperson() {
return eclegalperson;
}
public void setEclegalperson(String eclegalperson) {
this.eclegalperson = eclegalperson;
}
public String getEcnonprofit() {
return ecnonprofit;
}
public void setEcnonprofit(String ecnonprofit) {
this.ecnonprofit = ecnonprofit;
}
public String getEcresearchorganization() {
return ecresearchorganization;
}
public void setEcresearchorganization(String ecresearchorganization) {
this.ecresearchorganization = ecresearchorganization;
}
public String getEchighereducation() {
return echighereducation;
}
public void setEchighereducation(String echighereducation) {
this.echighereducation = echighereducation;
}
public String getEcinternationalorganizationeurinterests() {
return ecinternationalorganizationeurinterests;
}
public void setEcinternationalorganizationeurinterests(String ecinternationalorganizationeurinterests) {
this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests;
}
public String getEcinternationalorganization() {
return ecinternationalorganization;
}
public void setEcinternationalorganization(String ecinternationalorganization) {
this.ecinternationalorganization = ecinternationalorganization;
}
public String getEcenterprise() {
return ecenterprise;
}
public void setEcenterprise(String ecenterprise) {
this.ecenterprise = ecenterprise;
}
public String getEcsmevalidated() {
return ecsmevalidated;
}
public void setEcsmevalidated(String ecsmevalidated) {
this.ecsmevalidated = ecsmevalidated;
}
public String getEcnutscode() {
return ecnutscode;
}
public void setEcnutscode(String ecnutscode) {
this.ecnutscode = ecnutscode;
}
public CodeLabel getCountry() {
return country;
}
public void setCountry(CodeLabel country) {
this.country = country;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Pid implements Serializable {
private static final long serialVersionUID = -943684282582228545L;
private String type;
private String value;
public static Pid newInstance(String type, String value) {
Pid p = new Pid();
p.setType(type);
p.setValue(value);
return p;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,173 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Project implements Serializable {
private static final long serialVersionUID = -3712733565189222788L;
private String websiteurl;
private String code;
private String acronym;
private String title;
private String startdate;
private String enddate;
private String callidentifier;
private String keywords;
private String duration;
private String ecarticle29_3;
private List<Subject> subjects;
private CodeLabel contracttype;
private String summary;
private String currency;
private Float totalcost;
private Float fundedamount;
private Funding funding;
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getAcronym() {
return acronym;
}
public void setAcronym(String acronym) {
this.acronym = acronym;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getStartdate() {
return startdate;
}
public void setStartdate(String startdate) {
this.startdate = startdate;
}
public String getEnddate() {
return enddate;
}
public void setEnddate(String enddate) {
this.enddate = enddate;
}
public String getCallidentifier() {
return callidentifier;
}
public void setCallidentifier(String callidentifier) {
this.callidentifier = callidentifier;
}
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getEcarticle29_3() {
return ecarticle29_3;
}
public void setEcarticle29_3(String ecarticle29_3) {
this.ecarticle29_3 = ecarticle29_3;
}
public List<Subject> getSubjects() {
return subjects;
}
public void setSubjects(List<Subject> subjects) {
this.subjects = subjects;
}
public CodeLabel getContracttype() {
return contracttype;
}
public void setContracttype(CodeLabel contracttype) {
this.contracttype = contracttype;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public Float getTotalcost() {
return totalcost;
}
public void setTotalcost(Float totalcost) {
this.totalcost = totalcost;
}
public Float getFundedamount() {
return fundedamount;
}
public void setFundedamount(Float fundedamount) {
this.fundedamount = fundedamount;
}
public Funding getFunding() {
return funding;
}
public void setFunding(Funding funding) {
this.funding = funding;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Provenance implements Serializable {
private static final long serialVersionUID = -474833313621479191L;
private String dsId;
private String dsName;
public static Provenance newInstance(String dsId, String dsName) {
Provenance p = new Provenance();
p.setDsId(dsId);
p.setDsName(dsName);
return p;
}
public String getDsId() {
return dsId;
}
public void setDsId(String dsId) {
this.dsId = dsId;
}
public String getDsName() {
return dsName;
}
public void setDsName(String dsName) {
this.dsName = dsName;
}
}

View File

@ -0,0 +1,14 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public enum RecordType implements Serializable {
publication,
dataset,
otherresearchproduct,
software,
datasource,
organization,
project;
}

View File

@ -0,0 +1,218 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class RelatedRecord implements Serializable {
private static final long serialVersionUID = -7251015928787319389L;
private RelatedRecordHeader header;
// common fields
private String title;
private String websiteurl; // datasource, organizations, projects
// results
private String dateofacceptance;
private String publisher;
private List<Pid> pid;
private String codeRepositoryUrl;
private String resulttype;
private List<Provenance> collectedfrom;
private List<Instance> instances;
// datasource
private String officialname;
private CodeLabel datasourcetype;
private CodeLabel datasourcetypeui;
private CodeLabel openairecompatibility;
// organization
private String legalname;
private String legalshortname;
private Country country;
// project
private String projectTitle;
private String code;
private String acronym;
private CodeLabel contracttype;
private Funding funding;
public RelatedRecordHeader getHeader() {
return header;
}
public void setHeader(RelatedRecordHeader header) {
this.header = header;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getWebsiteurl() {
return websiteurl;
}
public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl;
}
public String getDateofacceptance() {
return dateofacceptance;
}
public void setDateofacceptance(String dateofacceptance) {
this.dateofacceptance = dateofacceptance;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public String getCodeRepositoryUrl() {
return codeRepositoryUrl;
}
public void setCodeRepositoryUrl(String codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl;
}
public String getResulttype() {
return resulttype;
}
public void setResulttype(String resulttype) {
this.resulttype = resulttype;
}
public List<Provenance> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<Provenance> collectedfrom) {
this.collectedfrom = collectedfrom;
}
public List<Instance> getInstances() {
return instances;
}
public void setInstances(List<Instance> instances) {
this.instances = instances;
}
public String getOfficialname() {
return officialname;
}
public void setOfficialname(String officialname) {
this.officialname = officialname;
}
public CodeLabel getDatasourcetype() {
return datasourcetype;
}
public void setDatasourcetype(CodeLabel datasourcetype) {
this.datasourcetype = datasourcetype;
}
public CodeLabel getDatasourcetypeui() {
return datasourcetypeui;
}
public void setDatasourcetypeui(CodeLabel datasourcetypeui) {
this.datasourcetypeui = datasourcetypeui;
}
public CodeLabel getOpenairecompatibility() {
return openairecompatibility;
}
public void setOpenairecompatibility(CodeLabel openairecompatibility) {
this.openairecompatibility = openairecompatibility;
}
public String getLegalname() {
return legalname;
}
public void setLegalname(String legalname) {
this.legalname = legalname;
}
public String getLegalshortname() {
return legalshortname;
}
public void setLegalshortname(String legalshortname) {
this.legalshortname = legalshortname;
}
public Country getCountry() {
return country;
}
public void setCountry(Country country) {
this.country = country;
}
public String getProjectTitle() {
return projectTitle;
}
public void setProjectTitle(String projectTitle) {
this.projectTitle = projectTitle;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getAcronym() {
return acronym;
}
public void setAcronym(String acronym) {
this.acronym = acronym;
}
public CodeLabel getContracttype() {
return contracttype;
}
public void setContracttype(CodeLabel contracttype) {
this.contracttype = contracttype;
}
public Funding getFunding() {
return funding;
}
public void setFunding(Funding funding) {
this.funding = funding;
}
}

View File

@ -0,0 +1,57 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class RelatedRecordHeader implements Serializable {
private static final long serialVersionUID = -1491635071695452382L;
private String relationType;
private String relationClass;
private String relatedIdentifier;
private RecordType relatedRecordType;
public static RelatedRecordHeader newInstance(String relationType, String relationClass, String relatedIdentifier, RecordType relatedRecordType) {
RelatedRecordHeader header = new RelatedRecordHeader();
header.setRelationType(relationType);
header.setRelationClass(relationClass);
header.setRelatedIdentifier(relatedIdentifier);
header.setRelatedRecordType(relatedRecordType);
return header;
}
public String getRelationType() {
return relationType;
}
public void setRelationType(String relationType) {
this.relationType = relationType;
}
public String getRelationClass() {
return relationClass;
}
public void setRelationClass(String relationClass) {
this.relationClass = relationClass;
}
public String getRelatedIdentifier() {
return relatedIdentifier;
}
public void setRelatedIdentifier(String relatedIdentifier) {
this.relatedIdentifier = relatedIdentifier;
}
public RecordType getRelatedRecordType() {
return relatedRecordType;
}
public void setRelatedRecordType(RecordType relatedRecordType) {
this.relatedRecordType = relatedRecordType;
}
}

View File

@ -0,0 +1,431 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Result implements Serializable {
private static final long serialVersionUID = -9121038426985022737L;
/**
* Type of the result: one of 'publication', 'dataset', 'software', 'other' (see also https://api.openaire.eu/vocabularies/dnet:result_typologies)
*/
private String resulttype;
/**
* Authors of the result
*/
private List<Author> author;
/**
* The Subject.
*/
private List<Subject> subject;
/**
* The result language
*/
private Language language;
/**
* The list of countries associated to this result
*/
private List<Country> country;
/**
* A name or title by which a scientific result is known. May be the title of a publication, of a dataset or the name of a piece of software.
*/
private String maintitle;
/**
* Explanatory or alternative names by which a scientific result is known.
*/
private List<String> otherTitles;
private List<String> description;
/**
* Main date of the research product: typically the publication or issued date. In case of a research result with
* different versions with different dates, the date of the result is selected as the most frequent well-formatted date.
* If not available, then the most recent and complete date among those that are well-formatted.
* For statistics, the year is extracted and the result is counted only among the result of that year.
* Example:
* Pre-print date: 2019-02-03,
* Article date provided by repository: 2020-02,
* Article date provided by Crossref: 2020,
* OpenAIRE will set as date 2019-02-03, because its the most recent among the complete and well-formed dates.
* If then the repository updates the metadata and set a complete date (e.g. 2020-02-12), then this will be the new
* date for the result because it becomes the most recent most complete date.
* However, if OpenAIRE then collects the pre-print from another repository with date 2019-02-03, then this will be
* the winning date because it becomes the most frequent well-formatted date.
*/
private String publicationdate; // dateofacceptance
/**
* The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource.
*/
private String publisher;
/**
* Date when the embargo ends and this result turns Open Access
*/
private String embargoenddate;
/**
* See definition of Dublin Core field dc:source
*/
private List<String> source;
private List<String> format;
/**
* Contributors for the result
*/
private List<String> contributor;
private List<String> coverage;
/**
* The openest of the access rights of this result.
*/
private BestAccessRight bestaccessright;
/**
* The direct link to the full-text as collected from the data source
*/
private List<String> fulltext;
/**
* Journal has information about the conference or journal where the result has been presented or published
*/
private Journal journal;
/**
* Only for results with type 'software': URL to the software documentation
*/
private List<String> documentationUrl; // software
/**
* Only for results with type 'software': the URL to the repository with the source code
*/
private String codeRepositoryUrl; // software
/**
* Only for results with type 'software': the programming language
*/
private String programmingLanguage; // software
/**
* Only for results with type 'software': Information on the person responsible for providing further information regarding the resource
*/
private List<String> contactperson; // orp
/**
* Only for results with type 'software': Information on the group responsible for providing further information regarding the resource
*/
private List<String> contactgroup; // orp
/**
* Only for results with type 'other': tool useful for the interpretation and/or re-used of the research product
*/
private List<String> tool; // orp
/**
* Only for results with type 'dataset': the declared size of the dataset
*/
private String size; // dataset
/**
* Version of the result
*/
private String version; // dataset
/**
* EOSC Interoperability Framework Guidelines
*/
private List<EoscIfGuidelines> eoscifguidelines;
@JsonProperty("isGreen")
private Boolean isGreen;
private OpenAccessColor openAccessColor;
@JsonProperty("isInDiamondJournal")
private Boolean isInDiamondJournal;
private Boolean publiclyFunded;
private String transformativeAgreement;
/**
* Each instance is one specific materialisation or version of the result. For example, you can have one result with
* three instance: one is the pre-print, one is the post-print, one is te published version
*/
private List<Instance> instance;
public String getResulttype() {
return resulttype;
}
public void setResulttype(String resulttype) {
this.resulttype = resulttype;
}
public List<Author> getAuthor() {
return author;
}
public void setAuthor(List<Author> author) {
this.author = author;
}
public List<Subject> getSubject() {
return subject;
}
public void setSubject(List<Subject> subject) {
this.subject = subject;
}
public Language getLanguage() {
return language;
}
public void setLanguage(Language language) {
this.language = language;
}
public List<Country> getCountry() {
return country;
}
public void setCountry(List<Country> country) {
this.country = country;
}
public String getMaintitle() {
return maintitle;
}
public void setMaintitle(String maintitle) {
this.maintitle = maintitle;
}
public List<String> getOtherTitles() {
return otherTitles;
}
public void setOtherTitles(List<String> otherTitles) {
this.otherTitles = otherTitles;
}
public List<String> getDescription() {
return description;
}
public void setDescription(List<String> description) {
this.description = description;
}
public String getPublicationdate() {
return publicationdate;
}
public void setPublicationdate(String publicationdate) {
this.publicationdate = publicationdate;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getEmbargoenddate() {
return embargoenddate;
}
public void setEmbargoenddate(String embargoenddate) {
this.embargoenddate = embargoenddate;
}
public List<String> getSource() {
return source;
}
public void setSource(List<String> source) {
this.source = source;
}
public List<String> getFormat() {
return format;
}
public void setFormat(List<String> format) {
this.format = format;
}
public List<String> getContributor() {
return contributor;
}
public void setContributor(List<String> contributor) {
this.contributor = contributor;
}
public List<String> getCoverage() {
return coverage;
}
public void setCoverage(List<String> coverage) {
this.coverage = coverage;
}
public BestAccessRight getBestaccessright() {
return bestaccessright;
}
public void setBestaccessright(BestAccessRight bestaccessright) {
this.bestaccessright = bestaccessright;
}
public List<String> getFulltext() {
return fulltext;
}
public void setFulltext(List<String> fulltext) {
this.fulltext = fulltext;
}
public Journal getJournal() {
return journal;
}
public void setJournal(Journal journal) {
this.journal = journal;
}
public List<String> getDocumentationUrl() {
return documentationUrl;
}
public void setDocumentationUrl(List<String> documentationUrl) {
this.documentationUrl = documentationUrl;
}
public String getCodeRepositoryUrl() {
return codeRepositoryUrl;
}
public void setCodeRepositoryUrl(String codeRepositoryUrl) {
this.codeRepositoryUrl = codeRepositoryUrl;
}
public String getProgrammingLanguage() {
return programmingLanguage;
}
public void setProgrammingLanguage(String programmingLanguage) {
this.programmingLanguage = programmingLanguage;
}
public List<String> getContactperson() {
return contactperson;
}
public void setContactperson(List<String> contactperson) {
this.contactperson = contactperson;
}
public List<String> getContactgroup() {
return contactgroup;
}
public void setContactgroup(List<String> contactgroup) {
this.contactgroup = contactgroup;
}
public List<String> getTool() {
return tool;
}
public void setTool(List<String> tool) {
this.tool = tool;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public List<EoscIfGuidelines> getEoscifguidelines() {
return eoscifguidelines;
}
public void setEoscifguidelines(List<EoscIfGuidelines> eoscifguidelines) {
this.eoscifguidelines = eoscifguidelines;
}
public Boolean getGreen() {
return isGreen;
}
public void setGreen(Boolean green) {
isGreen = green;
}
public OpenAccessColor getOpenAccessColor() {
return openAccessColor;
}
public void setOpenAccessColor(OpenAccessColor openAccessColor) {
this.openAccessColor = openAccessColor;
}
public Boolean getInDiamondJournal() {
return isInDiamondJournal;
}
public void setInDiamondJournal(Boolean inDiamondJournal) {
isInDiamondJournal = inDiamondJournal;
}
public Boolean getPubliclyFunded() {
return publiclyFunded;
}
public void setPubliclyFunded(Boolean publiclyFunded) {
this.publiclyFunded = publiclyFunded;
}
public String getTransformativeAgreement() {
return transformativeAgreement;
}
public void setTransformativeAgreement(String transformativeAgreement) {
this.transformativeAgreement = transformativeAgreement;
}
public List<Instance> getInstance() {
return instance;
}
public void setInstance(List<Instance> instance) {
this.instance = instance;
}
}

View File

@ -0,0 +1,122 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class SolrRecord implements Serializable {
private static final long serialVersionUID = 2852901817696335899L;
private SolrRecordHeader header;
private List<Provenance> collectedfrom;
/**
* List of persistent identifiers
*/
private List<Pid> pid;
private List<Context> context;
private List<Measure> measures;
private List<ExtraInfo> extraInfo;
private Result result;
private Datasource datasource;
private Project project;
private Organization organization;
private List<RelatedRecord> links;
public SolrRecordHeader getHeader() {
return header;
}
public void setHeader(SolrRecordHeader header) {
this.header = header;
}
public List<Provenance> getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(List<Provenance> collectedfrom) {
this.collectedfrom = collectedfrom;
}
public List<Pid> getPid() {
return pid;
}
public void setPid(List<Pid> pid) {
this.pid = pid;
}
public List<Context> getContext() {
return context;
}
public void setContext(List<Context> context) {
this.context = context;
}
public List<Measure> getMeasures() {
return measures;
}
public void setMeasures(List<Measure> measures) {
this.measures = measures;
}
public List<ExtraInfo> getExtraInfo() {
return extraInfo;
}
public void setExtraInfo(List<ExtraInfo> extraInfo) {
this.extraInfo = extraInfo;
}
public Result getResult() {
return result;
}
public void setResult(Result result) {
this.result = result;
}
public Datasource getDatasource() {
return datasource;
}
public void setDatasource(Datasource datasource) {
this.datasource = datasource;
}
public Project getProject() {
return project;
}
public void setProject(Project project) {
this.project = project;
}
public Organization getOrganization() {
return organization;
}
public void setOrganization(Organization organization) {
this.organization = organization;
}
public List<RelatedRecord> getLinks() {
return links;
}
public void setLinks(List<RelatedRecord> links) {
this.links = links;
}
}

View File

@ -0,0 +1,64 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class SolrRecordHeader implements Serializable {
private static final long serialVersionUID = -6052397109220149426L;
/**
* The OpenAIRE identifiers for this record
*/
private String id;
/**
* Identifiers of the record at the original sources
*/
private List<String> originalId;
private RecordType recordType;
private Boolean deletedbyinference;
public static SolrRecordHeader newInstance(String id, List<String> originalId, RecordType recordType, Boolean deletedbyinference) {
SolrRecordHeader header = new SolrRecordHeader();
header.setId(id);
header.setOriginalId(originalId);
header.setRecordType(recordType);
header.setDeletedbyinference(deletedbyinference);
return header;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<String> getOriginalId() {
return originalId;
}
public void setOriginalId(List<String> originalId) {
this.originalId = originalId;
}
public RecordType getRecordType() {
return recordType;
}
public void setRecordType(RecordType recordType) {
this.recordType = recordType;
}
public Boolean getDeletedbyinference() {
return deletedbyinference;
}
public void setDeletedbyinference(Boolean deletedbyinference) {
this.deletedbyinference = deletedbyinference;
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
public class Subject implements Serializable {
private static final long serialVersionUID = -7242293435544930481L;
private String value;
private String type;
public static Subject newInstance(String value, String type) {
Subject s = new Subject();
s.setValue(value);
s.setType(type);
return s;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -1,709 +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 -> assertNotNull(p.getProcessingchargeamount()));
publications.forEach(p -> assertNotNull(p.getProcessingchargecurrency()));
publications.forEach(p -> assertTrue(StringUtils.isNotBlank(p.getProcessingchargeamount().getValue() )));
publications.forEach(p -> assertTrue(StringUtils.isNotBlank(p.getProcessingchargecurrency().getValue() )));
publications.forEach(p -> p.getInstance().forEach(i -> assertNotNull(i.getProcessingchargeamount())));
publications.forEach(p -> p.getInstance().forEach(i -> assertNotNull(i.getProcessingchargecurrency())));
publications.forEach(p -> p.getInstance().forEach(i -> assertTrue(StringUtils.isNotBlank(i.getProcessingchargeamount().getValue()))));
publications.forEach(p -> p.getInstance().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().forEach(i -> assertNotNull(i.getProcessingchargeamount()));
p1.getInstance().forEach(i -> assertNotNull(i.getProcessingchargecurrency()));
assertTrue(p1.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount().getValue().equals("2000.47")));
assertTrue(p1.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount().getValue().equals("1721.47")));
assertTrue(p1.getInstance().stream().anyMatch(i -> i.getProcessingchargecurrency().getValue().equals("EUR")));
assertTrue(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()));
assertNotNull(publications.get(0).getProcessingchargeamount());
assertNotNull(publications.get(0).getProcessingchargecurrency());
assertNull(publications.get(1).getProcessingchargeamount());
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());
assertTrue(p1.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount() != null));
assertTrue(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());
assertTrue(p2.getInstance().stream().anyMatch(i -> i.getProcessingchargeamount() != null));
assertTrue(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
void test_merge_irish_1() throws Exception {
List<Result> publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publication_irish_tender_1.json", Publication.class);
Publication p = new Publication();
publications.forEach(p::mergeFrom);
assertNotNull(p);
assertTrue(p.getIsGreen());
assertTrue(p.getIsInDiamondJournal());
assertFalse(p.getPubliclyFunded());
assertEquals(OpenAccessColor.gold, p.getOpenAccessColor());
}
@Test
void test_merge_irish_2() throws Exception {
List<Result> publications = loadResourceResult("/eu/dnetlib/dhp/schema/oaf/utils/publication_irish_tender_2.json", Publication.class);
Publication p = new Publication();
publications.forEach(p::mergeFrom);
assertNotNull(p);
assertTrue(p.getIsGreen());
assertTrue(p.getIsInDiamondJournal());
assertFalse(p.getPubliclyFunded());
assertNull(p.getOpenAccessColor());
}
/**
* 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;
}
}

View File

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

View File

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

View File

@ -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"} ]}

View File

@ -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"} ]}

View File

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

View File

@ -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"} ]}

View File

@ -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"} ]}

View File

@ -1 +0,0 @@
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f","pid":[{"qualifier":{"classid":"scp-number"},"value":"79953761260"}]}

View File

@ -1 +0,0 @@
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f","pid":[]}

View File

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

View File

@ -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"
}
]
}
]
}

View File

@ -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"
}
]
}
]
}

View File

@ -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"
}
]
}
]
}

View File

@ -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"
}
]
}
]
}

View File

@ -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"
}
]
}
]
}

View File

@ -1,3 +0,0 @@
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1f", "resulttype" : { "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"} ], "isGreen": null, "openAccessColor": "gold", "isInDiamondJournal": null, "publiclyFunded": null}
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1g", "resulttype" : { "classid" : "publication" }, "isGreen": true, "openAccessColor": "gold", "isInDiamondJournal": true, "publiclyFunded": false }
{"id":"50|DansKnawCris::0829b5191605bdbea36d6502b8c1ce1h", "resulttype" : { "classid" : "publication" }, "isGreen": false, "openAccessColor": null, "isInDiamondJournal": true, "publiclyFunded": false }

Some files were not shown because too many files have changed in this diff Show More