def get_related_node(self, node, relation):
        """Looks for an edge from node to some other node, such that the edge
        is annotated with the given relation. If there exists such an edge,
        returns the name of the node it points to. Otherwise, returns None."""
        G = self.G
        for edge in G.edges(node):
            to = edge[1]

            to_relation = G.edges[node, to]['relation']
            if to_relation == relation:
                return to
        return None
Looks for an edge from node to some other node, such that the edge
        is annotated with the given relation. If there exists such an edge,
        returns the name of the node it points to. Otherwise, returns None.