PR: Bypass Action Set #157

Merged
claudio.atzori merged 10 commits from bypass_acstionset into beta 2021-11-12 12:01:05 +01:00
1 changed files with 5 additions and 8 deletions
Showing only changes of commit 881113743f - Show all commits

View File

@ -11,8 +11,7 @@ import org.apache.spark.sql.SparkSession;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.dnetlib.dhp.application.ArgumentApplicationParser;
import eu.dnetlib.dhp.schema.oaf.DataInfo;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
public class Constants {
@ -28,10 +27,12 @@ public class Constants {
public static final String FOS_CLASS_ID = "FOS";
public static final String FOS_CLASS_NAME = "Fields of Science and Technology classification";
public final static String NULL = "NULL";
public static final String NULL = "NULL";
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private Constants(){}
public static Boolean isSparkSessionManaged(ArgumentApplicationParser parser) {
return Optional
.ofNullable(parser.get("isSparkSessionManaged"))
@ -47,9 +48,5 @@ public class Constants {
.map((MapFunction<String, R>) value -> OBJECT_MAPPER.readValue(value, clazz), Encoders.bean(clazz));
}
claudio.atzori marked this conversation as resolved
Review

Instead of defining an ad hoc method, it would be better to reuse the already existing function for the creation of the unresolved identifiers. It is available in

eu.dnetlib.dhp.utils.DHPUtils#generateUnresolvedIdentifier
Instead of defining an ad hoc method, it would be better to reuse the already existing function for the creation of the unresolved identifiers. It is available in ``` eu.dnetlib.dhp.utils.DHPUtils#generateUnresolvedIdentifier ```
public static String getUnresolvedDoiIndentifier(String doi) {
StringBuilder sb = new StringBuilder();
sb.append(UNREOSLVED_PREFIX).append(doi).append(UNREOSLVED_POSTFIX_DOI);
return sb.toString();
}
}