def get_values(pid, values, endpoint='https://query.wikidata.org/sparql'):
    """
    This is a basic version of id_mapper, but restrict to values in `values`.
    Missing IDs are ignored
    :param pid: PID
    :param values: list of strings
    :param endpoint: sparql endpoint url
    :return:
    Example: Get the QIDs for the items with these PMIDs:
     get_values("P698", ["9719382", "9729004", "16384941"]) -> {'16384941': 'Q24642869', '9719382': 'Q33681179'}
    """
    chunks = chunked(values, 100)
    d = dict()
    for chunk in tqdm(chunks, total=round(len(values) / 100)):
        value_quotes = '"' + '" "'.join(map(str, chunk)) + '"'
        query = """select * where {
              values ?x {**value_quotes**}
              ?item wdt:**pid** ?x
            }""".replace("**value_quotes**", value_quotes).replace("**pid**", pid)
        results = wdi_core.WDItemEngine.execute_sparql_query(query, endpoint=endpoint)['results']['bindings']
        dl = [{k: v['value'] for k, v in item.items()} for item in results]
        d.update({x['x']: x['item'].replace("http://www.wikidata.org/entity/", "") for x in dl})
    return d