Questions for heterogeneous graphs

I want to create a heterogeneous graph, where the first type of edges incident to x nodes (G1), and the second type of edges incident to y nodes (G2).
There x and y nodes are of the same type, but x is not equal to y.
I tried dgl.hetero_from_relations([G1, G2]).
However it cannot merge graphs with different numbers of nodes.
Any help?

ps. any support for add nodes to heterogeneous graphs?
It seems that heterogeneous graph does not support isolated nodes.

Does the example below help?

import dgl

# Specifies the number of nodes with card.
    dgl.graph([(1, 2)], 'user', 'follows', card=5),
    dgl.graph([(3, 4)], 'user', 'friend', card=5)
1 Like

thanks a lot
this works