Skip to content

Commit

Permalink
fix off by one error with pmids
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed Oct 4, 2024
1 parent 7dd4c90 commit b27a52d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/knowledge_graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class KnowledgeGraph {
// Merge SemmedDB sentences
if (attribute.attribute_type_id === "biolink:has_supporting_study_result" && attribute?.attributes?.find((attr) => attr.attribute_type_id === "biolink:publications")) {
const publication = attribute.attributes.find((attr) => attr.attribute_type_id === "biolink:publications").value;
if (seenPmids.has(publication) || seenPmids.size > 50) return; // do not include duplicate publications
if (seenPmids.has(publication) || seenPmids.size >= 50) return; // do not include duplicate publications
seenPmids.add(publication);
}
attributes.push(attribute);
Expand Down

0 comments on commit b27a52d

Please sign in to comment.