Score-matching-based Structure Learning for Temporal Data on Networks