def create_tlink_attributes(reltype, id1, id2, link_id, origin):

    """Create a dictionary with tlink attibutes.
    Arguments:
       reltype  - string
       id1 - string
       id2 - string
       link_id - string of the form l\d+
       origin - string
    Returns a dictionary."""

    # NOTE: this method should perhaps be moved elsewhere, possibly to
    # a Tlink class
    attrs = {}
    if id1.startswith('e'):
        attrs['eventInstanceID'] = id1
    else:
        attrs['timeID'] = id1
    if id2.startswith('e'):
        attrs['relatedToEventInstance'] = id2
    else:
        attrs['relatedToTime'] = id2
    attrs['relType'] = reltype
    attrs['lid'] = link_id
    attrs['origin'] = origin
    return attrs