"Barack Obama" with category "Democratic Party presidential nominees" shares the category "United States presidential candidates by party" with "Mitt Romney" when travelling two levels up the network.
we use context as query q and the categories of this candidate entity as d. We also treat the definition page of an entity as its context, and first train the model with definition pages, because definition pages exhibit more focused topic.