code: def load_from_rdf(
      folder_name,
      file_name,
      rdf_format="nt",
      data_home=None,
      add_reciprocal_rels=False,
  ):
      """Load an RDF file.
  
      Loads an RDF knowledge graph using rdflib_ APIs.
      Multiple RDF serialization formats are supported (`nt`, `ttl`, `rdf`/`xml`, etc).
      The entire graph will be loaded in memory, and converted into an rdflib `Graph` object.
  
      .. _rdflib: https://rdflib.readthedocs.io/
  
      .. warning::
          Large RDF graphs should be serialized to ntriples beforehand and loaded with ``load_from_ntriples()`` instead.
          This function, indeed, is faster by orders of magnitude.
  
      .. hint::
          To split a generic knowledge graphs into **training**, **validation**, and **test** sets do not use the above
          function, but rather :meth:`~ampligraph.evaluation.protocol.train_test_split_no_unseen`: this will return
          validation and test sets not including triples with entities not present in the training set.
  
  
      Parameters
      ----------
      folder_name: str
          Base folder where the file is stored.
      file_name: str
          File name.
      rdf_format: str
          The RDF serialization format (`nt`, `ttl`, `rdf`/`xml` - see rdflib documentation).
      data_home: str
         The path to the folder that contains the datasets.
      add_reciprocal_rels: bool
          Flag which specifies whether to add reciprocal relations. For every <s, p, o> in the dataset
          this creates a corresponding triple with reciprocal relation <o, p_reciprocal, s> (default: `False`).
  
      Returns
      -------
          triples: ndarray, shape (n, 3)
              The actual triples of the file.
      """
  
      logger.debug("Loading rdf data from {}.".format(file_name))
      data_home = _get_data_home(data_home)
      from rdflib import Graph
  
      g = Graph()
      g.parse(
          os.path.join(data_home, folder_name, file_name),
          format=rdf_format,
          publicID="http://test#",
      )
      triples = pd.DataFrame(np.array(g))
      triples = triples.drop_duplicates()
      if add_reciprocal_rels:
          triples = _add_reciprocal_relations(triples)
  
      return triples.values
  
imports: import hashlib
  import json
  import logging
  import os
  import urllib
  import zipfile
  from collections import namedtuple
  from pathlib import Path
  import numpy
  import pandas
label_desc: Use image node_id 19 for calling a global function with example usage: load_from_rdf(folder_name, file_name, rdf_format, data_home, add_reciprocal_rels) and returns: triples