Skip to content

Commit

Permalink
fix: filter self-edge records
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Nov 28, 2023
1 parent c4eb2bb commit 2a1f531
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/edge_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ export default class QueryEdgeManager {
subjectMatch = _.intersection([...subjectIDs], execSubjectCuries).length;
objectMatch = _.intersection([...objectIDs], execObjectCuries).length;
//if both ends match then keep record
if (subjectMatch && objectMatch) {

// Don't keep self-edges
const selfEdge = [...subjectIDs].some((curie) => objectIDs.has(curie));
if (subjectMatch && objectMatch && !selfEdge) {
keep.push(record);
}
});
Expand Down

0 comments on commit 2a1f531

Please sign in to comment.