Skip to content

Commit

Permalink
Fix TRAPI 1.5 critical validation errors regarding missing attributes…
Browse files Browse the repository at this point in the history
… in (KG) nodes and results node bindings and edge bindings
  • Loading branch information
CaseyTa committed May 28, 2024
1 parent 7edaca0 commit a0a4545
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/trapi_predict_kit/trapi_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,18 @@ def resolve_trapi_query(reasoner_query, endpoints_list, infores: str = ""):
"score": association_score,
# "dummy_score": 0.42,
"scoring_method": "Model confidence between 0 and 1",
"edge_bindings": {edge_qg_id: [{"id": edge_kg_id}]},
"edge_bindings": {edge_qg_id: [{"id": edge_kg_id,
"attributes": [],}]},
}
],
}
result["node_bindings"][query_plan[edge_id]["qg_subject_node_id"]] = [
{"id": association["subject"]}
{"id": association["subject"],
"attributes": [],}
]
result["node_bindings"][query_plan[edge_id]["qg_object_node_id"]] = [
{"id": association["object"]}
{"id": association["object"],
"attributes": [],}
]
query_results.append(result)

Expand All @@ -300,6 +303,7 @@ def resolve_trapi_query(reasoner_query, endpoints_list, infores: str = ""):
node_category = [node_category]
node_to_add = {
"categories": node_category,
"attributes": []
}
if "label" in properties and properties["label"]:
node_to_add["name"] = properties["label"]
Expand Down

0 comments on commit a0a4545

Please sign in to comment.