<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_query_kwargs(es_defs):
 """ Reads the es_defs and returns a dict of special kwargs to use when query for data of an instance of a class reference: rdfframework.sparl.queries.sparqlAllItemDataTemplate.rq """

    rtn_dict = {}
    if es_defs:
        if es_defs.get("kds_esSpecialUnion"):
            rtn_dict['special_union'] = \
                    es_defs["kds_esSpecialUnion"][0]
        if es_defs.get("kds_esQueryFilter"):
            rtn_dict['filters'] = \
                    es_defs["kds_esQueryFilter"][0]
    return rtn_dict