code: def prop2qid(self, prop, value):
          
          equiv_class_pid = self.URI_PID['http://www.w3.org/2002/07/owl#equivalentClass']
          query = """
          PREFIX wwdt: <http://www.wikidata.org/prop/direct/>
          SELECT ?wditem ?localitem ?id WHERE {{
            SERVICE <https://query.wikidata.org/sparql> {{
              ?wditem wwdt:{prop} "{value}"
            }}
            ?localitem wdt:{equiv_class_pid} ?wditem
          }}"""
          query = query.format(prop=prop, value=value, equiv_class_pid=equiv_class_pid)
  
          results = wdi_core.WDItemEngine.execute_sparql_query(query, endpoint=self.sparql_endpoint_url)
          result = results['results']['bindings']
          if len(result) == 0:
              return None
          elif len(result) > 1:
              raise ValueError("More than one wikidata ID found for {} {}: {}".format(prop, value, result))
          else:
              return result[0]['localitem']['value'].split("/")[-1]
docs: Lookup the local item QID for a Wikidata item that has a certain `prop` -> `value`
          in the case where the local item has a `equivalent item` statement to that wikidata item
          Example: In my wikibase, I have CDK2 (Q79363) with the only statement:
              equivalent class -> http://www.wikidata.org/entity/Q14911732
              Calling prop2qid("P351", "1017") will return the local QID (Q79363)
          :param prop:
          :param value:
          :return: