convert lsdb to graph structure