Skip to content

Latest commit

 

History

History
84 lines (65 loc) · 2.53 KB

DATA_MODEL.md

File metadata and controls

84 lines (65 loc) · 2.53 KB

Data Model

A Data Model describes properties of a Table.

Data Model Format

The Data Model format follows JSON-Schema Draft 7.

Properties

Data Model properties describe attributes of Tables (e.g. a "subject" table may have an "age" property).

Properties can be defined:

  • inline or
  • externally by referencing a JSON-Schema definition

Examples

Here are sample Data Model definitions. For more information, visit the JSON-Schema website.

Inline Properties

This data model has one property, age, defined inline:

{
       "data_model": {
               "properties": {
                       "age" : {
                               "description": "age of a subject, in whole years",
                               "type": "number"
                       }
               }
       }
}
Externally Defined Properties

This data model defines its sole property, drs, by referring to an external data model: the Data Repository Service developed by the GA4GH Cloud Work Stream:

{
       "data_model": {
               "properties": {
                       "drs": {
                               "$ref": "http://schema.ga4gh.org/drs/0.1.0#/definitions/Object"
                       }
               }
       }
}
Mixing Both

This data model that contains both inline and externally referenced properties:

{
       "data_model": {
               "description": "A collection of subjects and their data objects",
               "properties": {
                       "subject": {
                               "type":"object",
                               "properties": {
                                       "id": {
                                               "description": "anonymous identifier of a subject",
                                               "type": "string"
                                       },
                                       "age": {
                                               "description": "age of a subject, in whole years",
                                               "type": "number"
                                       }
                               }
                       },
                       "drs": {
                               "$ref": "http://schema.ga4gh.org/drs/0.1.0#/definitions/Object"
                       }
               }
       }
}