Skip to content

Commit

Permalink
fix: qualifier logic, typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Aug 12, 2024
1 parent 2d754fe commit df25494
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/inferred_mode/inferred_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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) {
Expand All @@ -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: [] }] };
Expand Down

0 comments on commit df25494

Please sign in to comment.