forked from D-Net/dnet-hadoop
do not consider NCID, GBIF as PIDs candidate for the ID creation
This commit is contained in:
parent
2c407e775e
commit
349e7246aa
|
@ -91,16 +91,14 @@ public class IdentifierFactory implements Serializable {
|
||||||
if (CleaningFunctions.PID_BLACKLIST.contains(StringUtils.trim(s.getValue().toLowerCase()))) {
|
if (CleaningFunctions.PID_BLACKLIST.contains(StringUtils.trim(s.getValue().toLowerCase()))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
switch (PidType.tryValueOf(s.getQualifier().getClassid())) {
|
||||||
switch (PidType.valueOf(s.getQualifier().getClassid())) {
|
case doi:
|
||||||
case doi:
|
final String doi = StringUtils.trim(StringUtils.lowerCase(s.getValue()));
|
||||||
final String doi = StringUtils.trim(StringUtils.lowerCase(s.getValue()));
|
return doi.matches(DOI_REGEX);
|
||||||
return doi.matches(DOI_REGEX);
|
case original:
|
||||||
default:
|
return false;
|
||||||
return true;
|
default:
|
||||||
}
|
return true;
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ public class OrganizationPidComparator implements Comparator<StructuredProperty>
|
||||||
@Override
|
@Override
|
||||||
public int compare(StructuredProperty left, StructuredProperty right) {
|
public int compare(StructuredProperty left, StructuredProperty right) {
|
||||||
|
|
||||||
PidType lClass = PidType.valueOf(left.getQualifier().getClassid());
|
PidType lClass = PidType.tryValueOf(left.getQualifier().getClassid());
|
||||||
PidType rClass = PidType.valueOf(right.getQualifier().getClassid());
|
PidType rClass = PidType.tryValueOf(right.getQualifier().getClassid());
|
||||||
|
|
||||||
if (lClass.equals(PidType.GRID))
|
if (lClass.equals(PidType.GRID))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.apache.commons.lang3.EnumUtils;
|
||||||
public enum PidType {
|
public enum PidType {
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
doi, pmid, pmc, handle, arXiv, NCID, GBIF, nct, pdb,
|
doi, pmid, pmc, handle, arXiv, nct, pdb,
|
||||||
|
|
||||||
// Organization
|
// Organization
|
||||||
GRID, mag_id, urn,
|
GRID, mag_id, urn,
|
||||||
|
|
|
@ -10,8 +10,8 @@ public class ResultPidComparator implements Comparator<StructuredProperty> {
|
||||||
@Override
|
@Override
|
||||||
public int compare(StructuredProperty left, StructuredProperty right) {
|
public int compare(StructuredProperty left, StructuredProperty right) {
|
||||||
|
|
||||||
PidType lClass = PidType.valueOf(left.getQualifier().getClassid());
|
PidType lClass = PidType.tryValueOf(left.getQualifier().getClassid());
|
||||||
PidType rClass = PidType.valueOf(right.getQualifier().getClassid());
|
PidType rClass = PidType.tryValueOf(right.getQualifier().getClassid());
|
||||||
|
|
||||||
if (lClass.equals(PidType.doi))
|
if (lClass.equals(PidType.doi))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -38,24 +38,14 @@ public class ResultPidComparator implements Comparator<StructuredProperty> {
|
||||||
if (rClass.equals(PidType.arXiv))
|
if (rClass.equals(PidType.arXiv))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (lClass.equals(PidType.NCID))
|
|
||||||
return -1;
|
|
||||||
if (rClass.equals(PidType.NCID))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (lClass.equals(PidType.GBIF))
|
|
||||||
return -1;
|
|
||||||
if (rClass.equals(PidType.GBIF))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (lClass.equals(PidType.nct))
|
if (lClass.equals(PidType.nct))
|
||||||
return -1;
|
return -1;
|
||||||
if (rClass.equals(PidType.nct))
|
if (rClass.equals(PidType.nct))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (lClass.equals(PidType.urn))
|
if (lClass.equals(PidType.pdb))
|
||||||
return -1;
|
return -1;
|
||||||
if (rClass.equals(PidType.urn))
|
if (rClass.equals(PidType.pdb))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue