Marc Kupietz | fd9e749 | 2019-11-08 15:45:18 +0100 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # Use setClassUnion to define the unholy NULL-data union as a virtual class. |
| 3 | ################################################################################ |
| 4 | setClassUnion("characterOrNULL", c("character", "NULL")) |
| 5 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 6 | #' Class KorAPConnection |
Marc Kupietz | 25aebc3 | 2019-09-16 18:40:50 +0200 | [diff] [blame] | 7 | #' |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 8 | #' `KorAPConnection` objects represent the connection to a KorAP server. |
| 9 | #' New `KorAPConnection` objects can be created by `new("KorAPConnection")`. |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 10 | #' |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 11 | #' @import R.cache |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 12 | #' @import utils |
| 13 | #' @import methods |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 14 | #' @export |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 15 | KorAPConnection <- setClass("KorAPConnection", slots=c(KorAPUrl="character", apiVersion="character", indexRevision="characterOrNULL", apiUrl="character", accessToken="characterOrNULL", userAgent="character", timeout="numeric", verbose="logical", cache="logical")) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 16 | |
| 17 | #' @param .Object KorAPConnection object |
| 18 | #' @param KorAPUrl the URL of the KorAP server instance you want to access. |
| 19 | #' @param apiVersion which version of KorAP's API you want to connect to. |
| 20 | #' @param apiUrl URL of the KorAP web service. |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 21 | #' @param accessToken OAuth2 access token. To use authorization based on an access token |
Marc Kupietz | 43a6ade | 2020-02-18 17:01:44 +0100 | [diff] [blame] | 22 | #' in subsequent queries, initialize your KorAP connection with |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 23 | #' `kco <- new("KorAPConnection", accessToken="<access token>")`. |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 24 | #' In order to make the API |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 25 | #' token persistent for the currently used `KorAPUrl` (you can have one |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 26 | #' token per KorAPUrl / KorAP server instance), use |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 27 | #' `persistAccessToken(kco)`. This will store it in your keyring using the |
| 28 | #' [keyring()] package. Subsequent new("KorAPConnection") calls will |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 29 | #' then automatically retrieve the token from your keying. To stop using a |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 30 | #' persisted token, call `clearAccessToken(kco)`. Please note that for |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 31 | #' DeReKo, authorized queries will behave differently inside and outside the |
| 32 | #' IDS, because of the special license situation. This concerns also cached |
| 33 | #' results which do not take into account from where a request was issued. If |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 34 | #' you experience problems or unexpected results, please try `kco <- |
| 35 | #' new("KorAPConnection", cache=FALSE)` or use |
| 36 | #' [clearCache()] to clear the cache completely. |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 37 | #' @param userAgent user agent string. |
| 38 | #' @param timeout time out in seconds. |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 39 | #' @param verbose logical. Decides whether following operations will default to |
| 40 | #' be verbose. |
| 41 | #' @param cache logical. Decides if API calls are cached locally. You can clear |
Marc Kupietz | 67edcb5 | 2021-09-20 21:54:24 +0200 | [diff] [blame] | 42 | #' the cache with [clearCache()]. |
| 43 | #' @return [KorAPConnection()] object that can be used e.g. with |
| 44 | #' [corpusQuery()] |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 45 | #' |
| 46 | #' @examples |
Marc Kupietz | 6ae7605 | 2021-09-21 10:34:00 +0200 | [diff] [blame] | 47 | #' \dontrun{ |
| 48 | #' |
Marc Kupietz | 5a51982 | 2019-09-20 21:43:52 +0200 | [diff] [blame] | 49 | #' kcon <- new("KorAPConnection", verbose = TRUE) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 50 | #' kq <- corpusQuery(kcon, "Ameisenplage") |
Marc Kupietz | 5a51982 | 2019-09-20 21:43:52 +0200 | [diff] [blame] | 51 | #' kq <- fetchAll(kq) |
Marc Kupietz | 05b2277 | 2020-02-18 21:58:42 +0100 | [diff] [blame] | 52 | #' } |
Marc Kupietz | 7915dc4 | 2019-09-12 17:44:58 +0200 | [diff] [blame] | 53 | #' |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 54 | #' \dontrun{ |
Marc Kupietz | 6ae7605 | 2021-09-21 10:34:00 +0200 | [diff] [blame] | 55 | #' |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 56 | #' kcon <- new("KorAPConnection", verbose = TRUE, accessToken="e739u6eOzkwADQPdVChxFg") |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 57 | #' kq <- corpusQuery(kcon, "Ameisenplage", metadataOnly=FALSE) |
| 58 | #' kq <- fetchAll(kq) |
| 59 | #' kq@collectedMatches$snippet |
| 60 | #' } |
Marc Kupietz | 7915dc4 | 2019-09-12 17:44:58 +0200 | [diff] [blame] | 61 | #' |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 62 | #' @rdname KorAPConnection-class |
Marc Kupietz | 632cbd4 | 2019-09-06 16:04:51 +0200 | [diff] [blame] | 63 | #' @export |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 64 | setMethod("initialize", "KorAPConnection", |
Marc Kupietz | 6a3185b | 2021-12-07 10:23:16 +0100 | [diff] [blame] | 65 | function(.Object, KorAPUrl = "https://korap.ids-mannheim.de/", apiVersion = 'v1.0', apiUrl, accessToken = getAccessToken(KorAPUrl), userAgent = "R-KorAP-Client", timeout=240, verbose = FALSE, cache = TRUE) { |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 66 | .Object <- callNextMethod() |
| 67 | m <- regexpr("https?://[^?]+", KorAPUrl, perl = TRUE) |
| 68 | .Object@KorAPUrl <- regmatches(KorAPUrl, m) |
| 69 | if (!endsWith(.Object@KorAPUrl, '/')) { |
| 70 | .Object@KorAPUrl <- paste0(.Object@KorAPUrl, "/") |
| 71 | } |
| 72 | if (missing(apiUrl)) { |
| 73 | .Object@apiUrl = paste0(.Object@KorAPUrl, 'api/', apiVersion, '/') |
| 74 | } else { |
| 75 | .Object@apiUrl = apiUrl |
| 76 | } |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 77 | .Object@accessToken = accessToken |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 78 | .Object@apiVersion = apiVersion |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 79 | .Object@userAgent = userAgent |
| 80 | .Object@timeout = timeout |
Marc Kupietz | 5a51982 | 2019-09-20 21:43:52 +0200 | [diff] [blame] | 81 | .Object@verbose = verbose |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 82 | .Object@cache = cache |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 83 | welcome <- apiCall(.Object, .Object@apiUrl, json = FALSE, cache = FALSE, getHeaders = TRUE) |
| 84 | message(welcome[[2]]) |
| 85 | .Object@indexRevision <- welcome[[1]][["x-index-revision"]] |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 86 | .Object |
| 87 | }) |
| 88 | |
Marc Kupietz | a96537f | 2019-11-09 23:07:44 +0100 | [diff] [blame] | 89 | |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 90 | accessTokenServiceName <- "RKorAPClientAccessToken" |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 91 | |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 92 | setGeneric("persistAccessToken", function(kco, ...) standardGeneric("persistAccessToken") ) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 93 | |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 94 | #' @aliases persistAccessToken |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 95 | #' @rdname KorAPConnection-class |
| 96 | #' @import keyring |
| 97 | #' @export |
| 98 | #' @examples |
| 99 | #' \dontrun{ |
Marc Kupietz | 6ae7605 | 2021-09-21 10:34:00 +0200 | [diff] [blame] | 100 | #' |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 101 | #' kco <- new("KorAPConnection", accessToken="e739u6eOzkwADQPdVChxFg") |
| 102 | #' persistAccessToken(kco) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 103 | #' } |
| 104 | #' |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 105 | setMethod("persistAccessToken", "KorAPConnection", function(kco, accessToken = kco@accessToken) { |
| 106 | if (is.null(accessToken)) |
| 107 | stop("It seems that you have not supplied any access token that could be persisted.", call. = FALSE) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 108 | |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 109 | kco@accessToken <- accessToken |
| 110 | key_set_with_value(accessTokenServiceName, kco@KorAPUrl, accessToken) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 111 | }) |
| 112 | |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 113 | setGeneric("clearAccessToken", function(kco) standardGeneric("clearAccessToken") ) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 114 | |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 115 | #' @aliases clearAccessToken |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 116 | #' @rdname KorAPConnection-class |
| 117 | #' @import keyring |
| 118 | #' @export |
| 119 | #' @examples |
| 120 | #' \dontrun{ |
Marc Kupietz | 6ae7605 | 2021-09-21 10:34:00 +0200 | [diff] [blame] | 121 | #' |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 122 | #' kco <- new("KorAPConnection") |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 123 | #' clearAccessToken(kco) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 124 | #' } |
| 125 | #' |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 126 | setMethod("clearAccessToken", "KorAPConnection", function(kco) { |
| 127 | key_delete(accessTokenServiceName, kco@KorAPUrl) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 128 | }) |
| 129 | |
| 130 | #' @import keyring |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 131 | getAccessToken <- function(KorAPUrl) { |
Marc Kupietz | 59e449b | 2019-12-12 12:53:54 +0100 | [diff] [blame] | 132 | keyList <- tryCatch(withCallingHandlers(key_list(service = accessTokenServiceName), |
Marc Kupietz | ddce556 | 2019-11-24 15:45:38 +0100 | [diff] [blame] | 133 | warning = function(w) invokeRestart("muffleWarning"), |
Marc Kupietz | 59e449b | 2019-12-12 12:53:54 +0100 | [diff] [blame] | 134 | error = function(e) return(NULL)), |
| 135 | error = function(e) { }) |
Marc Kupietz | 01c2477 | 2021-07-14 18:27:36 +0200 | [diff] [blame] | 136 | if (KorAPUrl %in% keyList$username) |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 137 | key_get(accessTokenServiceName, KorAPUrl) |
Marc Kupietz | fd9e749 | 2019-11-08 15:45:18 +0100 | [diff] [blame] | 138 | else |
| 139 | NULL |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 140 | } |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 141 | |
Marc Kupietz | 581a29b | 2021-09-04 20:51:04 +0200 | [diff] [blame] | 142 | |
| 143 | warnIfNoAccessToken <- function(kco) { |
| 144 | if (is.null(kco@accessToken)) { |
| 145 | warning( |
| 146 | paste0( |
| 147 | "In order to receive KWICSs also from corpora with restricted licenses, you need an access token.\n", |
| 148 | "To generate an access token, login to KorAP and navigite to KorAP's OAuth settings <", |
| 149 | kco@KorAPUrl, |
| 150 | "settings/oauth#page-top>" |
| 151 | ) |
| 152 | ) |
| 153 | } |
| 154 | } |
| 155 | |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 156 | KorAPCacheSubDir <- function() { |
Marc Kupietz | 70b2c72 | 2020-02-18 13:32:09 +0100 | [diff] [blame] | 157 | paste0("RKorAPClient_", |
| 158 | gsub( |
| 159 | "^([0-9]+\\.[0-9]+).*", |
| 160 | "\\1", |
| 161 | packageVersion("RKorAPClient"), |
| 162 | perl = TRUE |
| 163 | )) |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 164 | } |
| 165 | |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 166 | setGeneric("apiCall", function(kco, ...) standardGeneric("apiCall") ) |
| 167 | |
Marc Kupietz | 4de53ec | 2019-10-04 09:12:00 +0200 | [diff] [blame] | 168 | ## quiets concerns of R CMD check re: the .'s that appear in pipelines |
| 169 | if(getRversion() >= "2.15.1") utils::globalVariables(c(".")) |
| 170 | |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 171 | #' @aliases apiCall |
| 172 | #' @rdname KorAPConnection-class |
| 173 | #' @param kco KorAPConnection object |
| 174 | #' @param url request url |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 175 | #' @param json logical that determines if json result is expected |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 176 | #' @param getHeaders logical that determines if headers and content should be returned (as a list) |
Marc Kupietz | 69cc54a | 2019-09-30 12:06:54 +0200 | [diff] [blame] | 177 | #' @importFrom jsonlite fromJSON |
| 178 | #' @export |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 179 | setMethod("apiCall", "KorAPConnection", function(kco, url, json = TRUE, getHeaders = FALSE, cache = kco@cache) { |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 180 | result <- "" |
| 181 | if (cache) { |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 182 | result <- R.cache::loadCache(dir=KorAPCacheSubDir(), key=list(url, kco@accessToken, kco@indexRevision)) |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 183 | if (!is.null(result)) { |
| 184 | if (!is.null(result$meta)) |
| 185 | result$meta$cached <- "local" |
| 186 | return(result) |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 187 | } |
| 188 | } |
Marc Kupietz | b956b81 | 2019-11-25 17:53:13 +0100 | [diff] [blame] | 189 | if (!is.null(kco@accessToken)) |
| 190 | resp <- GET(url, user_agent(kco@userAgent), timeout(kco@timeout), add_headers(Authorization = paste("Bearer", kco@accessToken))) |
Marc Kupietz | 4862b86 | 2019-11-07 10:13:53 +0100 | [diff] [blame] | 191 | else |
| 192 | resp <- GET(url, user_agent(kco@userAgent), timeout(kco@timeout)) |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 193 | if (json || status_code(resp) != 200) { |
| 194 | if (json && !http_type(resp) %in% c("application/json", "application/ld+json")) { |
| 195 | stop("API did not return json", call. = FALSE) |
| 196 | } |
| 197 | result <- jsonlite::fromJSON(content(resp, "text", encoding = "UTF-8")) |
| 198 | if (!is.null(result$warnings)) { |
| 199 | message <- if (nrow(result$warnings) > 1) |
| 200 | sapply(result$warnings, function(warning) paste(sprintf("%s: %s", warning[1], warning[2]), sep="\n")) |
| 201 | else |
| 202 | sprintf("%s: %s", result$warnings[1], result$warnings[2]) |
| 203 | warning(message, call. = FALSE) |
| 204 | } |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 205 | } |
| 206 | if (status_code(resp) != 200) { |
Marc Kupietz | b7d8c27 | 2020-01-31 18:51:50 +0100 | [diff] [blame] | 207 | if (kco@verbose) { |
| 208 | cat("\n") |
| 209 | } |
| 210 | message <- sprintf("%s KorAP API request failed", status_code(resp)) |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 211 | if (!is.null(result$errors)) { |
| 212 | message <- sprintf("%s - %s %s", message, result$errors[1], result$errors[2]) |
Marc Kupietz | b7d8c27 | 2020-01-31 18:51:50 +0100 | [diff] [blame] | 213 | } |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 214 | stop(message, call. = FALSE) |
| 215 | } |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 216 | if (!json) { |
| 217 | result <- content(resp, "text", encoding = "UTF-8") |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 218 | } |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 219 | if (cache) { |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 220 | R.cache::saveCache(result, key = list(url, kco@accessToken, kco@indexRevision), dir = KorAPCacheSubDir(), compress = TRUE) |
Marc Kupietz | b2b32a3 | 2020-03-24 13:56:50 +0100 | [diff] [blame] | 221 | } |
Marc Kupietz | b49afa0 | 2020-06-04 15:50:29 +0200 | [diff] [blame] | 222 | if (getHeaders) { |
| 223 | list(httr::headers(resp), result) |
| 224 | } else { |
| 225 | result |
| 226 | } |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 227 | }) |
| 228 | |
Marc Kupietz | 0a96b28 | 2019-10-01 11:05:31 +0200 | [diff] [blame] | 229 | setGeneric("clearCache", function(kco) standardGeneric("clearCache") ) |
| 230 | |
| 231 | #' @aliases clearCache |
| 232 | #' @rdname KorAPConnection-class |
| 233 | #' @export |
| 234 | setMethod("clearCache", "KorAPConnection", function(kco) { |
| 235 | R.cache::clearCache(dir=KorAPCacheSubDir()) |
| 236 | }) |
| 237 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 238 | #' @rdname KorAPConnection-class |
| 239 | #' @param object KorAPConnection object |
| 240 | #' @export |
| 241 | setMethod("show", "KorAPConnection", function(object) { |
| 242 | cat("<KorAPConnection>", "\n") |
| 243 | cat("apiUrl: ", object@apiUrl, "\n") |
| 244 | }) |
| 245 | |
Marc Kupietz | d0d3e9b | 2019-09-24 17:36:03 +0200 | [diff] [blame] | 246 | ##' Funtion KorAPConnection() |
| 247 | ##' |
| 248 | ##' Wrappper function for new("KorAPConnection") |
| 249 | ##' |
| 250 | ##' @rdname KorAPConnection-constructor |
| 251 | ##' @name KorAPConnection-constructor |
| 252 | ##' @export |
| 253 | ## XKorAPConnection <- function(...) new("KorAPConnection", ...) |