def build_path(options):
    """
    Build the URI path needed to query the DNSDB API

    :param options: Dictionary
    :return: string
    """
    if options['name']:
        if options['inverse']:
            path = '/lookup/rdata/name/{}/{}'.format(options['name'],
                options['type'])
            return path
        else:
            path = '/lookup/rrset/name/{}/{}'.format(options['name'],
                options['type'])
            if options['bailiwick']:
                path += '/{}'.format(options['bailiwick'])
                return path
            return path
    elif options['ip']:
        options['ip'] = options['ip'].replace('/', ',')
        path = '/lookup/rdata/ip/{}'.format(options['ip'])
        return path
    elif options['hex']:
        path = '/lookup/rdata/raw/{}'.format(options['hex'])
        return path
    else:
        raise LookupError('name, ip, or hex was not specified')
