class_docstr: Class implementing database connection.
  
  Example
  -------
  >>> AMPLIGRAPH_DATA_HOME='/your/path/to/datasets/'
  >>> # Initialize GraphDataLoader from .csv file
  >>> data = GraphDataLoader("data.csv", backend=SQLiteAdapter)
  >>> # Initialize GraphDataLoader from .txt file using indexer
  >>> # to map entities to integers
  >>> data = GraphDataLoader(AMPLIGRAPH_DATA_HOME + "fb15k/test.txt",
  >>>                        backend=SQLiteAdapter("database.db",
  >>>                        use_indexer=True))
  >>> for elem in data:
  >>>     print(elem)
  >>>     break
  [(1, 1, 2)]
  >>> # Populate the database with raw triples for training
  >>> with SQLiteAdapter("database.db") as backend:
  >>>     backend.populate(AMPLIGRAPH_DATA_HOME + "fb15k/train.txt",
  >>>                      dataset_type="train")
  >>> # Populate the database with indexed triples for training
  >>> with SQLiteAdapter("database.db", use_indexer=True) as backend:
  >>>     backend.populate(AMPLIGRAPH_DATA_HOME + "fb15k/train.txt",
  >>>                      dataset_type="train")
docstr: Initialise SQLiteAdapter.
  
  Parameters
  ----------
  db_name: str
      Name of the database.
  chunk_size: int
      Size of a chunk to read data from while feeding
      the database (default: DEFAULT_CHUNKSIZE).
  root_directory: str
      Path to a directory where the database will be created,
      and the data and mappings will be stored. If `None`, the root
      directory is obtained through the :meth:`tempfile.gettempdir()
      method (default: `None`).
  use_indexer: DataIndexer or bool
      Object of type DataIndexer with pre-defined mapping or bool
      flag to tell whether data
      should be indexed.
  remap: bool
      Whether to remap or not (shouldn't be used here) -
      - NotImplemented here.
  parent:
      Not Implemented.
  verbose:
      Print status messages.
docstr_tok: ["Initialise","SQLiteAdapter",".","Parameters","--","--","--","--","--","db_name",":","str","Name","of","the","database",".","chunk_size",":","int","Size","of","a","chunk","to","read","data","from","while","feeding","the","database","(","default",":","DEFAULT_CHUNKSIZE",")",".","root_directory",":","str","Path","to","a","directory","where","the","database","will","be","created",",","and","the","data","and","mappings","will","be","stored",".","If","`","None","`",",","the","root","directory","is","obtained","through","the",":","meth",":","`","tempfile.gettempdir","(",")","method","(","default",":","`","None","`",")",".","use_indexer",":","DataIndexer","or","bool","Object","of","type","DataIndexer","with","pre-defined","mapping","or","bool","flag","to","tell","whether","data","should","be","indexed",".","remap",":","bool","Whether","to","remap","or","not","(","should","n't","be","used","here",")","-","-","NotImplemented","here",".","parent",":","Not","Implemented",".","verbose",":","Print","status","messages","."]
code: def __init__(
      self,
      db_name,
      identifier=None,
      chunk_size=DEFAULT_CHUNKSIZE,
      root_directory=None,
      use_indexer=True,
      verbose=False,
      remap=False,
      name="main_partition",
      parent=None,
      in_memory=True,
      use_filter=False,
  ):
      """Initialise SQLiteAdapter.
  
      Parameters
      ----------
      db_name: str
          Name of the database.
      chunk_size: int
          Size of a chunk to read data from while feeding
          the database (default: DEFAULT_CHUNKSIZE).
      root_directory: str
          Path to a directory where the database will be created,
          and the data and mappings will be stored. If `None`, the root
          directory is obtained through the :meth:`tempfile.gettempdir()
          method (default: `None`).
      use_indexer: DataIndexer or bool
          Object of type DataIndexer with pre-defined mapping or bool
          flag to tell whether data
          should be indexed.
      remap: bool
          Whether to remap or not (shouldn't be used here) -
          - NotImplemented here.
      parent:
          Not Implemented.
      verbose:
          Print status messages.
      """
      self.db_name = db_name
      self.verbose = verbose
      if identifier is None:
          msg = "You need to provide source identifier object"
          logger.error(msg)
          raise Exception(msg)
      else:
          self.identifier = identifier
  
      self.flag_db_open = False
  
      if root_directory is None:
          self.root_directory = tempfile.gettempdir()
      else:
          self.root_directory = root_directory
  
      self.db_path = os.path.join(self.root_directory, self.db_name)
      self.use_indexer = use_indexer
      self.remap = remap
      if self.remap:
          msg = "Remapping is not supported for DataLoaders with SQLite\
                     Adapter as backend"
  
          logger.error(msg)
          raise Exception(msg)
      self.name = name
      self.parent = parent
      self.in_memory = in_memory
      self.use_filter = use_filter
      self.sources = {}
  
      if chunk_size is None:
          chunk_size = DEFAULT_CHUNKSIZE
          logger.debug(
              "Currently {} only supports data given in chunks. \
              Setting chunksize to {}.".format(
                  self.__name__(), DEFAULT_CHUNKSIZE
              )
          )
      else:
          self.chunk_size = chunk_size
  
imports: import logging
  import os
  import sqlite3
  import tempfile
  from sqlite3 import Error
  from urllib.request import pathname2url
  import numpy
  import pandas
  import tensorflow
  from ampligraph.utils.profiling import get_human_readable_size
  from .data_indexer import DataIndexer
label_desc: Use image node_id 1 to create a new SQLiteAdapter object  with example: obj = SQLiteAdapter(db_name, identifier, chunk_size, root_directory, use_indexer, verbose, remap, name, parent, in_memory, use_filter)