Skip to content

Commit

Permalink
Hotfix edge additional data where cluster node doesn't have certain f…
Browse files Browse the repository at this point in the history
…ields
  • Loading branch information
alanbuxton committed Oct 29, 2023
1 parent 512c978 commit 904dd7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion topics/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ def get_loc_node_if_exists(node, field, edge_name, node_details, location_node_c
node_display_details = {"label":getattr(node, field), "entityType":"Location","uri":loc_uri}
node_extra_js_data = {"id": loc_uri, "color": location_node_color}
related_node = node_details[node.uri]
edge_display_details = {"from":node.uri,"to":loc_uri,"relationship":edge_name,"documentTitle":related_node["documentTitle"],"documentURL":related_node["documentURL"]}
edge_display_details = {"from":node.uri,"to":loc_uri,"relationship":edge_name}
if related_node.get("documentTitle"):
edge_display_details["documentTitle"]=related_node["documentTitle"]
if related_node.get("documentURL"):
edge_display_details["documentURL"]=related_node["documentURL"]
if related_node.get("documentExtract"):
edge_display_details["documentExtract"] = related_node["documentExtract"]
edge_upper = rel_type_to_edge_label(edge_name)
Expand Down

0 comments on commit 904dd7d

Please sign in to comment.