-
Notifications
You must be signed in to change notification settings - Fork 73
Update relationships #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update relationships #1298
Changes from 2 commits
15ba0d3
44e58e2
8caa98f
04336df
e0294c6
076e521
2158fdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,8 +15,8 @@ The CSV data model described in this tutorial formalizes this structure: | |
|
|
||
| Here is the Patient described above represented as a CSV data model: | ||
|
|
||
| | Attribute | DependsOn | | ||
| |---|---| | ||
| | Attribute | DependsOn | | ||
| |-----------|---------------------| | ||
| | Patient | "Age, Gender, Name" | | ||
| | Age | | | ||
| | Gender | | | ||
|
|
@@ -48,9 +48,20 @@ The end goal is to create a JSON Schema that can be used in Curator. A JSON Sche | |
|
|
||
| Note: Individual columns are covered later on this page. | ||
|
|
||
| These columns must be present in your CSV data model: | ||
|
|
||
| - `Attribute` | ||
andrewelamb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `DependsOn` | ||
| - `Description` | ||
| - `Valid Values` | ||
| - `Required` | ||
| - `Parent` | ||
| - `Validation Rules` | ||
|
|
||
| Defining data types: | ||
|
|
||
| - Put a unique data type name in the `Attribute` column. | ||
| - Put the value `DataType` in the `Parent` column. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you confirm whether this step is required? If I remember correctly, the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh never mind. I tried without
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's required in the sense that it's how we differentiate between actual data types and other things that have attributes in the It's also required in the sense that the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It doesn't for the purpose of creating JSON Schema (I just tried).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay got it. Thank you for explaining.. Maybe we should just change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would probably be the best way to do it if we were starting from scratch :) |
||
| - List at least one attribute in the `DependsOn` column (comma-separated). | ||
| - Optionally add a description to the `Description` column. | ||
|
|
||
|
|
@@ -79,8 +90,8 @@ Set of possible values for the current attribute. This attribute will be an enum | |
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | Valid Values | | ||
| |---|---|---| | ||
| | Patient | "Gender" | | | ||
| |-----------|-----------|-----------------------| | ||
| | Patient | "Gender" | | | ||
| | Gender | | "Female, Male, Other" | | ||
|
|
||
| JSON Schema output: | ||
|
|
@@ -107,8 +118,8 @@ Note: Leaving this empty is the equivalent of `False`. | |
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | Required | | ||
| |---|---|---| | ||
| | Patient | "Gender, Age" | | | ||
| |-----------|----------------|----------| | ||
| | Patient | "Gender, Age" | | | ||
| | Gender | | True | | ||
| | Age | | False | | ||
|
|
||
|
|
@@ -131,6 +142,10 @@ JSON Schema output: | |
| } | ||
| ``` | ||
|
|
||
| ### Parent | ||
|
|
||
| This is mostly a remnant of the Schematic data model. It is currently used to find all the data types in the data model. Put the value `DataType` in this column if this row is a data type. Other vlaues are currently ignored. | ||
andrewelamb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### columnType | ||
|
|
||
| The data type of this attribute. See [type](https://json-schema.org/understanding-json-schema/reference/type). | ||
|
|
@@ -147,11 +162,11 @@ Must be one of: | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | | ||
| |---|---|---| | ||
| | Patient | "Gender, Hobbies" | | | ||
| | Gender | | string | | ||
| | Hobbies | | string_list | | ||
| | Attribute | DependsOn | columnType | Parent | | ||
| |-----------|-------------------|-------------|----------| | ||
| | Patient | "Gender, Hobbies" | | DataType | | ||
| | Gender | | string | | | ||
| | Hobbies | | string_list | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -196,11 +211,11 @@ The format of this attribute. See [format](https://json-schema.org/understanding | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Format | | ||
| |---|---|---|---| | ||
| | Patient | "Gender, Birth Date" | | | | ||
| | Gender | | string | | | ||
| | Birth Date | | string | date | | ||
| | Attribute | DependsOn | columnType | Format | Parent | | ||
| |-----------------|----------------------|-------------|--------|----------| | ||
| | Patient | "Gender, Birth Date" | | | DataType | | ||
| | Gender | | string | | | | ||
| | Birth Date | | string | date | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -229,11 +244,11 @@ The regex pattern this attribute must match. The type of this attribute must be | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Pattern | | ||
| |---|---|---|---| | ||
| | Patient | "Gender, ID" | | | | ||
| | Gender | | string | | | ||
| | ID | | string | [a-f] | | ||
| | Attribute | DependsOn | columnType | Pattern | Parent | | ||
| |-----------|---------------|-------------|---------|----------| | ||
| | Patient | "Gender, ID" | | | DataType | | ||
| | Gender | | string | | | | ||
| | ID | | string | [a-f] | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -262,12 +277,12 @@ The range that this attribute's numeric values must fall within. The type of thi | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Minimum | Maximum | | ||
| |---|---|---|---|---| | ||
| | Patient | "Age, Weight, Health Score" | | | | | ||
| | Age | | integer | 0 | 120 | | ||
| | Weight | | number | 0.0 | | | ||
| | Health Score | | number | 0.0 | 1.0 | | ||
| | Attribute | DependsOn | columnType | Minimum | Maximum | Parent | | ||
| |--------------|-----------------------------|-------------|---------|---------|----------| | ||
| | Patient | "Age, Weight, Health Score" | | | | DataType | | ||
| | Age | | integer | 0 | 120 | | | ||
| | Weight | | number | 0.0 | | | | ||
| | Health Score | | number | 0.0 | 1.0 | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -301,9 +316,9 @@ JSON Schema output: | |
|
|
||
| ### Validation Rules (deprecated) | ||
|
|
||
| This is a remnant from Schematic. It is still used (for now) to translate certain validation rules to other JSON Schema keywords. | ||
| This is a remnant from Schematic. It is still required and in use (for now) to translate certain validation rules to other JSON Schema keywords. | ||
|
|
||
| If you are starting a new data model, DO NOT use this column. | ||
| If you are starting a new data model, DO NOT fill out this column, just leave it blank. | ||
|
|
||
| If you have an existing data model using any of the following validation rules, follow these instructions to update it: | ||
|
|
||
|
|
@@ -315,26 +330,27 @@ If you have an existing data model using any of the following validation rules, | |
|
|
||
| ## Conditional dependencies | ||
|
|
||
| The `DependsOn` and `Valid Values` columns can be used together to flexibly define conditional logic for determining the relevant attributes for a data type. | ||
| The `DependsOn`, `Valid Values` and `Parent` columns can be used together to flexibly define conditional logic for determining the relevant attributes for a data type. | ||
|
|
||
| In this example we have the `Patient` data type. The `Patient` can be diagnosed as healthy or with cancer. For Patients with cancer we also want to collect info about their cancer type, and any cancers in their family history. | ||
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | Valid Values | Required | columnType | | ||
| |---|---|---|---|---| | ||
| | Patient | "Diagnosis" | | | | | ||
| | Diagnosis | | "Healthy, Cancer" | True | string | | ||
| | Cancer | "Cancer Type, Family History" | | | | | ||
| | Cancer Type | | "Brain, Lung, Skin" | True | string | | ||
| | Family History | | "Brain, Lung, Skin" | True | string_list | | ||
| | Attribute | DependsOn | Valid Values | Required | columnType | Parent | | ||
| |----------------|-------------------------------|---------------------|----------|-------------|----------| | ||
| | Patient | "Diagnosis" | | | | DataType | | ||
| | Diagnosis | | "Healthy, Cancer" | True | string | | | ||
| | Cancer | "Cancer Type, Family History" | | | | | | ||
| | Cancer Type | | "Brain, Lung, Skin" | True | string | | | ||
| | Family History | | "Brain, Lung, Skin" | True | string_list | | | ||
|
|
||
| To demonstrate this, see the above example with the `Patient` and `Cancer` data types: | ||
|
|
||
| - `Diagnosis` is an attribute of `Patient`. | ||
| - `Diagnosis` has `Valid Values` of `Healthy` and `Cancer`. | ||
| - `Cancer` is also a data type. | ||
| - `Cancer Type` and `Family History` are attributes of `Cancer` and are both required. | ||
| - `Patient` is a data type, but `Cancer` is not, as defined by the `Parent` column. | ||
andrewelamb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| As a result of the above data model, in the JSON Schema: | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Attribute,Description,Valid Values,DependsOn,Required,Parent,Validation Rules | ||
| datatype,,,attribute,,DataType, | ||
| attribute,,,,TRUE,DataProperty, |
Uh oh!
There was an error while loading. Please reload this page.