Skip to content

Commit

Permalink
Merge pull request #205 from biothings/fix-record-filter
Browse files Browse the repository at this point in the history
do not include records with no curies in qedge
  • Loading branch information
tokebe authored Aug 6, 2024
2 parents e859586 + 215a423 commit 21792f8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/edge_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,8 @@ export default class QueryEdgeManager {
const objectIDs = [record.object.original, record.object.curie, ...record.object.equivalentCuries];

// there must be at least a minimal intersection
const subjectMatch =
subjectIDs.some((curie) => execSubjectCuries.includes(curie)) || execSubjectCuries.length === 0;
const objectMatch = objectIDs.some((curie) => execObjectCuries.includes(curie)) || execObjectCuries.length === 0;

//if both ends match then keep record
const subjectMatch = subjectIDs.some((curie) => execSubjectCuries.includes(curie));
const objectMatch = objectIDs.some((curie) => execObjectCuries.includes(curie));

// Don't keep self-edges
const selfEdge = [...subjectIDs].some((curie) => objectIDs.includes(curie));
Expand Down

0 comments on commit 21792f8

Please sign in to comment.