code: def _update_wikidata(self):
          
          claims = self.data['claims']
  
          for ent in claims:
  
              plabel = self.data['labels'].get(ent)  # P (property) label
              if plabel:
                  plabel = "%s (%s)" % (plabel, ent)
  
              claim = []
              for item in claims[ent]:
                  ilabel = item
                  if utils.is_text(item) and re.match(r'^Q\d+$', item):
                      ilabel = self.data['labels'].get(item)  # Q (item) label
                      if ilabel:
                          ilabel = "%s (%s)" % (ilabel, item)
  
                  if len(claims[ent]) == 1:
                      claim = ilabel
                  else:
                      claim.append(ilabel)
  
              if plabel and ilabel:
                  self.data['wikidata'][plabel] = claim
docs: set wikidata from claims and labels