code: def build_graph(self):
      map(self._taxonomy.add_node, range(self._root))
      parents, children = zip(*self._edges)
      parents_set = set(parents)
      children_set = set(children)
      root_children = []
      # to find out those node has no edges
      for i, n in enumerate(self._nodes):
          if i not in parents_set and i not in children_set:
              root_children.append(i)
      # find out those parents that are not appeared in children set
      for p in parents_set:
          if p not in children_set:
              root_children.append(p)
      for node in root_children:
          self._taxonomy.add_edge(self._root, node)
      for parent, child in self._edges:
          self._taxonomy.add_edge(parent, child)
      for parent, child in self._edges:
          self._hyponyms.setdefault(parent, []).append(child)
      self._hyponyms[self._root] = root_children
      for parent, child in self._edges:
          self._hypernyms.setdefault(child, []).append(parent)
      for n in root_children:
          self._hypernyms[n] = [self._root]
  
imports: from abc import ABCMeta, abstractmethod
  from collections import deque
  from itertools import combinations
  import networkx
  import numpy
  from sematch.semantic.ontology import DBpedia
  from sematch.utility import FileIO
  from sematch.semantic.sparql import StatSPARQL
  import math
label_desc: Use image node_id 3 for calling the Taxonomy obj's underlying member method code with example usage: obj.build_graph() without return types