test merging graphs with shared nodes and relations