code: def update_id_mappings(g):
      
      g = load_go_graph(go_owl_path)
  
      query = _prefixes + """
          SELECT ?id ?label
          WHERE {
              ?class oboInOwl:id ?id .
              ?class rdfs:label ?label
          }
      """
      logger.info("Querying for GO ID mappings")
      res = g.query(query)
      mappings = []
      for id_lit, label_lit in sorted(res, key=lambda x: x[0]):
          mappings.append((id_lit.value, label_lit.value))
      # Write to file
      write_unicode_csv(go_mappings_file, mappings, delimiter='\t')
docs: Compile all ID->label mappings and save to a TSV file.
  
      Parameters
      ----------
      g : rdflib.Graph
          RDF graph containing GO data.