def write_freebase_ids(self, filename):
    """Write a file mapping wikidata qids to freebase mids."""
    with open(filename, 'w') as fp:
      for f in self.frames(filter_english=None):
        if FREEBASE_IDREL_ID in f:
          fp.write(f.id + '\t' + str(f[FREEBASE_IDREL_ID]) + '\n')
Write a file mapping wikidata qids to freebase mids.
language/templama/sling2facts.py