synapseQuery: Query The Synapse API

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Provides an interface to the Synapse API

Usage

1
2
synapseQuery(queryStatement)
synQuery(queryStatement)

Arguments

queryStatement

The query statement

blockSize

Defaults to NULL. If blockSize is set to an integer, returns a QueryResult object.

Details

See the Query service API wiki for details on how to form a query: http://sagebionetworks.jira.com/wiki/display/PLFM/Repository+Service+API#RepositoryServiceAPI-QueryAPI

Value

Depending on whether blockSize is specified, returns a data.frame holding all query results or a QueryResult object, which enables paging through query results in increments of blockSize rows.

Care should be taken to return a reasonable number of results. The service enforces a limit on the size of responses and will return an error if that limit is exceeded. Specifying only necessary columns, limiting the number of rows, and paging by specifying blockSize are all good strategies for staying within the response size limit.

Author(s)

Nicole Deflaux

See Also

QueryResult

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
  ## query for the first 1000 Files found, returning results as a data.frame
  df <- synQuery("select id, name, parentId from file limit 1000")


  ## get a QueryResult object back from a query
  qr <- synQuery("select id, name, parentId from file limit 1000", blockSize=100)

  ## get a data.frame with 100 results
  df <- qr$fetch()

  ## accumulate the next 300 results
  df <- qr$collect()
  df <- qr$collect()
  df <- qr$collect()

  ## accumulate the remaining results.
  ## df will be a data.frame with 1000 accumulated rows
  df <- qr$collectAll()

## End(Not run)

Sage-Bionetworks/rSynapseClient documentation built on May 9, 2019, 7:04 p.m.