1
0
Fork 0

[DOIBoost - Mapping] selecting the url from Crossref containing the doi

This commit is contained in:
Miriam Baglioni 2021-11-03 15:44:57 +01:00
parent 779318961c
commit b2bb8d9d79
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ case object Crossref2Oaf {
instance.setDateofacceptance(asField(createdDate.getValue)) instance.setDateofacceptance(asField(createdDate.getValue))
} }
val s: String = (json \ "URL").extract[String] val s: String = (json \ "URL").extract[String]
val links: List[String] = ((for {JString(url) <- json \ "link" \ "URL"} yield url) ::: List(s)).filter(p => p != null && !p.contains("api.elsevier.com...")).distinct val links: List[String] = ((for {JString(url) <- json \ "link" \ "URL"} yield url) ::: List(s)).filter(p => p != null && p.toLowerCase().contains(doi.toLowerCase())).distinct
if (links.nonEmpty) { if (links.nonEmpty) {
instance.setUrl(links.asJava) instance.setUrl(links.asJava)
} }