2020-04-27 14:52:31 +02:00
|
|
|
|
2020-03-27 10:42:17 +01:00
|
|
|
package eu.dnetlib.dhp.oa.provision.utils;
|
2020-02-13 16:53:27 +01:00
|
|
|
|
2020-04-18 12:42:58 +02:00
|
|
|
import static org.apache.commons.lang3.StringUtils.substringAfter;
|
|
|
|
|
2020-04-28 11:23:29 +02:00
|
|
|
import java.util.Set;
|
|
|
|
|
2020-02-13 16:53:27 +01:00
|
|
|
import com.google.common.collect.Sets;
|
2020-04-28 11:23:29 +02:00
|
|
|
|
2020-12-09 19:04:50 +01:00
|
|
|
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
2020-02-13 16:53:27 +01:00
|
|
|
|
|
|
|
public class GraphMappingUtils {
|
|
|
|
|
2020-04-27 14:52:31 +02:00
|
|
|
public static final String SEPARATOR = "_";
|
2020-03-02 17:03:07 +01:00
|
|
|
|
2021-08-11 12:13:22 +02:00
|
|
|
public static final Set<String> authorPidTypes = Sets
|
2021-02-10 11:22:09 +01:00
|
|
|
.newHashSet(
|
2020-12-09 19:04:50 +01:00
|
|
|
ModelConstants.ORCID, ModelConstants.ORCID_PENDING, "magidentifier");
|
2020-02-13 16:53:27 +01:00
|
|
|
|
2021-08-11 12:13:22 +02:00
|
|
|
private GraphMappingUtils() {
|
|
|
|
}
|
|
|
|
|
2020-04-27 14:52:31 +02:00
|
|
|
public static String removePrefix(final String s) {
|
|
|
|
if (s.contains("|"))
|
|
|
|
return substringAfter(s, "|");
|
|
|
|
return s;
|
|
|
|
}
|
2020-02-13 16:53:27 +01:00
|
|
|
|
2020-04-27 14:52:31 +02:00
|
|
|
public static String getRelDescriptor(String relType, String subRelType, String relClass) {
|
|
|
|
return relType + SEPARATOR + subRelType + SEPARATOR + relClass;
|
|
|
|
}
|
2020-02-13 16:53:27 +01:00
|
|
|
}
|