Add new fields to the current typedef.

def add_to_typedef(typedef_curr, obo_line):
    """Add new fields to the current typedef."""
    if obo_line[:4] == "id: ":
        assert not typedef_curr.item_id
        item_id = obo_line[4:]
        typedef_curr.item_id = item_id
    elif obo_line[:6] == "name: ":
        assert not typedef_curr.name
        typedef_curr.name = obo_line[6:]
    elif obo_line[:11] == "namespace: ":
        assert not typedef_curr.namespace
        typedef_curr.namespace = obo_line[11:]
    elif obo_line[17:] == "transitive_over: ":
        field_value = obo_line[17:].split('!')[0].rstrip()
        typedef_curr.transitive_over.append(field_value)
    elif obo_line[12:] == "inverse_of":
        assert not typedef_curr.inverse_of
        field_value = obo_line[12:].split('!')[0].rstrip()
        typedef_curr.inverse_of = field_value