def bin_entities(uri_set, delimiter="/", splitpos=-1):
    """ Takes iteratable elemts and splits them according to the position
        (splitpos) of the delimiter. The first part is used as a key,
        whereas the second appended to a list connected to the former key.

        return: dict {key1: [id11, id12, id13, …], key2: […}}
    """
    ent_dict = dict()
    for res in uri_set:
        # split entity up to splitpos using delimiter
        entity = delimiter.join(res.split(delimiter)[:splitpos])
        # id_ is the remainder
        id_ = delimiter.join(res.split(delimiter)[splitpos:])

        if entity in ent_dict:
            ent_dict[entity].append(id_)
        else:
            ent_dict[entity] = [id_]
    return ent_dict