[fix] preserve parent/child relations from OpenOrgs #164

Merged
claudio.atzori merged 3 commits from preserve_openorg_parent_child_relations into beta 2021-11-19 11:35:56 +01:00
1 changed files with 1 additions and 14 deletions
Showing only changes of commit f4538f3c4c - Show all commits

View File

@ -232,20 +232,7 @@ public class SparkOpenorgsProvisionTest implements Serializable {
final JavaRDD<String> rels = jsc.textFile(testDedupGraphBasePath + "/relation"); final JavaRDD<String> rels = jsc.textFile(testDedupGraphBasePath + "/relation");
long relations = rels.count(); assertEquals(2382, rels.count());
final ObjectMapper mapper = new ObjectMapper();
List<String> relTypes = rels
.map(r -> mapper.readValue(r, Relation.class))
.map(
r -> r.getRelType() + "_" + r.getSubRelType() + "_" + r.getRelClass() + "|" +
r.getCollectedfrom().stream().map(cf -> cf.getValue()).collect(Collectors.joining(",")))
.distinct()
.collect();
relTypes.forEach(r -> System.out.println("relType: " + r));
assertEquals(2382, relations);
} }