From 753123aeaabcb5be2b68a1297e80fb96717179b7 Mon Sep 17 00:00:00 2001 From: Andrew Tavis Date: Wed, 12 Jan 2022 13:10:58 +0100 Subject: [PATCH] #95 Add calls to formatting files in update_data.py --- Data/update_data.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Data/update_data.py b/Data/update_data.py index 86429a77..c4868fdb 100644 --- a/Data/update_data.py +++ b/Data/update_data.py @@ -9,6 +9,7 @@ import json import os import sys +from subprocess import call from tqdm.auto import tqdm from wikidataintegrator import wdi_core @@ -120,5 +121,14 @@ results_formatted.append(r_dict) -with open("./example.json", "w", encoding="utf-8",) as f: - json.dump(results_formatted, f, ensure_ascii=False, indent=2) + with open( + f"./{q.split('/')[0]}/{q.split('/')[1]}/{q.split('/')[1]}Queried.json", + "w", + encoding="utf-8", + ) as f: + json.dump(results_formatted, f, ensure_ascii=False, indent=2) + + call( + ["python", f"./{q.split('/')[0]}/{q.split('/')[1]}/format_{q.split('/')[1]}"], + shell=True, + )