blob: 17b1326593d43dd6435f17483f5ac02dd1024ddd [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 Kupietz76685f52019-11-25 17:46:06 +010020\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 Kupietze95108e2019-09-18 13:23:58 +020035
Marc Kupietz76685f52019-11-25 17:46:06 +010036\S4method{fetchNext}{KorAPQuery}(
37 kqo,
38 offset = kqo@nextStartIndex,
39 maxFetch = maxResultsPerPage,
40 verbose = kqo@korapConnection@verbose
41)
Marc Kupietze95108e2019-09-18 13:23:58 +020042
Marc Kupietz76685f52019-11-25 17:46:06 +010043\S4method{fetchAll}{KorAPQuery}(kqo, verbose = kqo@korapConnection@verbose)
Marc Kupietze95108e2019-09-18 13:23:58 +020044
Marc Kupietz76685f52019-11-25 17:46:06 +010045\S4method{fetchRest}{KorAPQuery}(kqo, verbose = kqo@korapConnection@verbose)
Marc Kupietze95108e2019-09-18 13:23:58 +020046
Marc Kupietz76685f52019-11-25 17:46:06 +010047\S4method{frequencyQuery}{KorAPConnection}(
48 kco,
49 query,
50 vc = "",
51 conf.level = 0.95,
52 as.alternatives = FALSE,
53 ...
54)
Marc Kupietz3f575282019-10-04 14:46:04 +020055
Marc Kupietze95108e2019-09-18 13:23:58 +020056\method{format}{KorAPQuery}(x, ...)
57
58\S4method{show}{KorAPQuery}(object)
59}
60\arguments{
61\item{.Object}{}
62
Marc Kupietzb8972182019-09-20 21:33:46 +020063\item{korapConnection}{KorAPConnection object}
64
Marc Kupietze95108e2019-09-18 13:23:58 +020065\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 Kupietz7776dec2019-09-27 16:59:02 +020081\item{hasMoreMatches}{logical that signals if more query results can be fetched}
Marc Kupietze95108e2019-09-18 13:23:58 +020082
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 Kupietz3f575282019-10-04 14:46:04 +020093\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 Kupietze95108e2019-09-18 13:23:58 +020096
Marc Kupietz0c29cea2019-10-09 08:44:36 +020097\item{conf.level}{confidence level of the returned confidence interval (passed throgh \code{\link{ci}} to \code{\link{prop.test}}).}
98
Marc Kupietz71d6e052019-11-22 18:42:10 +010099\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 Kupietze95108e2019-09-18 13:23:58 +0200101\item{...}{further arguments passed to or from other methods}
102
Marc Kupietz3f575282019-10-04 14:46:04 +0200103\item{x}{KorAPQuery object}
104
Marc Kupietze95108e2019-09-18 13:23:58 +0200105\item{object}{KorAPQuery object}
106}
107\value{
108The \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.
112New \code{KorAPQuery} objects are typically created by the \code{\link{corpusQuery}} method.
Marc Kupietz3f575282019-10-04 14:46:04 +0200113
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
118confidence intervals of one ore multiple search terms across one or multiple
119virtual corpora.
Marc Kupietze95108e2019-09-18 13:23:58 +0200120}
121\examples{
Marc Kupietz69cc54a2019-09-30 12:06:54 +0200122q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
Marc Kupietze95108e2019-09-18 13:23:58 +0200123q@collectedMatches
124
Marc Kupietz69cc54a2019-09-30 12:06:54 +0200125q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
Marc Kupietze95108e2019-09-18 13:23:58 +0200126q@collectedMatches
127
Marc Kupietz3f575282019-10-04 14:46:04 +0200128new("KorAPConnection", verbose = TRUE) \%>\%
129 frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003))
130
Marc Kupietze95108e2019-09-18 13:23:58 +0200131}
132\references{
133\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}
134}