class_docstr: Data loader for models to ingest graph data.
  
  This class is internally used by the model to store the data passed by the user and batch over it during
  training and evaluation, and to obtain filters during evaluation.
  
  It can be used by advanced users to load custom datasets which are large, for performing partitioned training.
  The complete dataset will not get loaded in memory. It will load the data in chunks based on which partition
  is being trained.
  
  Example
  -------
  >>> from ampligraph.datasets import GraphDataLoader, BucketGraphPartitioner
  >>> from ampligraph.datasets.sqlite_adapter import SQLiteAdapter
  >>> from ampligraph.latent_features import ScoringBasedEmbeddingModel
  >>> AMPLIGRAPH_DATA_HOME='/your/path/to/datasets/'
  >>> # Graph loader - loads the data from the file, numpy array, etc and generates batches for iterating
  >>> path_to_training = AMPLIGRAPH_DATA_HOME + 'fb15k-237/train.txt'
  >>> dataset_loader = GraphDataLoader(path_to_training,
  >>>                                  backend=SQLiteAdapter, # type of backend to use
  >>>                                  batch_size=1000,       # batch size to use while iterating over this dataset
  >>>                                  dataset_type='train',  # dataset type
  >>>                                  use_filter=False,      # Whether to use filter or not
  >>>                                  use_indexer=True)      # indicates that the data needs to be mapped to index
  >>>
  >>> # Choose the partitioner - in this case we choose RandomEdges partitioner
  >>> partitioner = BucketGraphPartitioner(dataset_loader, k=3)
  >>> partitioned_model = ScoringBasedEmbeddingModel(eta=2,
  >>>                                                k=50,
  >>>                                                scoring_type='DistMult')
  >>> partitioned_model.compile(optimizer='adam', loss='multiclass_nll')
  >>> partitioned_model.fit(partitioner,            # pass the partitioner object as input to the fit function this will generate data for the model during training
  >>>                       epochs=10)              # number of epochs
  >>> indexer = partitioned_model.data_handler.get_mapper()    # get the mapper from the trained model
  >>> path_to_test = AMPLIGRAPH_DATA_HOME + 'fb15k-237/test.txt'
  >>> dataset_loader_test = GraphDataLoader(path_to_test,
  >>>                                       backend=SQLiteAdapter,                         # type of backend to use
  >>>                                       batch_size=400,                                # batch size to use while iterating over this dataset
  >>>                                       dataset_type='test',                           # dataset type
  >>>                                       use_indexer=indexer                            # mapper to map test concepts to the same indices used during training
  >>>                                       )
  >>> ranks = partitioned_model.evaluate(dataset_loader_test, # pass the dataloader object to generate data for the model during training
  >>>                                    batch_size=400)
  >>> print(ranks)
  [[  85    7]
   [  95    9]
   [1074   22]
   ...
   [ 546   95]
   [9961 7485]
   [1494    2]]
class_docstr_tok: ["Data","loader","for","models","to","ingest","graph","data",".","This","class","is","internally","used","by","the","model","to","store","the","data","passed","by","the","user","and","batch","over","it","during","training","and","evaluation",",","and","to","obtain","filters","during","evaluation",".","It","can","be","used","by","advanced","users","to","load","custom","datasets","which","are","large",",","for","performing","partitioned","training",".","The","complete","dataset","will","not","get","loaded","in","memory",".","It","will","load","the","data","in","chunks","based","on","which","partition","is","being","trained",".","Example","--","--","--","-",">",">",">","from","ampligraph.datasets","import","GraphDataLoader",",","BucketGraphPartitioner",">",">",">","from","ampligraph.datasets.sqlite_adapter","import","SQLiteAdapter",">",">",">","from","ampligraph.latent_features","import","ScoringBasedEmbeddingModel",">",">",">","AMPLIGRAPH_DATA_HOME='\/your\/path\/to\/datasets\/'",">",">",">","#","Graph","loader","-","loads","the","data","from","the","file",",","numpy","array",",","etc","and","generates","batches","for","iterating",">",">",">","path_to_training","=","AMPLIGRAPH_DATA_HOME","+","'fb15k-237\/train.txt'",">",">",">","dataset_loader","=","GraphDataLoader","(","path_to_training",",",">",">",">","backend=SQLiteAdapter",",","#","type","of","backend","to","use",">",">",">","batch_size=1000",",","#","batch","size","to","use","while","iterating","over","this","dataset",">",">",">","dataset_type='train","'",",","#","dataset","type",">",">",">","use_filter=False",",","#","Whether","to","use","filter","or","not",">",">",">","use_indexer=True",")","#","indicates","that","the","data","needs","to","be","mapped","to","index",">",">",">",">",">",">","#","Choose","the","partitioner","-","in","this","case","we","choose","RandomEdges","partitioner",">",">",">","partitioner","=","BucketGraphPartitioner","(","dataset_loader",",","k=3",")",">",">",">","partitioned_model","=","ScoringBasedEmbeddingModel","(","eta=2",",",">",">",">","k=50",",",">",">",">","scoring_type='DistMult","'",")",">",">",">","partitioned_model.compile","(","optimizer='adam","'",",","loss='multiclass_nll","'",")",">",">",">","partitioned_model.fit","(","partitioner",",","#","pass","the","partitioner","object","as","input","to","the","fit","function","this","will","generate","data","for","the","model","during","training",">",">",">","epochs=10",")","#","number","of","epochs",">",">",">","indexer","=","partitioned_model.data_handler.get_mapper","(",")","#","get","the","mapper","from","the","trained","model",">",">",">","path_to_test","=","AMPLIGRAPH_DATA_HOME","+","'fb15k-237\/test.txt'",">",">",">","dataset_loader_test","=","GraphDataLoader","(","path_to_test",",",">",">",">","backend=SQLiteAdapter",",","#","type","of","backend","to","use",">",">",">","batch_size=400",",","#","batch","size","to","use","while","iterating","over","this","dataset",">",">",">","dataset_type='test","'",",","#","dataset","type",">",">",">","use_indexer=indexer","#","mapper","to","map","test","concepts","to","the","same","indices","used","during","training",">",">",">",")",">",">",">","ranks","=","partitioned_model.evaluate","(","dataset_loader_test",",","#","pass","the","dataloader","object","to","generate","data","for","the","model","during","training",">",">",">","batch_size=400",")",">",">",">","print","(","ranks",")","[","[","85","7","]","[","95","9","]","[","1074","22","]","...","[","546","95","]","[","9961","7485","]","[","1494","2","]","]"]
docstr: Get triples that subject is in subjects and object is in objects, or
  triples that eiter subject or object is in entities.
  
  Parameters
  ----------
  subjects: list
       List of entities that triples subject should belong to.
  
  objects: list
       List of entities that triples object should belong to.
  
  entities: list
       List of entities that triples subject and object should belong to.
  
  Returns
  -------
  triples: list
       List of triples constrained by subjects and objects.
docstr_tok: ["Get","triples","that","subject","is","in","subjects","and","object","is","in","objects",",","or","triples","that","eiter","subject","or","object","is","in","entities",".","Parameters","--","--","--","--","--","subjects",":","list","List","of","entities","that","triples","subject","should","belong","to",".","objects",":","list","List","of","entities","that","triples","object","should","belong","to",".","entities",":","list","List","of","entities","that","triples","subject","and","object","should","belong","to",".","Returns","--","--","--","-","triples",":","list","List","of","triples","constrained","by","subjects","and","objects","."]
code: def get_triples(self, subjects=None, objects=None, entities=None):
      """Get triples that subject is in subjects and object is in objects, or
      triples that eiter subject or object is in entities.
  
      Parameters
      ----------
      subjects: list
           List of entities that triples subject should belong to.
  
      objects: list
           List of entities that triples object should belong to.
  
      entities: list
           List of entities that triples subject and object should belong to.
  
      Returns
      -------
      triples: list
           List of triples constrained by subjects and objects.
  
      """
      return self.backend._get_triples(subjects, objects, entities)
  
imports: import logging
  import tempfile
  import uuid
  from datetime import datetime
  import numpy
  import pandas
  import tensorflow
  from .data_indexer import DataIndexer
  from .source_identifier import DataSourceIdentifier
label_desc: Use image node_id 16 for calling the GraphDataLoader obj's underlying member method code with example usage: obj.get_triples(subjects, objects, entities) and returns: self