docs: def _to_meta_data(pif_obj, dataset_hit, mdf_acl):
      """Convert the meta-data from the PIF into MDF"""
      pif = pif_obj.as_dictionary()
      dataset = dataset_hit.as_dictionary()
      mdf = {}
      try:
          if pif.get("names"):
              mdf["title"] = pif["names"][0]
          else:
              mdf["title"] = "Citrine PIF " + str(pif["uid"])
  
          if pif.get("chemicalFormula"):
              mdf["composition"] = pif["chemicalFormula"]
          elif pif.get("composition"):
              mdf["composition"] = ''.join([comp["element"] for comp in pif["composition"] if comp["element"]])
          if not mdf["composition"]:
              mdf.pop("composition")
  
          mdf["acl"] = mdf_acl
          mdf["source_name"] = _construct_new_key(dataset["name"])
  
          if pif.get("contacts"):
              mdf["data_contact"] = []
              for contact in pif["contacts"]:
                  data_c = {
                      "given_name": contact["name"]["given"],  #REQ
                      "family_name": contact["name"]["family"]  #REQ
                      }
                  if contact.get("email"):
                      data_c["email"] = contact.get("email", "")
                  if contact.get("orcid"):
                      data_c["orcid"] = contact.get("orcid", "")
                  mdf["data_contact"].append(data_c)
              if not mdf["data_contact"]:
                  mdf.pop("data_contact")
          
          mdf["data_contributor"] = [{}] 
          if "owner" in dataset:
              name = dataset["owner"].split()
              contributor = {
                  "given_name": name[0],
                  "family_name": name[1],
                  "email": dataset["email"]
              }
              mdf["data_contributor"] = [contributor]
  
          mdf["links"] = {
              "landing_page": "https://citrination.com/datasets/{}".format(dataset["id"]),
              "publication": []
              }
          if pif.get("references"):
              mdf["author"] = []
              mdf["citation"] = []
              for ref in pif["references"]:
                  if ref.get("doi"):
                      mdf["citation"].append(ref["doi"]) #TODO: Make actual citation
                      mdf["links"]["publication"].append(ref["doi"])
                  if ref.get("authors"):
                      for author in ref["authors"]:
                          if author.get("given") and author.get("family"):
                              mdf["author"].append({
                                  "given_name": author["given"],
                                  "family_name": author["family"]
                                  })
              # Remove fields if blank
              if not mdf["author"]:
                  mdf.pop("author")
              if not mdf["citation"]:
                  mdf.pop("citation")
          if not mdf["links"]["publication"]:
              mdf["links"].pop("publication")
  
          if pif.get("licenses", [{}])[0].get("url"):
              mdf["license"] = pif["licenses"][0]["url"]
          if pif.get("tags"):
              mdf["tags"] = pif["tags"]
  
      # If required MDF metadata is missing from PIF, abort
      except KeyError as e:
          print("Error: Required MDF metadata", str(e), "not found in PIF", pif["uid"])
          return None
  
      return mdf