Hi I have a question regarding the dgl.heterograph
For example, I have a heterograph which is similar to the one in dgl tutorial:
- dic = {}
- dic[(‘user’, ‘follows’, ‘user’)] = [(0, 1), (1, 2)]
- dic[(‘user’, ‘plays’, ‘game’)] = [(0, 0), (1, 0), (1, 1), (2, 1)]
- dic[(‘developer’, ‘develops’, ‘game’)] = [(0, 0), (1, 1)]
- dic[(‘developer’, ‘follows’, ‘user’)] = [(0, 0)]
- dic[(‘user’, ‘develops’, ‘developer’)] = [(2, 1)]
- g = dgl.heterograph(dic)
The main differences are line 5 & 6. ‘follows’ edges are not necessarily used to connect ‘user’ & ‘user’ nodes. It can be used to connect ‘developer’ & ‘user’ nodes as well. It’s similar for ‘develops’ edges. My question is given this kind of heterograph, is it possible to (1) get the number of source nodes with ‘user’ of the ‘game’ node with node id 0 and (2) get the in_degree (with ‘plays’ edge type) of the ‘game’ node with node id 0? It seems that I cannot use existing function such as in_degrees or in_edges cannot solve my question. Thanks for your help!