def getreltype(reltype):
    """Returns search relation codes for posting requests to http://apps.webofknowledge.com/UA_GeneralSearch.do"""

    if reltype == 'and':
        rel = 'AND'
    elif reltype == 'or':
        rel = 'OR'
    elif reltype == 'not':
        rel = 'NOT'
    else:
        raise Exception('Error relType invalid')

    return rel