forked from D-Net/dnet-hadoop
Merge remote-tracking branch 'origin/beta' into zenodo_dump_collection
This commit is contained in:
commit
5f134c4045
|
@ -1,3 +1,4 @@
|
|||
|
||||
package eu.dnetlib.dhp.sx.bio.pubmed;
|
||||
|
||||
/**
|
||||
|
@ -14,6 +15,7 @@ public class PMAffiliation {
|
|||
public PMAffiliation() {
|
||||
|
||||
}
|
||||
|
||||
public PMAffiliation(String name, PMIdentifier identifier) {
|
||||
this.name = name;
|
||||
this.identifier = identifier;
|
||||
|
|
|
@ -97,5 +97,4 @@ public class PMAuthor implements Serializable {
|
|||
this.affiliation = affiliation;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
package eu.dnetlib.dhp.sx.bio.pubmed;
|
||||
|
||||
public class PMIdentifier {
|
||||
|
@ -5,7 +6,6 @@ public class PMIdentifier {
|
|||
private String pid;
|
||||
private String type;
|
||||
|
||||
|
||||
public PMIdentifier(String pid, String type) {
|
||||
this.pid = cleanPid(pid);
|
||||
this.type = type;
|
||||
|
|
|
@ -673,7 +673,6 @@ case object Crossref2Oaf {
|
|||
val doi = input.getString(0)
|
||||
val rorId = input.getString(1)
|
||||
|
||||
|
||||
val pubId = IdentifierFactory.idFromPid("50", "doi", DoiCleaningRule.clean(doi), true)
|
||||
val affId = GenerateRorActionSetJob.calculateOpenaireId(rorId)
|
||||
|
||||
|
|
|
@ -82,21 +82,22 @@ class PMParser2 {
|
|||
a.setLastName((author \ "LastName").text)
|
||||
a.setForeName((author \ "ForeName").text)
|
||||
val id = (author \ "Identifier").text
|
||||
val idType =(author \ "Identifier" \ "@Source").text
|
||||
val idType = (author \ "Identifier" \ "@Source").text
|
||||
|
||||
if(id != null && id.nonEmpty && idType != null && idType.nonEmpty) {
|
||||
if (id != null && id.nonEmpty && idType != null && idType.nonEmpty) {
|
||||
a.setIdentifier(new PMIdentifier(id, idType))
|
||||
}
|
||||
|
||||
|
||||
val affiliation = (author \ "AffiliationInfo" \ "Affiliation").text
|
||||
val affiliationId = (author \ "AffiliationInfo" \ "Identifier").text
|
||||
val affiliationIdType = (author \ "AffiliationInfo" \ "Identifier" \ "@Source").text
|
||||
|
||||
if(affiliation != null && affiliation.nonEmpty) {
|
||||
if (affiliation != null && affiliation.nonEmpty) {
|
||||
val aff = new PMAffiliation()
|
||||
aff.setName(affiliation)
|
||||
if(affiliationId != null && affiliationId.nonEmpty && affiliationIdType != null && affiliationIdType.nonEmpty) {
|
||||
if (
|
||||
affiliationId != null && affiliationId.nonEmpty && affiliationIdType != null && affiliationIdType.nonEmpty
|
||||
) {
|
||||
aff.setIdentifier(new PMIdentifier(affiliationId, affiliationIdType))
|
||||
}
|
||||
a.setAffiliation(aff)
|
||||
|
|
|
@ -294,11 +294,23 @@ object PubMedToOaf {
|
|||
author.setName(a.getForeName)
|
||||
author.setSurname(a.getLastName)
|
||||
author.setFullname(a.getFullName)
|
||||
if(a.getIdentifier != null) {
|
||||
author.setPid(List(OafMapperUtils.structuredProperty(a.getIdentifier.getPid,
|
||||
OafMapperUtils.qualifier(a.getIdentifier.getType,a.getIdentifier.getType,ModelConstants.DNET_PID_TYPES, ModelConstants.DNET_PID_TYPES), dataInfo)).asJava)
|
||||
if (a.getIdentifier != null) {
|
||||
author.setPid(
|
||||
List(
|
||||
OafMapperUtils.structuredProperty(
|
||||
a.getIdentifier.getPid,
|
||||
OafMapperUtils.qualifier(
|
||||
a.getIdentifier.getType,
|
||||
a.getIdentifier.getType,
|
||||
ModelConstants.DNET_PID_TYPES,
|
||||
ModelConstants.DNET_PID_TYPES
|
||||
),
|
||||
dataInfo
|
||||
)
|
||||
).asJava
|
||||
)
|
||||
}
|
||||
if (a.getAffiliation!= null)
|
||||
if (a.getAffiliation != null)
|
||||
author.setRawAffiliationString(List(a.getAffiliation.getName).asJava)
|
||||
author.setRank(index + 1)
|
||||
author
|
||||
|
|
|
@ -63,7 +63,6 @@ class BioScholixTest extends AbstractVocabularyTest {
|
|||
"0000000333457333",
|
||||
"0000000335964515",
|
||||
"0000000302921949",
|
||||
|
||||
"http://orcid.org/0000-0001-8567-3543",
|
||||
"http://orcid.org/0000-0001-7868-8528",
|
||||
"0000-0001-9189-1440",
|
||||
|
|
Loading…
Reference in New Issue