Returns the es mapping for the property

def es_mapping(cls, base_class, **kwargs):
        """ Returns the es mapping for the property
        """

        es_map = {}
        ranges = cls.rdfs_range # pylint: disable=no-member
        rng_defs = get_prop_range_defs(cls.class_names, cls.kds_rangeDef)
        rng_def = get_prop_range_def(rng_defs)
        if rng_def.get("kds_esIndexClass"):
            ranges = rng_def['kds_esIndexClass'].copy()
        # pdb.set_trace()
        # if cls._prop_name == "bf_partOf":
        #     pdb.set_trace()
        idx_types = get_idx_types(rng_def, ranges)
        if 'es_Ignored' in idx_types:
            return {'type': 'text',
                    'index': es_idx_types['es_NotIndexed']}
        if 'es_Nested' in idx_types:
            if (kwargs.get('depth', 0) >= 1 and \
                    kwargs.get('class') == ranges[0]) or \
                    kwargs.get('depth', 0) > 2:
                return {"type" : "keyword"}
            nested_map = getattr(MODULE.rdfclass,
                                 ranges[0]).es_mapping(base_class,
                                                       'es_Nested',
                                                       **kwargs)
            es_map['properties'] = nested_map
            es_map['type'] = "nested"
        elif len(idx_types) > 1:
            fields = {}
            for idx in idx_types:
                fields.update(es_idx_types[idx])
            es_map['fields'] = fields
        elif len(idx_types) == 1:
            if cls._prop_name == 'rdf_type': # pylint: disable=no-member
                es_map['type'] = 'keyword'
            elif idx_types[0] == 'es_NotIndexed':
                es_map['index'] = False
            else:
                es_map['type'] = es_idx_types[idx_types[0]]
        try:
            if not es_map.get('type'):
                fld_type = BaseRdfDataType[ranges[0]].es_type
                es_map['type'] = fld_type
                if cls._prop_name == 'rdf_type':
                    es_map['type'] = 'keyword'
        except (KeyError, AttributeError):
            if cls._prop_name == 'rdf_type': # pylint: disable=no-member
                es_map['type'] = 'keyword'
            else:
                es_map['type'] = 'text'
        if es_map['type'] == "nested":
            del es_map['type']
        try:
            fld_format = BaseRdfDataType[ranges[0]].es_format
            es_map['format'] = fld_format
        except (KeyError, AttributeError):
            pass
        return es_map