Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/KorAPQuery.R |
| 3 | \docType{class} |
| 4 | \name{KorAPQuery-class} |
| 5 | \alias{KorAPQuery-class} |
| 6 | \alias{KorAPQuery} |
| 7 | \alias{initialize,KorAPQuery-method} |
| 8 | \alias{fetchNext,KorAPQuery-method} |
| 9 | \alias{fetchNext} |
| 10 | \alias{fetchAll,KorAPQuery-method} |
| 11 | \alias{fetchAll} |
| 12 | \alias{fetchRest,KorAPQuery-method} |
| 13 | \alias{fetchRest} |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 14 | \alias{frequencyQuery,KorAPConnection-method} |
| 15 | \alias{frequencyQuery} |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 16 | \alias{format.KorAPQuery} |
| 17 | \alias{show,KorAPQuery-method} |
| 18 | \title{Class KorAPQuery} |
| 19 | \usage{ |
Marc Kupietz | b897218 | 2019-09-20 21:33:46 +0200 | [diff] [blame] | 20 | \S4method{initialize}{KorAPQuery}(.Object, korapConnection = NULL, |
| 21 | request = NULL, vc = "", totalResults = 0, nextStartIndex = 0, |
| 22 | fields = c("corpusSigle", "textSigle", "pubDate", "pubPlace", |
| 23 | "availability", "textClass", "snippet"), requestUrl = "", |
| 24 | webUIRequestUrl = "", apiResponse = NULL, hasMoreMatches = FALSE, |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 25 | collectedMatches = NULL) |
| 26 | |
| 27 | \S4method{fetchNext}{KorAPQuery}(kqo, offset = kqo@nextStartIndex, |
Marc Kupietz | f6f7131 | 2019-09-23 18:35:27 +0200 | [diff] [blame] | 28 | maxFetch = maxResultsPerPage, verbose = kqo@korapConnection@verbose) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 29 | |
Marc Kupietz | f6f7131 | 2019-09-23 18:35:27 +0200 | [diff] [blame] | 30 | \S4method{fetchAll}{KorAPQuery}(kqo, |
| 31 | verbose = kqo@korapConnection@verbose) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 32 | |
Marc Kupietz | f6f7131 | 2019-09-23 18:35:27 +0200 | [diff] [blame] | 33 | \S4method{fetchRest}{KorAPQuery}(kqo, |
| 34 | verbose = kqo@korapConnection@verbose) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 35 | |
Marc Kupietz | 0c29cea | 2019-10-09 08:44:36 +0200 | [diff] [blame] | 36 | \S4method{frequencyQuery}{KorAPConnection}(kco, query, vc = "", |
| 37 | conf.level = 0.95, ...) |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 38 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 39 | \method{format}{KorAPQuery}(x, ...) |
| 40 | |
| 41 | \S4method{show}{KorAPQuery}(object) |
| 42 | } |
| 43 | \arguments{ |
| 44 | \item{.Object}{…} |
| 45 | |
Marc Kupietz | b897218 | 2019-09-20 21:33:46 +0200 | [diff] [blame] | 46 | \item{korapConnection}{KorAPConnection object} |
| 47 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 48 | \item{request}{query part of the request URL} |
| 49 | |
| 50 | \item{vc}{definition of a virtual corpus} |
| 51 | |
| 52 | \item{totalResults}{number of hits the query has yielded} |
| 53 | |
| 54 | \item{nextStartIndex}{at what index to start the next fetch of query results} |
| 55 | |
| 56 | \item{fields}{what data / metadata fields should be collected} |
| 57 | |
| 58 | \item{requestUrl}{complete URL of the API request} |
| 59 | |
| 60 | \item{webUIRequestUrl}{URL of a web frontend request corresponding to the API request} |
| 61 | |
| 62 | \item{apiResponse}{data-frame representation of the JSON response of the API request} |
| 63 | |
Marc Kupietz | 7776dec | 2019-09-27 16:59:02 +0200 | [diff] [blame] | 64 | \item{hasMoreMatches}{logical that signals if more query results can be fetched} |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 65 | |
| 66 | \item{collectedMatches}{matches already fetched from the KorAP-API-server} |
| 67 | |
| 68 | \item{kqo}{object obtained from \code{\link{corpusQuery}}} |
| 69 | |
| 70 | \item{offset}{start offset for query results to fetch} |
| 71 | |
| 72 | \item{maxFetch}{maximum number of query results to fetch} |
| 73 | |
| 74 | \item{verbose}{print progress information if true} |
| 75 | |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 76 | \item{kco}{\code{\link{KorAPConnection}} object (obtained e.g. from \code{new("KorAPConnection")}} |
| 77 | |
| 78 | \item{query}{string that contains the corpus query. The query language depends on the \code{ql} parameter. Either \code{query} must be provided or \code{KorAPUrl}.} |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 79 | |
Marc Kupietz | 0c29cea | 2019-10-09 08:44:36 +0200 | [diff] [blame] | 80 | \item{conf.level}{confidence level of the returned confidence interval (passed throgh \code{\link{ci}} to \code{\link{prop.test}}).} |
| 81 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 82 | \item{...}{further arguments passed to or from other methods} |
| 83 | |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 84 | \item{x}{KorAPQuery object} |
| 85 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 86 | \item{object}{KorAPQuery object} |
| 87 | } |
| 88 | \value{ |
| 89 | The \code{kqo} input object with updated slots \code{collectedMatches}, \code{apiResponse}, \code{nextStartIndex}, \code{hasMoreMatches} |
| 90 | } |
| 91 | \description{ |
| 92 | \code{KorAPQuery} objetcs represent the current state of a query to a KorAP server. |
| 93 | New \code{KorAPQuery} objects are typically created by the \code{\link{corpusQuery}} method. |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 94 | |
| 95 | \bold{\code{fetchNext}} fetches the next bunch of results of a KorAP query. |
| 96 | |
| 97 | \bold{\code{frequencyQuery}} combines \code{\link{corpusQuery}}, \code{\link{corpusStats}} and |
| 98 | \code{\link{ci}} to compute a table with the relative frequencies and |
| 99 | confidence intervals of one ore multiple search terms across one or multiple |
| 100 | virtual corpora. |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 101 | } |
| 102 | \examples{ |
Marc Kupietz | 69cc54a | 2019-09-30 12:06:54 +0200 | [diff] [blame] | 103 | q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll() |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 104 | q@collectedMatches |
| 105 | |
Marc Kupietz | 69cc54a | 2019-09-30 12:06:54 +0200 | [diff] [blame] | 106 | q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll() |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 107 | q@collectedMatches |
| 108 | |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 109 | new("KorAPConnection", verbose = TRUE) \%>\% |
| 110 | frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003)) |
| 111 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 112 | } |
| 113 | \references{ |
| 114 | \url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026} |
| 115 | } |