Nonparametric learning of heterogeneous graphical model on network-linked data