Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document was last Last updated on 2023-09-1415

It This page is intended to describe the workflow required to build, edit, and update the data models model for MODEL-AD. Please ask questions to help clarification.

Data Modeling at Sage requires using two in-house tools: Schematic and the Data Curator App (DCA).

...

Code Block
pyenv install 3.10.1110
pyenv virtualenv 3.10.1110 schematicpy_3_10_1110
pyenv activate schematicpy_3_10_11
pyenv -m pip install schematic_3_10_11
pip install schematicpy

Edit Configuration

...

/wiki/spaces/SCHEM/pages/2473623559

...

The data model is defined in a table, then stored (i.e. serialized) in a JSON-LD schema.

The JSON-LD schema follows the specifications from Schema.org for attributes.

https://sagebionetworks.jira.com/wiki/spaces/SCHEM/pages/2473623559/The+Data+Model+Schema#A.-Schema-properties-and-relationships

Convert data model from CSV to JSONLD

schematic schema convert input.csv output.jsonld

...

Create Data Model

https://sagebionetworks.jira.com/wiki/spaces/SCHEM/pages/

...

2967568387/Guide+How+to+use+Schematic+for+Data+Model+

...

Development#Create-

...

a-

...

Data-

...

Schematic DB is a package used to ingress the manifests created by Schematic into a database.

  • Schematic DB will use any of these validation rules:

    • str

    • float

    • num

    • int

    • date

    • If the attribute has none of the above rules it use a string type

    • the attribute datatype will be determined based on the rule

Model

The data model is defined in a table, then stored (i.e. serialized) in a JSON-LD schema which specifies attributes as suggested by Schema.org.

/wiki/spaces/SCHEM/pages/2473623559

Build a Data Model

https://docs.google.com/presentation/d/129pSx58qDm7Y1OQmSSHKDq6tsoD3pW_gDRNXiX2rd0w/edit#slide=id.g13aaf3b8358_0_0

AD Data Models https://github.com/adknowledgeportal/data-models

...

/wiki/spaces/SCHEM/pages/2473623559

Recommendations

...

  • Draw a diagram. A diagram is a useful reference when developing the model.

  • Start small with a basic skeleton and then build.

  • Use schematic in dev mode to convert model to JSON-LD regularly to check for errors

...

The data model requires these columns:

  1. Attribute

  2. Description

  3. ValidValues

  4. DependsOn

  5. required

  6. source

  7. parent

  8. properties

  9. dependsOnComponent

Convert Data Model

https://sagebionetworks.jira.com/wiki/spaces/SCHEM/pages/2967568387/Guide+How+to+use+Schematic+for+Data+Model+Development#Convert-Data-Model

schematic schema convert model.csv

Schematic DB

https://sagebionetworks.jira.com/wiki/spaces/SCHEM/pages/2473623559/The+Data+Model+Schema#Schemas-and-Schematic-DB

Schematic DB is a package used to ingress the manifests created by Schematic into a database.

  • Schematic DB will use any of these validation rules:

    • str, float, num, int, date

    • If no rule provided, defaults to a string type

    • the attribute datatype is based on the rule

Example Model

...