1
0
Fork 0

rule out records with NULL dataInfo

This commit is contained in:
Claudio Atzori 2023-07-31 12:35:05 +02:00
parent d512df8612
commit ccac6a7f75
3 changed files with 11 additions and 1 deletions

View File

@ -236,7 +236,7 @@ public class GraphCleaningFunctions extends CleaningFunctions {
d -> Optional
.ofNullable(d.getInvisible())
.orElse(true))
.orElse(true))
.orElse(false))
.orElse(true))) {
return true;
}

View File

@ -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

View File

@ -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"}