Getting Started with Gaia

For background information on Gaia, see the Gaia Overview. For an explanation of the Gaia architecture, see the Framework Overview.

Installation

To get started with Gaia you’ll need to install gaiaCore (R Package) from GitHub, create a PostGIS database and load the metadata source files, and then connect to the database from your R environment:


gaiaCore (R Package)

  1. See the instructions here for configuring your R environment, including RTools and Java.

  2. You can install the latest version of gaiaCore (R Package) from GitHub with:

# install.packages("remotes")

remotes::install_github("OHDSI/GIS")


PostGIS Database (Catalog and Staging)

Once you have a postgres database with PostGIS installed, the helper script initialize.sql in the inst directory will do the rest of the setup. This includes:

  1. Creating a schema named “backbone”
  2. Creating the tables described in the backbone specification and sequences for autoincrementing identifiers.
  3. Inserting Gaia Catalog metadata (IMPORTANT: script assumes the files ‘./csv/data_source.csv’ and ‘./csv/variable_source.csv’ exist relative to ‘initialize.sql’, as they do in the inst directory) 4.Populating the geom_index and attr_index

Connecting the Database to R

  1. Create a connection from your R environment to the PostGIS database. This can be done using the DatabaseConnector package:
library(gaiaCore)

connectionDetails <- DatabaseConnector::createConnectionDetails(
  dbms = "postgresql",
  server = "localhost/gaiaDB",
  port = 5432,
  user="postgres",
  password = "mysecretpassword")