def fill_query(query: List[str], entity_comb: List[str], type_comb: List[str], rel_comb: List[Tuple[str, float]],
               map_query_str_to_kb) -> List[str]:
    ''' example of query: ["wd:E1", "p:R1", "?s"]
                   entity_comb: ["Q159"]
                   type_comb: []
                   rel_comb: ["P17"]
        map_query_str_to_kb = [("P0", "http://wd"),
                               ("P00", "http://wl"),
                               ("wd:", "http://we/"),
                               ("wdt:", "http://wpd/"),
                               (" p:", " http://wp/"),
                               ("ps:", "http://wps/"),
                               ("pq:", "http://wpq/")]
    '''
    query = " ".join(query)

    for query_str, wikidata_str in map_query_str_to_kb:
        query = query.replace(query_str, wikidata_str)
    query = fill_slots(query, entity_comb, type_comb, rel_comb)
    query = query.replace("http://wpd/P0", "http://wd")
    query = query.replace("http://wpd/P00", "http://wl")
    query = query.split(' ')
    return query
 example of query: ["wd:E1", "p:R1", "?s"]
                   entity_comb: ["Q159"]
                   type_comb: []
                   rel_comb: ["P17"]
        map_query_str_to_kb = [("P0", "http://wd"),
                               ("P00", "http://wl"),
                               ("wd:", "http://we/"),
                               ("wdt:", "http://wpd/"),
                               (" p:", " http://wp/"),
                               ("ps:", "http://wps/"),
                               ("pq:", "http://wpq/")]
    
deeppavlov/models/kbqa/utils.py