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