DOIBoost Mapping: change the creation of the instance in the DOIBoost result #155

Merged
claudio.atzori merged 12 commits from doiboost_url into beta 2021-11-11 10:40:33 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit d50057b2d9 - Show all commits

View File

@ -206,7 +206,7 @@ case object Crossref2Oaf {
else { else {
instance.setDateofacceptance(asField(createdDate.getValue)) instance.setDateofacceptance(asField(createdDate.getValue))
} }
val s: List[String] = List((json \ "URL").extract[String]) val s: List[String] = List("https://doi.org/" + doi)
// val links: List[String] = ((for {JString(url) <- json \ "link" \ "URL"} yield url) ::: List(s)).filter(p => p != null && p.toLowerCase().contains(doi.toLowerCase())).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
claudio.atzori marked this conversation as resolved
Review

Clean up commented out code lines

Clean up commented out code lines
// if (links.nonEmpty) { // if (links.nonEmpty) {
// instance.setUrl(links.asJava) // instance.setUrl(links.asJava)

View File

@ -629,7 +629,7 @@ class CrossrefMappingTest {
assertEquals(1, item.getInstance().size()) assertEquals(1, item.getInstance().size())
assertEquals(1, item.getInstance().get(0).getUrl().size()) assertEquals(1, item.getInstance().get(0).getUrl().size())
assertEquals("http://dx.doi.org/10.1016/j.jas.2019.105013", item.getInstance().get(0).getUrl().get(0)) assertEquals("https://doi.org/10.1016/j.jas.2019.105013", item.getInstance().get(0).getUrl().get(0))
//println(mapper.writeValueAsString(item)) //println(mapper.writeValueAsString(item))
} }