Skip to contents

Use SQL-like expressions to query data objects and collections based on different properties. Read more about queries by looking at the iCommands equivalent iquest in the iRODS Docs.

Usage

iquery(
  query,
  limit = 100,
  offset = 0,
  type = c("general", "specific"),
  case_sensitive = TRUE,
  distinct = TRUE,
  verbose = FALSE
)

Arguments

query

GeneralQuery for searching the iCAT database.

limit

Maximum number of rows to return. Defaults to 100.

offset

Number of rows to skip for paging. Defaults to 0.

type

Type of query: 'general' (the default) or 'specific'.

case_sensitive

Whether the string matching in the query is case sensitive. Defaults to TRUE.

distinct

Whether only distinct rows should be listed. Defaults to TRUE.

verbose

Whether information should be printed about the HTTP request and response.

Value

A dataframe with one row per result and one column per requested attribute, with "size" and "time" columns parsed to the right type.

Invisibly, the HTTP response.

References

https://docs.irods.org/master/icommands/user/#iquest

Use SQL-like expressions to query data objects and collections based on different properties.

See also

Examples

is_irods_demo_running()
#> [1] TRUE

# demonstration server (requires Bash, Docker and Docker-compose)
# use_irods_demo()

# connect project to server
create_irods("http://localhost/irods-rest/0.9.3", "/tempZone/home")

# authentication
iauth("rods", "rods")

# some data
foo <- data.frame(x = c(1, 8, 9), y = c("x", "y", "z"))

# store
isaveRDS(foo, "foo.rds")

# add metadata
imeta(
  "foo.rds",
  "data_object",
  operations =
    list(
      list(operation = "add", attribute = "bar", value = "baz")
  )
)

# search for objects by metadata
iquery("SELECT COLL_NAME, DATA_NAME WHERE META_DATA_ATTR_NAME LIKE 'bar%'")
#>             COLL_NAME DATA_NAME
#> 1 /tempZone/home/rods   foo.rds

# delete object
irm("foo.rds", force = TRUE)