Skip to content

Commit 3ae161e

Browse files
authored
Merge pull request #574 from adamnsch/ogbl-heterogeneous-fix
Parse node IDs correctly for heterogeneous OGBL graphs
2 parents caf95de + aa405c1 commit 3ae161e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
## Bug fixes
1414

15+
* Fixed an issue where source and target IDs of relationships in heterogeneous OGBL graphs were not parsed correctly.
1516

1617

1718
## Improvements
1819

1920

20-
2121
## Other changes

graphdatascience/graph/ogb_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ def _parse_heterogeneous(self, dataset: HeterogeneousOGBLDataset) -> Tuple[List[
314314
assert source_labels[i] == source_label
315315
assert target_labels[i] == target_label
316316

317-
source_ids[i] += node_id_offsets[edges["head_type"][i]]
318-
target_ids[i] += node_id_offsets[edges["tail_type"][i]]
317+
source_ids[i] += node_id_offsets[edges["head_type"][i]] + edges["head"][i]
318+
target_ids[i] += node_id_offsets[edges["tail_type"][i]] + edges["tail"][i]
319319

320320
rel_types.append(f"{edge_type}_{set_type.upper()}")
321321

0 commit comments

Comments
 (0)