blob: 774915133acff0ca9723a9c236dbddc14ed0222a [file] [log] [blame]
Marc Kupietze95108e2019-09-18 13:23:58 +02001% 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 Kupietz3f575282019-10-04 14:46:04 +020014\alias{frequencyQuery,KorAPConnection-method}
15\alias{frequencyQuery}
Marc Kupietze95108e2019-09-18 13:23:58 +020016\alias{format.KorAPQuery}
17\alias{show,KorAPQuery-method}
18\title{Class KorAPQuery}
19\usage{
Marc Kupietzb8972182019-09-20 21:33:46 +020020\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 Kupietze95108e2019-09-18 13:23:58 +020025 collectedMatches = NULL)
26
27\S4method{fetchNext}{KorAPQuery}(kqo, offset = kqo@nextStartIndex,
Marc Kupietzf6f71312019-09-23 18:35:27 +020028 maxFetch = maxResultsPerPage, verbose = kqo@korapConnection@verbose)
Marc Kupietze95108e2019-09-18 13:23:58 +020029
Marc Kupietzf6f71312019-09-23 18:35:27 +020030\S4method{fetchAll}{KorAPQuery}(kqo,
31 verbose = kqo@korapConnection@verbose)
Marc Kupietze95108e2019-09-18 13:23:58 +020032
Marc Kupietzf6f71312019-09-23 18:35:27 +020033\S4method{fetchRest}{KorAPQuery}(kqo,
34 verbose = kqo@korapConnection@verbose)
Marc Kupietze95108e2019-09-18 13:23:58 +020035
Marc Kupietz0c29cea2019-10-09 08:44:36 +020036\S4method{frequencyQuery}{KorAPConnection}(kco, query, vc = "",
Marc Kupietz71d6e052019-11-22 18:42:10 +010037 conf.level = 0.95, as.alternatives = FALSE, ...)
Marc Kupietz3f575282019-10-04 14:46:04 +020038
Marc Kupietze95108e2019-09-18 13:23:58 +020039\method{format}{KorAPQuery}(x, ...)
40
41\S4method{show}{KorAPQuery}(object)
42}
43\arguments{
44\item{.Object}{}
45
Marc Kupietzb8972182019-09-20 21:33:46 +020046\item{korapConnection}{KorAPConnection object}
47
Marc Kupietze95108e2019-09-18 13:23:58 +020048\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 Kupietz7776dec2019-09-27 16:59:02 +020064\item{hasMoreMatches}{logical that signals if more query results can be fetched}
Marc Kupietze95108e2019-09-18 13:23:58 +020065
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 Kupietz3f575282019-10-04 14:46:04 +020076\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 Kupietze95108e2019-09-18 13:23:58 +020079
Marc Kupietz0c29cea2019-10-09 08:44:36 +020080\item{conf.level}{confidence level of the returned confidence interval (passed throgh \code{\link{ci}} to \code{\link{prop.test}}).}
81
Marc Kupietz71d6e052019-11-22 18:42:10 +010082\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.}
83
Marc Kupietze95108e2019-09-18 13:23:58 +020084\item{...}{further arguments passed to or from other methods}
85
Marc Kupietz3f575282019-10-04 14:46:04 +020086\item{x}{KorAPQuery object}
87
Marc Kupietze95108e2019-09-18 13:23:58 +020088\item{object}{KorAPQuery object}
89}
90\value{
91The \code{kqo} input object with updated slots \code{collectedMatches}, \code{apiResponse}, \code{nextStartIndex}, \code{hasMoreMatches}
92}
93\description{
94\code{KorAPQuery} objetcs represent the current state of a query to a KorAP server.
95New \code{KorAPQuery} objects are typically created by the \code{\link{corpusQuery}} method.
Marc Kupietz3f575282019-10-04 14:46:04 +020096
97\bold{\code{fetchNext}} fetches the next bunch of results of a KorAP query.
98
99\bold{\code{frequencyQuery}} combines \code{\link{corpusQuery}}, \code{\link{corpusStats}} and
100\code{\link{ci}} to compute a table with the relative frequencies and
101confidence intervals of one ore multiple search terms across one or multiple
102virtual corpora.
Marc Kupietze95108e2019-09-18 13:23:58 +0200103}
104\examples{
Marc Kupietz69cc54a2019-09-30 12:06:54 +0200105q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
Marc Kupietze95108e2019-09-18 13:23:58 +0200106q@collectedMatches
107
Marc Kupietz69cc54a2019-09-30 12:06:54 +0200108q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
Marc Kupietze95108e2019-09-18 13:23:58 +0200109q@collectedMatches
110
Marc Kupietz3f575282019-10-04 14:46:04 +0200111new("KorAPConnection", verbose = TRUE) \%>\%
112 frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003))
113
Marc Kupietze95108e2019-09-18 13:23:58 +0200114}
115\references{
116\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}
117}