compound: Force evaluation of a database query

View source: R/compound.R

compoundR Documentation

Force evaluation of a database query

Description

compound() shows the full set of queries required to properly evaluate the user's request, run prior to collapse().

The number of total queries to send for a single data request is often broader than the single query returned by collapse(). If, for example, the user's query includes a call to identify(), then a taxonomic query is required to run before the 'final' query is attempted. In relation to other functions that manipulate ⁠_request⁠ objects, compound() is called within collapse(), and itself calls capture() internally where required.

Usage

compound(x, ...)

## S3 method for class 'data_request'
compound(x, mint_doi = FALSE, ...)

## S3 method for class 'metadata_request'
compound(x, ...)

## S3 method for class 'files_request'
compound(x, ...)

## S3 method for class 'prequery'
compound(x, mint_doi = FALSE, ...)

## S3 method for class 'query'
compound(x, ...)

## S3 method for class 'query_set'
compound(x, ...)

Arguments

x

An object to be compounded. Works for data_request, metadata_request, file_request, query or prequery.

...

Other arguments passed to capture().

mint_doi

Logical: should a DOI be minted for this download? Only applies to type = "occurrences", and only for supported atlases.

Details

galah uses an object-based pipeline to convert piped requests into valid queries, and to enact those queries with the specified organisation. Typically, requests open with galah_call() - though request_metadata() and request_files() are also valid - and end with collect(). Under the hood, the sequence of functions is as follows:

capture()compound()collapse()compute()collect()

compound() is the second of the galah_call() workflow, and it collates the complete list of queries required to send in order to meet the user's data request, returned by collapse().

Value

An object of class query_set, which is simply a list of all query objects required to properly evaluate the specified request. Objects are listed in the order in which they will be evaluated, meaning the query that the user has actually requested will be placed last.

See Also

To open a piped query, see galah_call(). For alternative operations on ⁠_request⁠ objects, see capture(), collapse(), compute() or collect().


galah documentation built on Feb. 11, 2026, 9:11 a.m.