forked from D-Net/dnet-hadoop
fixed import of ORPs stored on HDFS in the internal graph format (e.g. Datacite)
This commit is contained in:
parent
1416f16b35
commit
b3ddbaed58
|
@ -93,8 +93,8 @@ object CopyHdfsOafSparkApplication {
|
|||
hasSource != null && hasTarget != null
|
||||
} else {
|
||||
val hasId = (json \ "id").extractOrElse[String](null)
|
||||
val resultType = (json \ "resulttype" \ "classid").extractOrElse[String](null)
|
||||
hasId != null && oafType.equalsIgnoreCase(resultType)
|
||||
val resultType = (json \ "resulttype" \ "classid").extractOrElse[String]("")
|
||||
hasId != null && oafType.startsWith(resultType)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,7 +59,19 @@ public class CopyHdfsOafSparkApplicationTest {
|
|||
.getResourceAsStream(
|
||||
"/eu/dnetlib/dhp/oa/graph/raw/publication_2_unknownProperty.json")),
|
||||
"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
Loading…
Reference in New Issue