Learn R Programming

Rlabkey (version 3.3.0)

getSchema: Returns an object representing a LabKey schema

Description

Creates and returns an object representing a LabKey schema, containing child objects representing LabKey queries

Usage

getSchema(session, schemaIndex)

Value

an object representing the schema. The named elements of a schema are the queries within that schema.

Arguments

session

the session key returned from getSession

schemaIndex

the name of the schema that contains the table on which you want to base a query, or the number of that schema as displayed by print(session)

Author

Peter Hussey

Details

Creates and returns an object representing a LabKey schema, containing child objects representing LabKey queries. This compound object is created by calling labkey.getQueries on the requested schema and labkey.getQueryDetails on each returned query. The information returned in the schema objects is essentially the same as the schema and query objects shown in the Schema Browser on LabKey Server.

References

https://www.labkey.org/Documentation/wiki-page.view?name=querySchemaBrowser

See Also

getSession

Examples

Run this code
if (FALSE) {

## the basics of using session, schema, and query objects
# library(Rlabkey)

s<- getSession(baseUrl="http://localhost:8080/labkey",
    folderPath="/apisamples")

sch<- getSchema(s, "lists")

# can walk down the populataed schema tree from schema node or query node
sch$AllTypes$Category
sch$AllTypes$Category$caption
sch$AllTypes$Category$type

# can add fields from related queries
lucols <- getLookups(s, sch$AllTypes$Category)

cols <- c(names(sch$AllTypes[2:6]), names(lucols)[2:4])

getRows(s, sch$AllTypes, colSelect=cols)

}

Run the code above in your browser using DataLab