Creating a New Data Schema or Data Schema Version

Creating a New Data Schema using the Rhino FCP UI

Navigate to the Data Schema Page

Project Dashboard.png

Use the left-hand navigation menu to click the Data Schemamenu item

 

Add a New Data Schema

Schema Main Interface.png

Create a new Data Schema by clicking on the Add New Data Schema button in the top right corner

 

Enter your New Data Schema Details

Create a New Schema.png

Fill in the following fields within the new modal window:

  1. Name: The name you would like to provide for your Data Schema
  2. Description: A description that will help you understand the nature of the Data Schema

 

[Option 1] Create a Blank Data Schema

Creating a Blank Schema.png

To create a blank Data Schema:

  1.  Click the Create New Data Schema button on the previous screen
  2. You will be brought to the Blank Data Schema Creator window, shown above
  3. Start from the top of each column and fill in the fields that are applicable to your data. For a brief refresher on Data Schema Field Attributes, Supported Data Schema Data Types, and/or Specifying Data Schema Field Permissions, click any of the previous links.
    • If you need to delete a variable (or column) from your data schema, click on the circle icon with the X inside (Delete Schema Feature.png) located at the top of each column
    • If you need to add another field to your Data Schema, click on the + Add Field button next to the top row of the table.
  4. When you have completed adding all your variables to your Data Schema, click the Save button in the top-right corner of the platform

 

[Option 2] Upload a Data Schema from File

Create Schema From File.png

To create a Data Schema by uploading a file:

    1. Select the Upload From File radio button
    2. Within the newly visible Data Schema CSV File input field, click the Select File button.  A filesystem dialog should appear
    3. Navigate to the data schema file and select Open to load the CSV file
    4. Finally, click the Create New Data Schema button to create your new Data Schema.

 

Creating a New Data Schema by Editing an Existing Data Schema within the Rhino FCP UI

Navigate to the Data Schema Page

Project Dashboard.png

Use the left-hand navigation menu to click the Data Schemamenu item

 

Select an Existing Data Schema to Create the New Version for

Schema Main Interface.png

Click on a Data Schema Version row that you would like to create a new version for

 

View the Existing Data Schema

Viewing a Schema.png

To create a new Data Schema version of the existing Data Schema you are currently viewing, click the Edit Data Schema button in the top-left corner of the platform

 

Edit the Existing Data Schema to Create the New Data Schema Version

Editing a Schema.png

Edit the Data Schema to create a new version:

  1. You will be brought to the edit Data Schema window, shown above
  2. Start from the top of each column and fill in or modify the fields that are applicable to your data. For a brief refresher on Data Schema Field Attributes, Supported Data Schema Data Types, and/or Specifying Data Schema Field Permissions, click any of the previous links.
    • If you need to delete a field from your Data Schema, click on the circle icon with the X inside (Delete Schema Feature.png) located at the top of each column
    • If you need to add another variable (or column) to your Data Schema, click on the + Add Field button next to the top row of the table.
  3. When you have completed adding all your variables to your Data Schema click the Save button in the top-right corner of the platform

 

Creating a New Data Schema Version within the Rhino FCP UI

To create a new version, make sure you are on the page containing the original object you would like to create a new version of.  In the box where your original object is in the upper right-hand corner, you should see a + New Version button, like the one shown below:

New Version Button.png

Click that button and a new dialog should appear that will allow you to create a new version of your object.

 

Creating a New Version in Every Interface within the Rhino FCP UI

Below is a GIF showing all the interfaces within the Rhino FCP application where you can create a new Version. It displays the Schemas, Cohorts, and Models pages and the + New Version button you will press to create that new version of the schema, cohort, or model you are looking to create.

new_version.gif

 

 

Creating a New Data Schema using the Rhino SDK

Prerequisites

Before starting this process, you should have already:

  1. Created a Project using the Rhino SDK or UI

 

Import your Python Dependencies

import rhino_health as rh
from rhino_health.lib.endpoints.data_schema.data_schema_dataclass import (
DataSchemaCreateInput,
SchemaVariables
)
import getpass

 

Remember to change all lines with CHANGE_ME comments above them in all the blocks below!

 

Log into the Rhino SDK using your FCP Credentials

Your username will be the email address you log into the Rhino FCP platform with. 

print("Logging In")

# CHANGE_ME: MY_USERNAME
my_username = "MY_USERNAME"
session = rh.login(username=my_username, password=getpass.getpass())
print("Logged In")

 

Get Supporting FCP Information Needed to Create Your Dataset

At this point, you will need the name of your Project, any dataset's name you would like to use as input, and your previously created Code Object's name. You can also retrieve each object's UUID by following the instructions here: How do I retrieve a Project's, Collaborator's, Data Schema's, Dataset's, Code Object's, or Code Run's UUID?

# CHANGE_ME: YOUR_FCP_PROJECT_NAME
project = session.project.get_project_by_name('YOUR_FCP_PROJECT_NAME')

workgroup = session.project.get_collaborating_workgroups(project.uid)[0]

 

[Option 1] Create Your Schema From a File

To create your Data Schema you will need to change several different pieces of information in the code block below.  The paths for file_path will be a local path in your development environment.

schema_params = DataSchemaCreateInput(
# CHANGE_ME: SCHEMA_NAME
name = "SCHEMA_NAME",

# CHANGE_ME: SCHEMA_DESCRIPTION
description = "SCHEMA_DESCRIPTION", primary_workgroup_uid = workgroup.uid,
# CHANGE_ME: FILE_PATH
file_path
= "FILE_PATH"
) schema = session.dataset.create_data_schema(schema_params) print(f"Created new dataset '{schema.name}' with uid '{schema.uid}'")

 

NOTE: If you have received an error or run into any issues throughout the process, please reach out to support@rhinohealth.com for more assistance.

Was this article helpful?
0 out of 0 found this helpful

Articles in this section