forked from D-Net/dnet-hadoop
rule out records with NULL dataInfo
This commit is contained in:
parent
d512df8612
commit
ccac6a7f75
|
@ -236,7 +236,7 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
|||
d -> Optional
|
||||
.ofNullable(d.getInvisible())
|
||||
.orElse(true))
|
||||
.orElse(true))
|
||||
.orElse(false))
|
||||
.orElse(true))) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -368,6 +368,15 @@ public class GraphCleaningFunctionsTest {
|
|||
Assertions.assertEquals(true, GraphCleaningFunctions.filter(cleaned));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFilterProject() throws IOException {
|
||||
String json = IOUtils
|
||||
.toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/clean/project.json"));
|
||||
Project p_in = MAPPER.readValue(json, Project.class);
|
||||
|
||||
Assertions.assertEquals(false, GraphCleaningFunctions.filter(p_in));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCleanDoiBoost2() throws IOException {
|
||||
String json = IOUtils
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{"measures": [{"id": "downloads", "unit": [{"dataInfo": {"provenanceaction": {"classid": "measure:usage_counts", "classname": "measure:usage_counts", "schemeid": "dnet:provenanceActions", "schemename": "dnet:provenanceActions"}, "deletedbyinference": false, "inferred": true, "inferenceprovenance": "update", "invisible": false, "trust": ""}, "key": "count", "value": "1"}]}, {"id": "views", "unit": [{"dataInfo": {"provenanceaction": {"classid": "measure:usage_counts", "classname": "measure:usage_counts", "schemeid": "dnet:provenanceActions", "schemename": "dnet:provenanceActions"}, "deletedbyinference": false, "inferred": true, "inferenceprovenance": "update", "invisible": false, "trust": ""}, "key": "count", "value": "0"}]}], "id": "40|aka_________::591da07706352f1195afaeed4065f52e"}
|
Loading…
Reference in New Issue