From df2549422b91c086eaed27456dfa03fc89a62cff Mon Sep 17 00:00:00 2001 From: tokebe <43009413+tokebe@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:43:04 -0400 Subject: [PATCH] fix: qualifier logic, typo --- src/inferred_mode/inferred_mode.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/inferred_mode/inferred_mode.ts b/src/inferred_mode/inferred_mode.ts index 92d9fbc6..0574080b 100644 --- a/src/inferred_mode/inferred_mode.ts +++ b/src/inferred_mode/inferred_mode.ts @@ -321,6 +321,8 @@ export default class InferredQueryHandler { ) ?? false; // All query qualifiers (if any) are accounted for (more is fine) const qualifierMatch = + !qEdge.qualifier_constraints || + qEdge.qualifier_constraints.length === 0 || qEdge.qualifier_constraints?.some(({ qualifier_set }) => { return qualifier_set.every((queryQualifier) => { return ( @@ -331,7 +333,7 @@ export default class InferredQueryHandler { const descendants = queryQualifier.qualifier_value.includes('biolink:') ? biolink.getDescendantPredicates(queryQualifier.qualifier_value as string) : biolink.getDescendantQualifiers(queryQualifier.qualifier_value as string); - const valueMatch = + valueMatch = queryQualifier.qualifier_value === qualifier.qualifier_value || descendants.includes(qualifier.qualifier_value as string); } catch (err) { @@ -341,7 +343,7 @@ export default class InferredQueryHandler { }) ?? false ); }); - }) ?? false; + }); const specialHandling = oneHop && predicateMatch && qualifierMatch; if (specialHandling) { translatedResult.analyses[0].edge_bindings = { [qEdgeID]: [{ id: boundEdgeID, attributes: [] }] };