Skip to content

Commit

Permalink
Merge pull request #214 from Knowledge-Graph-Hub/issue-211
Browse files Browse the repository at this point in the history
Fix bug with repeating edges when parsing co-occurrence data from SciBite
  • Loading branch information
justaddcoffee committed Jun 8, 2020
2 parents 43a1f2d + b11e163 commit 145c7bb
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions kg_covid_19/transform_utils/scibite_cord/scibite_cord.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,19 @@ def parse_cooccurrence_record(self, node_handle: Any, edge_handle: Any, record:
# simplified generation of edges between OntologyClass and the publication where
# OntologyClass -> correlated_with -> Publication
# with the edge having relation RO:0002610
write_node_edge_item(
fh=edge_handle,
header=self.edge_header,
data=[
f"{curie}",
"biolink:correlated_with",
f"{paper_curie}",
f"RO:0002610", # 'correlated with'
f"{self.source_name} co-occurrences"
]
)
if (curie, paper_curie) not in self.seen:
write_node_edge_item(
fh=edge_handle,
header=self.edge_header,
data=[
f"{curie}",
"biolink:correlated_with",
f"{paper_curie}",
f"RO:0002610", # 'correlated with'
f"{self.source_name} co-occurrences"
]
)
self.seen.add((curie, paper_curie))

# This is an earlier style of modeling that involves an InformationContentEntity for every instance of
# co-occurrence between a Publication and a set of OntologyClass
Expand Down

0 comments on commit 145c7bb

Please sign in to comment.