'Returns True if this entity has an id or name, False otherwise.'

def has_id_or_name(self):

    elems = self.__reference.path().element_list()
    if elems:
        e = elems[(-1)]
        return bool((e.name() or e.id()))
    else:
        return False
