Enrich authors with ORCID info using new matching algorithm #398

Merged
giambattista.bloisi merged 2 commits from new_orcid_enhancement into beta 2024-03-22 17:29:20 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 0ff7faad72 - Show all commits

View File

@ -87,7 +87,7 @@ object ORCIDAuthorEnricher extends Serializable {
) = {
val matched = scala.collection.mutable.ArrayBuffer.empty[MatchedAuthors]
if (graph_authors != null && graph_authors.isEmpty) {
if (graph_authors != null && !graph_authors.isEmpty) {
val ait = graph_authors.iterator
while (ait.hasNext) {

View File

@ -72,7 +72,7 @@ class SparkEnrichGraphWithOrcidAuthors(propertyPath: String, args: Array[String]
.join(matched, Seq("id"), "left")
.withColumn(
"author",
when(size(col("enriched_author")).gt(1), col("enriched_author"))
when(size(col("enriched_author")).gt(0), col("enriched_author"))
.otherwise(col("author"))
)
.drop("enriched_author")