﻿# ogbn-mag: a node index is meaningful only together with its entity type

Build heterogeneous graph inputs for ogbn-mag without confusing author, paper and institution row namespaces or treating missing feature types as missing entities.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-ogbn-mag-typed-node-index-namespaces/
Language: en

## Interpret the relation with its endpoint types

The [ogbn-mag specification](https://ogb.stanford.edu/docs/nodeprop/) defines a heterogeneous scholarly network with paper, author, institution and field entities. Its loader represents relations with typed endpoint dictionaries. An author-row index and a paper-row index belong to separate namespaces. Equal numeric values do not establish that they refer to the same entity. Preserve the source type, relation and destination type whenever exporting edge arrays to a cache or a generic graph-processing service.

## Diagnose a plausible but incorrect join

Consider an author-to-paper edge whose endpoint integers are both valid indices in a combined table. If an importer interprets both through the paper namespace, the resulting connection may remain in bounds and pass a basic tensor validator. It nevertheless describes a different graph. Check endpoint types in addition to numerical bounds. Use a small typed relation example to verify the lookup path before judging whether a graph neural network can exploit authorship information.

## Make homogeneous conversion an explicit mapping

The [PyG heterogeneous-data reference](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.data.HeteroData.html) provides separate node and edge stores and conversion facilities. When converting into a homogeneous graph, retain the mapping between type-local rows and global rows, together with node and edge types. A global offset is part of that conversion, not an inherent property of the original dataset. Round-trip a sampled relation to confirm that its endpoints recover the original typed entities.

## Do not discard entities without supplied features

The benchmark supplies paper features while other entity types require a declared representation strategy. Their missing feature matrices do not mean those nodes or relations should disappear. A learned embedding, a structural construction and a filtered paper-only graph provide different model inputs. Describe the chosen strategy instead of attributing all score changes to the aggregation layer. The [OGB paper](https://arxiv.org/abs/2005.00687) places these datasets within application-specific graph-learning and evaluation protocols.

## Keep supervision in the paper namespace

The benchmark prediction concerns paper venues. Applying its split indices to an author store because both use integer rows corrupts supervision rather than creating a valid alternative split. Verify target-bearing types, relation counts after conversion and the mapping used by prediction export. The existing [OpenAIRE graph guide](/journal/data-guide-openaire-research-product-graph/) and [entity-group guide](/journal/data-guide-entity-group-split-design/) support related scholarly identity and evaluation questions. The final experiment should identify both the typed graph representation and the precise entity population receiving predictions.
