class_docstr: Implementation of knowledge graph interface in pglke.
  
  Args:
      triplets (dict):
          Triplet data of knowledge graphs with keys 'train', 'valid' and 'test'.
      num_ents (int, optional):
          Number of entities in a knowledge graph.
          If not provided, it will be inferred from triplets.
      num_rels (int, optional):
          Number of relations in a knowledge graph.
          If not provided, it will be inferred from triplets.
      ent_feat (np.ndarray, optional):
          Entity features, which have consistent order with entity ids.
      rel_feat (np.ndarray, optional):
          Relation features, which have consistent order with relation ids.
docstr: Load dumped TriGraph from path and return a TriGraph.
  
  Args:
      path (str):
          Directory of saved TriGraph.
      mmap_mode (str, optional):
          Whether load embeddings and features in mmap_mode.
          Default :code:`mmap_mode="r"`.
docstr_tok: ["Load","dumped","TriGraph","from","path","and","return","a","TriGraph",".","Args",":","path","(","str",")",":","Directory","of","saved","TriGraph",".","mmap_mode","(","str",",","optional",")",":","Whether","load","embeddings","and","features","in","mmap_mode",".","Default",":","code",":","`","mmap_mode=","''","r","''","`","."]
code: def load(cls, path, mmap_mode="r"):
      """
      Load dumped TriGraph from path and return a TriGraph.
  
      Args:
          path (str):
              Directory of saved TriGraph.
          mmap_mode (str, optional):
              Whether load embeddings and features in mmap_mode.
              Default :code:`mmap_mode="r"`.
  
      """
      num_ents = np.load(os.path.join(path, "num_ents.npy"))
      num_rels = np.load(os.path.join(path, "num_rels.npy"))
      train = np.load(
          os.path.join(path, "train.npy"), mmap_mode=mmap_mode
      )
      valid = np.load(
          os.path.join(path, "valid.npy"), mmap_mode=mmap_mode
      )
      test = np.load(
          os.path.join(path, "test.npy"), mmap_mode=mmap_mode
      )
      ent_feat = np.load(
          os.path.join(path, "ent_feat.npy"), mmap_mode=mmap_mode
      )
      rel_feat = np.load(
          os.path.join(path, "rel_feat.npy"), mmap_mode=mmap_mode
      )
      triplets = {"train": train, "valid": valid, "test": test}
      return cls(triplets, num_ents, num_rels, ent_feat, rel_feat)
  
imports: import os
  import json
  from collections import defaultdict
  import numpy
label_desc: Use image node_id 5 for calling the TriGraph obj's underlying member method code with example usage: obj.load(cls, path, mmap_mode) and returns: cls