|
|
|
@ -101,8 +101,11 @@ public class GraphCleaningFunctionsTest {
|
|
|
|
|
assertEquals("0018", p_out.getInstance().get(0).getInstancetype().getClassid());
|
|
|
|
|
assertEquals("Annotation", p_out.getInstance().get(0).getInstancetype().getClassname());
|
|
|
|
|
|
|
|
|
|
assertEquals("0033", p_out.getInstance().get(1).getInstancetype().getClassid());
|
|
|
|
|
assertEquals("Audiovisual", p_out.getInstance().get(1).getInstancetype().getClassname());
|
|
|
|
|
assertEquals("0027", p_out.getInstance().get(1).getInstancetype().getClassid());
|
|
|
|
|
assertEquals("Model", p_out.getInstance().get(1).getInstancetype().getClassname());
|
|
|
|
|
|
|
|
|
|
assertEquals("xyz", p_out.getInstance().get(2).getInstancetype().getClassid());
|
|
|
|
|
assertEquals("xyz", p_out.getInstance().get(2).getInstancetype().getClassname());
|
|
|
|
|
|
|
|
|
|
assertEquals("CLOSED", p_out.getInstance().get(0).getAccessright().getClassid());
|
|
|
|
|
assertEquals("Closed Access", p_out.getInstance().get(0).getAccessright().getClassname());
|
|
|
|
@ -117,7 +120,7 @@ public class GraphCleaningFunctionsTest {
|
|
|
|
|
|
|
|
|
|
List<Instance> poi = p_out.getInstance();
|
|
|
|
|
assertNotNull(poi);
|
|
|
|
|
assertEquals(2, poi.size());
|
|
|
|
|
assertEquals(3, poi.size());
|
|
|
|
|
|
|
|
|
|
final Instance poii = poi.get(0);
|
|
|
|
|
assertNotNull(poii);
|
|
|
|
@ -145,7 +148,7 @@ public class GraphCleaningFunctionsTest {
|
|
|
|
|
|
|
|
|
|
assertEquals(5, p_out.getTitle().size());
|
|
|
|
|
|
|
|
|
|
Publication p_cleaned = GraphCleaningFunctions.cleanup(p_out);
|
|
|
|
|
Publication p_cleaned = GraphCleaningFunctions.cleanup(p_out, vocabularies);
|
|
|
|
|
|
|
|
|
|
assertEquals(3, p_cleaned.getTitle().size());
|
|
|
|
|
|
|
|
|
@ -164,9 +167,12 @@ public class GraphCleaningFunctionsTest {
|
|
|
|
|
|
|
|
|
|
assertEquals("1970-10-07", p_cleaned.getDateofacceptance().getValue());
|
|
|
|
|
|
|
|
|
|
assertEquals("0038", p_cleaned.getInstance().get(2).getInstancetype().getClassid());
|
|
|
|
|
assertEquals("Other literature type", p_cleaned.getInstance().get(2).getInstancetype().getClassname());
|
|
|
|
|
|
|
|
|
|
final List<Instance> pci = p_cleaned.getInstance();
|
|
|
|
|
assertNotNull(pci);
|
|
|
|
|
assertEquals(2, pci.size());
|
|
|
|
|
assertEquals(3, pci.size());
|
|
|
|
|
|
|
|
|
|
final Instance pcii = pci.get(0);
|
|
|
|
|
assertNotNull(pcii);
|
|
|
|
@ -234,7 +240,7 @@ public class GraphCleaningFunctionsTest {
|
|
|
|
|
.toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/clean/doiboostpub.json"));
|
|
|
|
|
Publication p_in = MAPPER.readValue(json, Publication.class);
|
|
|
|
|
Publication p_out = OafCleaner.apply(GraphCleaningFunctions.fixVocabularyNames(p_in), mapping);
|
|
|
|
|
Publication cleaned = GraphCleaningFunctions.cleanup(p_out);
|
|
|
|
|
Publication cleaned = GraphCleaningFunctions.cleanup(p_out, vocabularies);
|
|
|
|
|
|
|
|
|
|
Assertions.assertEquals(true, GraphCleaningFunctions.filter(cleaned));
|
|
|
|
|
}
|
|
|
|
@ -245,7 +251,7 @@ public class GraphCleaningFunctionsTest {
|
|
|
|
|
.toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/clean/doiboostpub2.json"));
|
|
|
|
|
Publication p_in = MAPPER.readValue(json, Publication.class);
|
|
|
|
|
Publication p_out = OafCleaner.apply(GraphCleaningFunctions.fixVocabularyNames(p_in), mapping);
|
|
|
|
|
Publication cleaned = GraphCleaningFunctions.cleanup(p_out);
|
|
|
|
|
Publication cleaned = GraphCleaningFunctions.cleanup(p_out, vocabularies);
|
|
|
|
|
|
|
|
|
|
Assertions.assertEquals(true, GraphCleaningFunctions.filter(cleaned));
|
|
|
|
|
|
|
|
|
|