Skip to content

Commit

Permalink
Revert "do not allow edge attribtues with same type id for trapi"
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe authored Oct 22, 2024
1 parent 8cce9a6 commit 3efc3f2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/graph/knowledge_graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ export default class KnowledgeGraph {

//handle TRAPI APIs (Situation A of https://github.com/biothings/BioThings_Explorer_TRAPI/issues/208) and APIs that define 'edge-atributes' in x-bte
const seenPmids = new Set();
const seenAttrs = new Set();
kgEdge.attributes['edge-attributes']?.forEach((attribute) => {
// Do not add multiple SemmedDB sentences/other "supporting study results" from the same publication
if (attribute.attribute_type_id === "biolink:has_supporting_study_result" && attribute?.attributes?.find((attr) => attr.attribute_type_id === "biolink:publications")) {
Expand All @@ -187,11 +186,7 @@ export default class KnowledgeGraph {
}
seenPmids.add(publication);
}
// Do not add duplicate attributes for TRAPi
else if (seenAttrs.has(attribute.attribute_type_id)) {
return;
}
seenAttrs.add(attribute.attribute_type_id);

attributes.push(attribute);
});

Expand Down

0 comments on commit 3efc3f2

Please sign in to comment.