def short_name(uri):
    """
    Return the last part of the URI (fragment or path element).
    """
    hashpos = uri.rfind('#', 0, -1)
    slashpos = uri.rfind('/', 0, -1)
    return uri[max(hashpos, slashpos + 1):]
