1
0
Fork 0

fixed import of ORPs stored on HDFS in the internal graph format (e.g. Datacite)

This commit is contained in:
Claudio Atzori 2024-02-07 17:02:05 +01:00
parent bb82052c40
commit 38c9001147
3 changed files with 15 additions and 2 deletions

View File

@ -93,8 +93,8 @@ object CopyHdfsOafSparkApplication {
hasSource != null && hasTarget != null hasSource != null && hasTarget != null
} else { } else {
val hasId = (json \ "id").extractOrElse[String](null) val hasId = (json \ "id").extractOrElse[String](null)
val resultType = (json \ "resulttype" \ "classid").extractOrElse[String](null) val resultType = (json \ "resulttype" \ "classid").extractOrElse[String]("")
hasId != null && oafType.equalsIgnoreCase(resultType) hasId != null && oafType.startsWith(resultType)
} }
} }

View File

@ -59,7 +59,19 @@ public class CopyHdfsOafSparkApplicationTest {
.getResourceAsStream( .getResourceAsStream(
"/eu/dnetlib/dhp/oa/graph/raw/publication_2_unknownProperty.json")), "/eu/dnetlib/dhp/oa/graph/raw/publication_2_unknownProperty.json")),
"publication")); "publication"));
}
@Test
void isOafType_Datacite_ORP() throws IOException {
assertTrue(
CopyHdfsOafSparkApplication
.isOafType(
IOUtils
.toString(
getClass()
.getResourceAsStream(
"/eu/dnetlib/dhp/oa/graph/raw/datacite_orp.json")),
"otherresearchproduct"));
} }
} }

File diff suppressed because one or more lines are too long