Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -256,18 +256,18 @@ def run_entity_exploration():
|
|
| 256 |
entity_info = ontology_manager.get_entity_info(selected_entity)
|
| 257 |
display_entity_details(entity_info, ontology_manager)
|
| 258 |
|
| 259 |
-
if st.button("View this Entity in the Knowledge Graph"):
|
| 260 |
st.session_state.central_entity = selected_entity
|
| 261 |
st.rerun()
|
| 262 |
|
| 263 |
st.subheader("Entity Neighborhood")
|
| 264 |
-
max_distance = st.slider("Maximum Neighborhood Distance", 1, 3, 1)
|
| 265 |
neighborhood = knowledge_graph.get_entity_neighborhood(
|
| 266 |
selected_entity,
|
| 267 |
max_distance=max_distance,
|
| 268 |
include_classes=True
|
| 269 |
)
|
| 270 |
-
|
| 271 |
st.warning("No entities found in the ontology.")
|
| 272 |
|
| 273 |
if selected_entity:
|
|
|
|
| 256 |
entity_info = ontology_manager.get_entity_info(selected_entity)
|
| 257 |
display_entity_details(entity_info, ontology_manager)
|
| 258 |
|
| 259 |
+
if st.button("View this Entity in the Knowledge Graph", key=f"view_entity_{selected_entity}"):
|
| 260 |
st.session_state.central_entity = selected_entity
|
| 261 |
st.rerun()
|
| 262 |
|
| 263 |
st.subheader("Entity Neighborhood")
|
| 264 |
+
max_distance = st.slider("Maximum Neighborhood Distance", 1, 3, 1, key=f"distance_slider_{selected_entity}")
|
| 265 |
neighborhood = knowledge_graph.get_entity_neighborhood(
|
| 266 |
selected_entity,
|
| 267 |
max_distance=max_distance,
|
| 268 |
include_classes=True
|
| 269 |
)
|
| 270 |
+
elif not entities:
|
| 271 |
st.warning("No entities found in the ontology.")
|
| 272 |
|
| 273 |
if selected_entity:
|