blob: 2a1fa8b22517de5c2c4a375e1978d8401236cbf7 [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 Kupietz3f575282019-10-04 14:46:04 +020036\S4method{frequencyQuery}{KorAPConnection}(kco, query, vc = "", ...)
37
Marc Kupietze95108e2019-09-18 13:23:58 +020038\method{format}{KorAPQuery}(x, ...)
39
40\S4method{show}{KorAPQuery}(object)
41}
42\arguments{
43\item{.Object}{}
44
Marc Kupietzb8972182019-09-20 21:33:46 +020045\item{korapConnection}{KorAPConnection object}
46
Marc Kupietze95108e2019-09-18 13:23:58 +020047\item{request}{query part of the request URL}
48
49\item{vc}{definition of a virtual corpus}
50
51\item{totalResults}{number of hits the query has yielded}
52
53\item{nextStartIndex}{at what index to start the next fetch of query results}
54
55\item{fields}{what data / metadata fields should be collected}
56
57\item{requestUrl}{complete URL of the API request}
58
59\item{webUIRequestUrl}{URL of a web frontend request corresponding to the API request}
60
61\item{apiResponse}{data-frame representation of the JSON response of the API request}
62
Marc Kupietz7776dec2019-09-27 16:59:02 +020063\item{hasMoreMatches}{logical that signals if more query results can be fetched}
Marc Kupietze95108e2019-09-18 13:23:58 +020064
65\item{collectedMatches}{matches already fetched from the KorAP-API-server}
66
67\item{kqo}{object obtained from \code{\link{corpusQuery}}}
68
69\item{offset}{start offset for query results to fetch}
70
71\item{maxFetch}{maximum number of query results to fetch}
72
73\item{verbose}{print progress information if true}
74
Marc Kupietz3f575282019-10-04 14:46:04 +020075\item{kco}{\code{\link{KorAPConnection}} object (obtained e.g. from \code{new("KorAPConnection")}}
76
77\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 +020078
79\item{...}{further arguments passed to or from other methods}
80
Marc Kupietz3f575282019-10-04 14:46:04 +020081\item{x}{KorAPQuery object}
82
Marc Kupietze95108e2019-09-18 13:23:58 +020083\item{object}{KorAPQuery object}
84}
85\value{
86The \code{kqo} input object with updated slots \code{collectedMatches}, \code{apiResponse}, \code{nextStartIndex}, \code{hasMoreMatches}
87}
88\description{
89\code{KorAPQuery} objetcs represent the current state of a query to a KorAP server.
90New \code{KorAPQuery} objects are typically created by the \code{\link{corpusQuery}} method.
Marc Kupietz3f575282019-10-04 14:46:04 +020091
92\bold{\code{fetchNext}} fetches the next bunch of results of a KorAP query.
93
94\bold{\code{frequencyQuery}} combines \code{\link{corpusQuery}}, \code{\link{corpusStats}} and
95\code{\link{ci}} to compute a table with the relative frequencies and
96confidence intervals of one ore multiple search terms across one or multiple
97virtual corpora.
Marc Kupietze95108e2019-09-18 13:23:58 +020098}
99\examples{
Marc Kupietz69cc54a2019-09-30 12:06:54 +0200100q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
Marc Kupietze95108e2019-09-18 13:23:58 +0200101q@collectedMatches
102
Marc Kupietz69cc54a2019-09-30 12:06:54 +0200103q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
Marc Kupietze95108e2019-09-18 13:23:58 +0200104q@collectedMatches
105
Marc Kupietz3f575282019-10-04 14:46:04 +0200106new("KorAPConnection", verbose = TRUE) \%>\%
107 frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003))
108
Marc Kupietze95108e2019-09-18 13:23:58 +0200109}
110\references{
111\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}
112}