78 lines
3.0 KiB
Plaintext
78 lines
3.0 KiB
Plaintext
diff a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcidnodoi/oaf/PublicationToOaf.java b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcidnodoi/oaf/PublicationToOaf.java (rejected hunks)
|
|
@@ -30,11 +30,11 @@ public class PublicationToOaf implements Serializable {
|
|
|
|
static Logger logger = LoggerFactory.getLogger(PublicationToOaf.class);
|
|
|
|
- public static final String ORCID = "ORCID";
|
|
- public static final String ORCID_PID_TYPE_CLASSNAME = "Open Researcher and Contributor ID";
|
|
public final static String orcidPREFIX = "orcid_______";
|
|
public static final String OPENAIRE_PREFIX = "openaire____";
|
|
public static final String SEPARATOR = "::";
|
|
+ public static final String DEACTIVATED_NAME = "Given Names Deactivated";
|
|
+ public static final String DEACTIVATED_SURNAME = "Family Name Deactivated";
|
|
|
|
private String dateOfCollection = "";
|
|
private final LongAccumulator parsedPublications;
|
|
@@ -72,13 +81,18 @@ public class PublicationToOaf implements Serializable {
|
|
this.errorsNotFoundAuthors = null;
|
|
this.errorsInvalidType = null;
|
|
this.otherTypeFound = null;
|
|
+ this.deactivatedAcc = null;
|
|
+ this.titleNotProvidedAcc = null;
|
|
+ this.noUrlAcc = null;
|
|
this.dateOfCollection = null;
|
|
}
|
|
|
|
private static Map<String, Pair<String, String>> datasources = new HashMap<String, Pair<String, String>>() {
|
|
|
|
{
|
|
- put(ORCID.toLowerCase(), new Pair<>(ORCID, OPENAIRE_PREFIX + SEPARATOR + "orcid"));
|
|
+ put(
|
|
+ ModelConstants.ORCID,
|
|
+ new Pair<>(ModelConstants.ORCID.toUpperCase(), OPENAIRE_PREFIX + SEPARATOR + "orcid"));
|
|
|
|
}
|
|
};
|
|
@@ -183,6 +197,12 @@ public class PublicationToOaf implements Serializable {
|
|
}
|
|
return null;
|
|
}
|
|
+ if (titles.stream().filter(t -> (t != null && t.equals("Title Not Supplied"))).count() > 0) {
|
|
+ if (titleNotProvidedAcc != null) {
|
|
+ titleNotProvidedAcc.add(1);
|
|
+ }
|
|
+ return null;
|
|
+ }
|
|
Qualifier q = mapQualifier("main title", "main title", "dnet:dataCite_title", "dnet:dataCite_title");
|
|
publication
|
|
.setTitle(
|
|
@@ -527,24 +562,21 @@ public class PublicationToOaf implements Serializable {
|
|
|
|
private KeyValue createCollectedFrom() {
|
|
KeyValue cf = new KeyValue();
|
|
- cf.setValue(ORCID);
|
|
+ cf.setValue(ModelConstants.ORCID.toUpperCase());
|
|
cf.setKey("10|" + OPENAIRE_PREFIX + SEPARATOR + "806360c771262b4d6770e7cdf04b5c5a");
|
|
return cf;
|
|
}
|
|
|
|
private KeyValue createHostedBy() {
|
|
- KeyValue hb = new KeyValue();
|
|
- hb.setValue("Unknown Repository");
|
|
- hb.setKey("10|" + OPENAIRE_PREFIX + SEPARATOR + "55045bd2a65019fd8e6741a755395c8c");
|
|
- return hb;
|
|
+ return ModelConstants.UNKNOWN_REPOSITORY;
|
|
}
|
|
|
|
private StructuredProperty mapAuthorId(String orcidId) {
|
|
final StructuredProperty sp = new StructuredProperty();
|
|
sp.setValue(orcidId);
|
|
final Qualifier q = new Qualifier();
|
|
- q.setClassid(ORCID.toLowerCase());
|
|
- q.setClassname(ORCID_PID_TYPE_CLASSNAME);
|
|
+ q.setClassid(ModelConstants.ORCID);
|
|
+ q.setClassname(ModelConstants.ORCID_CLASSNAME);
|
|
q.setSchemeid(ModelConstants.DNET_PID_TYPES);
|
|
q.setSchemename(ModelConstants.DNET_PID_TYPES);
|
|
sp.setQualifier(q);
|