(
filtered_relations_path,
domain_range_label_map_path,
output_relation_rich_map_path,
output_rich_relation_map_path,
output_filtered_rich_relation_path,
)
| 690 | return res |
| 691 | |
| 692 | def construct_common_data( |
| 693 | filtered_relations_path, |
| 694 | domain_range_label_map_path, |
| 695 | output_relation_rich_map_path, |
| 696 | output_rich_relation_map_path, |
| 697 | output_filtered_rich_relation_path, |
| 698 | ): |
| 699 | filtered_relations = load_json(filtered_relations_path) |
| 700 | domain_range_label_map = load_json(domain_range_label_map_path) |
| 701 | relation_rich_map = dict() |
| 702 | rich_relation_map = defaultdict(list) |
| 703 | filtered_rich_relations = [] |
| 704 | for rel in filtered_relations: |
| 705 | richRelation = serialize_rich_relation(rel, domain_range_label_map).replace('\n', '') |
| 706 | relation_rich_map[rel] = richRelation |
| 707 | rich_relation_map[richRelation].append(rel) |
| 708 | filtered_rich_relations.append(richRelation) |
| 709 | dump_json(relation_rich_map, output_relation_rich_map_path) |
| 710 | dump_json(rich_relation_map, output_rich_relation_map_path) |
| 711 | dump_json(filtered_rich_relations, output_filtered_rich_relation_path) |
| 712 | |
| 713 | |
| 714 | if __name__=='__main__': |
nothing calls this directly
no test coverage detected