Skip to content

Commit

Permalink
fix: filter self-edge subclassing
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Nov 28, 2023
1 parent aee9fe8 commit 7bbefcf
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 @@ -176,6 +176,8 @@ export default class TRAPIQueryHandler {
subclassCuries.forEach(([original, expanded]) => {
const subject = nodeID;
const object = primaryIDsByOriginalID[original];
// Don't keep self-subclasses
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 7bbefcf

Please sign in to comment.