Update app.py
Browse files
app.py
CHANGED
@@ -9,15 +9,19 @@ def load_names_from_url(url):
|
|
9 |
response = requests.get(url)
|
10 |
data = response.json()
|
11 |
|
|
|
|
|
12 |
names = []
|
13 |
-
for item in data
|
14 |
-
if '
|
15 |
-
|
|
|
|
|
16 |
|
17 |
return names
|
18 |
|
19 |
# Carregar nomes do arquivo JSON-LD a partir do URL
|
20 |
-
names = load_names_from_url('https://huggingface.co/spaces/histlearn/ShowGraph/
|
21 |
|
22 |
def run_query_and_visualize(qtext, turtle_file):
|
23 |
# Carrega o arquivo Turtle
|
|
|
9 |
response = requests.get(url)
|
10 |
data = response.json()
|
11 |
|
12 |
+
print("Data received from URL:", data) # Adicionando impressão para depuração
|
13 |
+
|
14 |
names = []
|
15 |
+
for item in data:
|
16 |
+
if isinstance(item, dict) and '@graph' in item:
|
17 |
+
for entry in item['@graph']:
|
18 |
+
if 'name' in entry:
|
19 |
+
names.append(entry['name'])
|
20 |
|
21 |
return names
|
22 |
|
23 |
# Carregar nomes do arquivo JSON-LD a partir do URL
|
24 |
+
names = load_names_from_url('https://huggingface.co/spaces/histlearn/ShowGraph/raw/main/datafile.jsonld')
|
25 |
|
26 |
def run_query_and_visualize(qtext, turtle_file):
|
27 |
# Carrega o arquivo Turtle
|