AD2000X commited on
Commit
381f954
·
verified ·
1 Parent(s): 575e27f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -236,7 +236,7 @@ def run_ontology_structure_analysis():
236
  def run_entity_exploration():
237
  st.title("Entity Exploration")
238
 
239
- # 從圖中抓出所有實體(不依賴 ontology["classes"] 中的列表)
240
  entities = [
241
  node for node, attr in ontology_manager.graph.nodes(data=True)
242
  if attr.get("type") == "instance"
@@ -246,9 +246,11 @@ def run_entity_exploration():
246
  # Debug info
247
  st.write("Loaded entities:", entities)
248
  st.write("Ontology classes:", ontology_manager.get_classes())
249
- for node, attr in ontology_manager.graph.nodes(data=True):
250
- if attr.get("type") == "instance":
251
- st.write("Found instance:", node, "of class:", attr.get("class_type"))
 
 
252
 
253
  selected_entity = st.selectbox("Select Entity", entities) if entities else None
254
 
 
236
  def run_entity_exploration():
237
  st.title("Entity Exploration")
238
 
239
+ # Grab all entities from the graph (do not rely on the list in ontology["classes"])
240
  entities = [
241
  node for node, attr in ontology_manager.graph.nodes(data=True)
242
  if attr.get("type") == "instance"
 
246
  # Debug info
247
  st.write("Loaded entities:", entities)
248
  st.write("Ontology classes:", ontology_manager.get_classes())
249
+
250
+ with st.expander("Found instances", expanded=False):
251
+ for node, attr in ontology_manager.graph.nodes(data=True):
252
+ if attr.get("type") == "instance":
253
+ st.write("Found instance:", node, "of class:", attr.get("class_type"))
254
 
255
  selected_entity = st.selectbox("Select Entity", entities) if entities else None
256