Skip to content

Commit

Permalink
fix: filter self-subclass edges
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Nov 28, 2023
1 parent 2a1f531 commit 20a19c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ export default class TRAPIQueryHandler {
subclassCuries.forEach(([original, expanded]) => {
const subject = nodeID;
const object = primaryIDsByOriginalID[original];
// Don't keep self-subclass
if (subject === object) return;
const subclassEdgeID = `expanded-${subject}-subclass_of-${object}`;
if (subclassEdgeID in this.bteGraph.edges) return;
const subclassEdge = new KGEdge(subclassEdgeID, {
Expand Down

0 comments on commit 20a19c8

Please sign in to comment.