Mica Search API

Yannick Marcon

2019-04-10

Mica provides some web services for searching content. The Mica R package exposes search related functions:

Setup the connection with Mica, login with anonymous user and default password (to be changed):

library(micar)
m <- mica.login(url="https://mica-demo.obiba.org")

Get the 10 first networks which datasets have variables matching the provided criteria:

mica.networks(m, query="variable(in(Mlstr_area.Lifestyle_behaviours,Drugs))", locale="en", from=0, limit=10)

Get the 100 first studies matching the provided study criteria:

mica.studies(m, query="study(in(Mica_study.methods-design,cohort_study))")

Study populations and data collection events (DCE) can also be queried:

mica.study.populations(m, query="study(in(Mica_study.methods-design,cohort_study))")
mica.study.dces(m, query="study(in(Mica_study.methods-design,cohort_study))")

Get some datasets which variables are about Drugs usage:

mica.datasets(m, query="variable(in(Mlstr_area.Lifestyle_behaviours,Drugs))")

Get the corresponding variables:

mica.variables(m, query="variable(in(Mlstr_area.Lifestyle_behaviours,Drugs))")

The search query expression is based on the declared taxonomies, vocabularies and terms. The following functions allow to query for terms matching some open text criteria, for instance get the vocabulary terms about cancer across all the variable taxonomies:

mica.vocabularies(m, target="variable", query="cancer", locale = "en")

Good practice is to free server resources by sending a logout request:

mica.logout(m)