Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The first way RDS allows users to select variables is through the well known and traditional way of specifying variable names. If we know the variables we want to work with this is a great way to quickly subset our data. This is done through the use of the the cols parameter parameter, which takes a comma separated list of values.

Code Block
titleQuery by Variable Names
http://{host}/rds/api/catalog/{collection}/{view}/select?cols=col1,col2,col3,... 

Query by Regular Expression

User Users can also use regular expressions to select variables. Regular expressions can be used on views that have minimal metadata. Again we will use the cols parameter for this, but rather than specifying a specific name we will use a regular expression. Multiple regular expressions can be passed in using the same comma separated list of values if desired. Users can also combine regular expressions with specific variable names.

Code Block
titleQuery by Regular Expression
http://{host}/rds/api/catalog/{collection}/{view}/select?cols={regex}

Query by Keyword

Key words are another way to search for variables. When selecting variables by keywords it is important to have good metadata backing the variables. A variables name, label, description, and question text will be searched for the keyword and any and all matches will be returned. To search on keywords we will have to put a $ before the keyword we would like to search on in the cols cols parameter.

Code Block
titleQuery by Keyword
http://{host}/rds/api/catalog/{collection}/{view}/select?cols=$keyword 

...

All of the previously discussed techniques can be used at the same time if desired.

Code Block
titleQuery by Combination
http://{host}/rds/api/catalog/{collection}/{view}/select?cols=col1,col2,col3,{regex},$keyword 

...