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 | 76685f5 | 2019-11-25 17:46:06 +0100 | [diff] [blame^] | 20 | \S4method{initialize}{KorAPQuery}( |
| 21 | .Object, |
| 22 | korapConnection = NULL, |
| 23 | request = NULL, |
| 24 | vc = "", |
| 25 | totalResults = 0, |
| 26 | nextStartIndex = 0, |
| 27 | fields = c("corpusSigle", "textSigle", "pubDate", "pubPlace", "availability", |
| 28 | "textClass", "snippet"), |
| 29 | requestUrl = "", |
| 30 | webUIRequestUrl = "", |
| 31 | apiResponse = NULL, |
| 32 | hasMoreMatches = FALSE, |
| 33 | collectedMatches = NULL |
| 34 | ) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 35 | |
Marc Kupietz | 76685f5 | 2019-11-25 17:46:06 +0100 | [diff] [blame^] | 36 | \S4method{fetchNext}{KorAPQuery}( |
| 37 | kqo, |
| 38 | offset = kqo@nextStartIndex, |
| 39 | maxFetch = maxResultsPerPage, |
| 40 | verbose = kqo@korapConnection@verbose |
| 41 | ) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 42 | |
Marc Kupietz | 76685f5 | 2019-11-25 17:46:06 +0100 | [diff] [blame^] | 43 | \S4method{fetchAll}{KorAPQuery}(kqo, verbose = kqo@korapConnection@verbose) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 44 | |
Marc Kupietz | 76685f5 | 2019-11-25 17:46:06 +0100 | [diff] [blame^] | 45 | \S4method{fetchRest}{KorAPQuery}(kqo, verbose = kqo@korapConnection@verbose) |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 46 | |
Marc Kupietz | 76685f5 | 2019-11-25 17:46:06 +0100 | [diff] [blame^] | 47 | \S4method{frequencyQuery}{KorAPConnection}( |
| 48 | kco, |
| 49 | query, |
| 50 | vc = "", |
| 51 | conf.level = 0.95, |
| 52 | as.alternatives = FALSE, |
| 53 | ... |
| 54 | ) |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 55 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 56 | \method{format}{KorAPQuery}(x, ...) |
| 57 | |
| 58 | \S4method{show}{KorAPQuery}(object) |
| 59 | } |
| 60 | \arguments{ |
| 61 | \item{.Object}{…} |
| 62 | |
Marc Kupietz | b897218 | 2019-09-20 21:33:46 +0200 | [diff] [blame] | 63 | \item{korapConnection}{KorAPConnection object} |
| 64 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 65 | \item{request}{query part of the request URL} |
| 66 | |
| 67 | \item{vc}{definition of a virtual corpus} |
| 68 | |
| 69 | \item{totalResults}{number of hits the query has yielded} |
| 70 | |
| 71 | \item{nextStartIndex}{at what index to start the next fetch of query results} |
| 72 | |
| 73 | \item{fields}{what data / metadata fields should be collected} |
| 74 | |
| 75 | \item{requestUrl}{complete URL of the API request} |
| 76 | |
| 77 | \item{webUIRequestUrl}{URL of a web frontend request corresponding to the API request} |
| 78 | |
| 79 | \item{apiResponse}{data-frame representation of the JSON response of the API request} |
| 80 | |
Marc Kupietz | 7776dec | 2019-09-27 16:59:02 +0200 | [diff] [blame] | 81 | \item{hasMoreMatches}{logical that signals if more query results can be fetched} |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 82 | |
| 83 | \item{collectedMatches}{matches already fetched from the KorAP-API-server} |
| 84 | |
| 85 | \item{kqo}{object obtained from \code{\link{corpusQuery}}} |
| 86 | |
| 87 | \item{offset}{start offset for query results to fetch} |
| 88 | |
| 89 | \item{maxFetch}{maximum number of query results to fetch} |
| 90 | |
| 91 | \item{verbose}{print progress information if true} |
| 92 | |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 93 | \item{kco}{\code{\link{KorAPConnection}} object (obtained e.g. from \code{new("KorAPConnection")}} |
| 94 | |
| 95 | \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] | 96 | |
Marc Kupietz | 0c29cea | 2019-10-09 08:44:36 +0200 | [diff] [blame] | 97 | \item{conf.level}{confidence level of the returned confidence interval (passed throgh \code{\link{ci}} to \code{\link{prop.test}}).} |
| 98 | |
Marc Kupietz | 71d6e05 | 2019-11-22 18:42:10 +0100 | [diff] [blame] | 99 | \item{as.alternatives}{LOGICAL that specifies if the query terms should be treated as alternatives. If \code{as.alternatives} is TRUE, the sum over all query hits, instead of the respective vc token sizes is used as total for the calculation of relative frequencies.} |
| 100 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 101 | \item{...}{further arguments passed to or from other methods} |
| 102 | |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 103 | \item{x}{KorAPQuery object} |
| 104 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 105 | \item{object}{KorAPQuery object} |
| 106 | } |
| 107 | \value{ |
| 108 | The \code{kqo} input object with updated slots \code{collectedMatches}, \code{apiResponse}, \code{nextStartIndex}, \code{hasMoreMatches} |
| 109 | } |
| 110 | \description{ |
| 111 | \code{KorAPQuery} objetcs represent the current state of a query to a KorAP server. |
| 112 | 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] | 113 | |
| 114 | \bold{\code{fetchNext}} fetches the next bunch of results of a KorAP query. |
| 115 | |
| 116 | \bold{\code{frequencyQuery}} combines \code{\link{corpusQuery}}, \code{\link{corpusStats}} and |
| 117 | \code{\link{ci}} to compute a table with the relative frequencies and |
| 118 | confidence intervals of one ore multiple search terms across one or multiple |
| 119 | virtual corpora. |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 120 | } |
| 121 | \examples{ |
Marc Kupietz | 69cc54a | 2019-09-30 12:06:54 +0200 | [diff] [blame] | 122 | q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll() |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 123 | q@collectedMatches |
| 124 | |
Marc Kupietz | 69cc54a | 2019-09-30 12:06:54 +0200 | [diff] [blame] | 125 | q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll() |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 126 | q@collectedMatches |
| 127 | |
Marc Kupietz | 3f57528 | 2019-10-04 14:46:04 +0200 | [diff] [blame] | 128 | new("KorAPConnection", verbose = TRUE) \%>\% |
| 129 | frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003)) |
| 130 | |
Marc Kupietz | e95108e | 2019-09-18 13:23:58 +0200 | [diff] [blame] | 131 | } |
| 132 | \references{ |
| 133 | \url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026} |
| 134 | } |