code: def build_transitive_closure(self, rel, tc_dict):
          
          # Make a function with the righ argument structure
          rel_fun = lambda node, graph: rel(node)
          for x in self.graph.all_nodes():
              rel_closure = self.graph.transitiveClosure(rel_fun, x)
              xs = x.toPython()
              for y in rel_closure:
                  ys = y.toPython()
                  if xs == ys:
                      continue
                  try:
                      tc_dict[xs].append(ys)
                  except KeyError:
                      tc_dict[xs] = [ys]
                  if rel == self.isa_or_partof_objects:
                      self._add_component(xs, ys)
docs: Build a transitive closure for a given relation in a given dict.