Skip to content

Conversation

@andrewelamb
Copy link
Contributor

@andrewelamb andrewelamb commented Dec 30, 2025

Problem:

The Data Model documentation wasn't quite accurate.
The Parent column wasn't described.
The Validation Rules column wasn't listed as required.
These columns were required by the DataModelRelationships class, but aren't for JSON Schema creation:

  • DependsOn Component
  • Properties
  • Source

Solution:

The documentation has been updated.

These columns are no longer required:

  • DependsOn Component
  • Properties
  • Source

Note: I tried to make ValidationRules not required, but doing so broke a lot of tests. There may be a bug here. This will need to be resolved in SYNPY-1693

@andrewelamb andrewelamb requested a review from a team as a code owner December 30, 2025 20:17
Copy link
Member

@BryanFauble BryanFauble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 comment but lgtm

Defining data types:

- Put a unique data type name in the `Attribute` column.
- Put the value `DataType` in the `Parent` column.
Copy link
Contributor

Choose a reason for hiding this comment

The 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 Parent column is only used for data visualization, so it shouldn’t be required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh never mind. I tried without Parent column and got an error:

 File "/Users/lpeng/code/synapsePythonClient/synapseclient/extensions/curator/schema_generation.py", line 606, in check_schema_definition
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Schema extension headers: {'DependsOn', 'Format', 'Description', 'Source', 'DependsOn Component', 'Pattern', 'Valid Values', 'Maximum', 'Required', 'Minimum', 'Attribute', 'Properties', 'columnType', 'Validation Rules'} do not match required schema headers: ['Attribute', 'Description', 'Valid Values', 'DependsOn', 'Required', 'Parent', 'Validation Rules']
(

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 dependsOn column but are only there for conditional dependencies. If you go down to the Conditional Dependencies section example, Patient is an actual data type, but Cancer isn't. They both have
dependsOn values. So the way to tell them apart is by setting the Parent value. This is used by generate_json_schema when the user doesn't submit a data type, which means to create a JSON Schema for every data type.

It's also required in the sense that the DataModelrelationships class throws an error if the column isn't present in the CSV.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for Valid Values, the parent colunm also needs to be filled

It doesn't for the purpose of creating JSON Schema (I just tried).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay got it. Thank you for explaining.. Maybe we should just change Parent column to DataType and just fill it with True or False in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 :)

Copy link
Contributor

@linglp linglp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your hard work. I left some minor comments.

@andrewelamb andrewelamb merged commit 0d7725b into SYNPY-1696 Dec 31, 2025
13 of 19 checks passed
@andrewelamb andrewelamb deleted the update_relationships branch December 31, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants