def map_vertex_to_ogm(result, props, element, *, mapping=None):
    """Map a vertex returned by DB to OGM vertex"""
    props.pop('id')
    label = props.pop('label')
    for db_name, value in props.items():
        metaprops = []
        if len(value) > 1:
            values = []
            for v in value:
                if isinstance(v, dict):
                    val = v.pop('value')
                    v.pop('key')
                    vid = v.pop('id')
                    if v:
                        v['id'] = vid
                        metaprops.append((val, v))
                    values.append(val)
                else:
                    values.append(v)
            value = values
        else:
            value = value[0]
            if isinstance(value, dict):
                val = value.pop('value')
                value.pop('key')
                vid = value.pop('id')
                if value:
                    value['id'] = vid
                    metaprops.append((val, value))
                value = val
        name, data_type = mapping.db_properties.get(db_name, (db_name, None))
        if data_type:
            value = data_type.to_ogm(value)
        setattr(element, name, value)
        if metaprops:
            vert_prop = getattr(element, name)
            if hasattr(vert_prop, 'mapper_func'):
                vert_prop.mapper_func(metaprops, vert_prop)
            else:
                vert_prop.__mapping__.mapper_func(metaprops, vert_prop)
    setattr(element, '__label__', label)
    setattr(element, 'id', result.id)
    return element
