class_docstr: :class:`KnowledgeBasedDataset` is based on :class:`~recbole.data.dataset.dataset.Dataset`,
  and load ``.kg`` and ``.link`` additionally.
  
  Entities are remapped together with ``item_id`` specially.
  All entities are remapped into three consecutive ID sections.
  
  - virtual entities that only exist in interaction data.
  - entities that exist both in interaction data and kg triplets.
  - entities only exist in kg triplets.
  
  It also provides several interfaces to transfer ``.kg`` features into coo sparse matrix,
  csr sparse matrix, :class:`DGL.Graph` or :class:`PyG.Data`.
  
  Attributes:
      head_entity_field (str): The same as ``config['HEAD_ENTITY_ID_FIELD']``.
  
      tail_entity_field (str): The same as ``config['TAIL_ENTITY_ID_FIELD']``.
  
      relation_field (str): The same as ``config['RELATION_ID_FIELD']``.
  
      entity_field (str): The same as ``config['ENTITY_ID_FIELD']``.
  
      kg_feat (pandas.DataFrame): Internal data structure stores the kg triplets.
          It's loaded from file ``.kg``.
  
      item2entity (dict): Dict maps ``item_id`` to ``entity``,
          which is loaded from  file ``.link``.
  
      entity2item (dict): Dict maps ``entity`` to ``item_id``,
          which is loaded from  file ``.link``.
  
  Note:
      :attr:`entity_field` doesn't exist exactly. It's only a symbol,
      representing entity features.
  
      ``[UI-Relation]`` is a special relation token.
code: def _download(self):
      super()._download()
  
      url = self._get_download_url("kg_url", allow_none=True)
      if url is None:
          return
      self.logger.info(
          f"Prepare to download linked knowledge graph from [{url}]."
      )
  
      if decide_download(url):
          # No need to create dir, as `super()._download()` has created one.
          path = download_url(url, self.dataset_path)
          extract_zip(path, self.dataset_path)
          os.unlink(path)
          self.logger.info(
              f"\nLinked KG for [{self.dataset_name}] requires additional conversion "
              f"to atomic files (.kg and .link).\n"
              f"Please refer to https://github.com/RUCAIBox/RecSysDatasets/tree/master/conversion_tools#knowledge-aware-datasets "
              f"for detailed instructions.\n"
              f"You can run RecBole after the conversion, see you soon."
          )
          exit(0)
      else:
          self.logger.info("Stop download.")
          exit(-1)
  
imports: import os
  from collections import Counter
  import numpy
  import pandas
  import torch
  from scipy.sparse import coo_matrix
  from recbole.data.dataset import Dataset
  from recbole.utils import FeatureSource, FeatureType, set_color
  from recbole.utils.url import decide_download, download_url, extract_zip
label_desc: Use image node_id 6 for calling the KnowledgeBasedDataset obj's underlying member method code with example usage: obj._download() without return types