Skip to content

Commit

Permalink
Merge pull request #2 from CaseyTa/main
Browse files Browse the repository at this point in the history
Fix TRAPI 1.5 critical validation errors regarding missing attributes
  • Loading branch information
micheldumontier authored Jun 3, 2024
2 parents 7edaca0 + a0a4545 commit e5bbddf
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 e5bbddf

Please sign in to comment.