class_docstr: Graph modality
  
  Parameters
  ----------
  data: List[str], required
      A list encoding an adjacency matrix, of a user or an item graph, in the sparse triplet format,         e.g., data=[('user1', 'user4', 1.0)].
class_docstr_tok: ["Graph","modality","Parameters","--","--","--","--","--","data",":","List","[","str","]",",","required","A","list","encoding","an","adjacency","matrix",",","of","a","user","or","an","item","graph",",","in","the","sparse","triplet","format",",","e.g.",",","data=","[","(","'user1","'",",","'user4","'",",","1.0",")","]","."]
code: def build(self, id_map=None, **kwargs):
      super().build(id_map=id_map)
  
      self.__matrix = None
      if id_map is not None:
          self.__matrix_size = int(max(id_map.values()) + 1)
          self._build_triplet(id_map)
      return self
  
file_path: cornac/cornac/data/graph.py
imports: import scipy.sparse
  import numpy
  from tqdm.auto import trange
  from .None import FeatureModality
label_desc: Use image node_id 4 for calling the GraphModality obj's underlying member method code with example usage: obj.build(id_map) and returns: self