forked from D-Net/dnet-hadoop
rule out records with NULL dataInfo
This commit is contained in:
parent
1275a07d45
commit
11ffb9bd68
|
@ -239,7 +239,7 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
||||||
d -> Optional
|
d -> Optional
|
||||||
.ofNullable(d.getInvisible())
|
.ofNullable(d.getInvisible())
|
||||||
.orElse(true))
|
.orElse(true))
|
||||||
.orElse(true))
|
.orElse(false))
|
||||||
.orElse(true))) {
|
.orElse(true))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,6 +337,15 @@ public class GraphCleaningFunctionsTest {
|
||||||
Assertions.assertEquals(true, GraphCleaningFunctions.filter(cleaned));
|
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
|
@Test
|
||||||
public void testCleanDoiBoost2() throws IOException {
|
public void testCleanDoiBoost2() throws IOException {
|
||||||
String json = IOUtils
|
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