diff --git a/src/index.ts b/src/index.ts index 84e4a47d..f56e1db9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, {