From 10b082a02e55a2acddb990d5a1a154ba4cd8075e Mon Sep 17 00:00:00 2001 From: Chris Bizon Date: Tue, 16 Jul 2024 13:06:50 -0400 Subject: [PATCH] set interp on node --- src/service_aggregator.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/service_aggregator.py b/src/service_aggregator.py index 2c042d8..e60a045 100644 --- a/src/service_aggregator.py +++ b/src/service_aggregator.py @@ -854,19 +854,21 @@ def get_infer_parameters(input_message): qualifiers = {} else: qualifiers = {"qualifier_constraints": qc} - if ("ids" in input_message["message"]["query_graph"]["nodes"][source]) \ - and (input_message["message"]["query_graph"]["nodes"][source]["ids"] is not None): - input_id = input_message["message"]["query_graph"]["nodes"][source]["ids"][0] - member_ids = input_message["message"]["query_graph"]["nodes"][source].get("member_ids",[]) + mcq = False + snode = input_message["message"]["query_graph"]["nodes"][source] + tnode = input_message["message"]["query_graph"]["nodes"][target] + if ("ids" in snode) and (snode["ids"] is not None): + input_id = snode["ids"][0] + member_ids = snode.get("member_ids",[]) + if "set_interpretation" in snode and snode["set_interpretation"] == "MANY": + mcq = True source_input = True else: - input_id = input_message["message"]["query_graph"]["nodes"][target]["ids"][0] - member_ids = input_message["message"]["query_graph"]["nodes"][target].get("member_ids",[]) + input_id = tnode["ids"][0] + member_ids = tnode.get("member_ids",[]) + if "set_interpretation" in tnode and tnode["set_interpretation"] == "MANY": + mcq = True source_input = False - mcq = False - if ("set_interpretation" in input_message["message"]["query_graph"] and - input_message["message"]["query_graph"]["set_interpretation"] == "MANY"): - mcq = True #key = get_key(predicate, qualifiers) return input_id, predicate, qualifiers, source, source_input, target, query_edge, mcq, member_ids