Schema-based importing

What is a schema?

A schema is a formal formatted representation of data as defined in the Sparrow database. Schema define the reproducible structure that is entered into the database and allow for subsequent transformations of data and connection to other databases.

Sparrow's import schemas interface with its database schemas but are conceptually separate. Sparrow's import infrastructure allows JSON with an appropriate schema structure to be imported using the API.

Example schema from Sparrow

These schema examples are created using a simple API call.

Using schema for importing data

Reorganization of data to fit the schema is key. There are many ways to do this, the easiest is likely a Python script, although other languages like R have also been used.

Example code for an R reformater used on data from the WiscSIMS Lab is available in this Github file.

The API has examples of schemas

There is a command-line feature for seeing schema definitions: sparrow show-interface <name-of-interface>. This tells you how to assemble the correct JSON to import data.