Skip to content
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

Use --include-range-class-descendants flag in JSON Schema generator calls #2083

Merged

Conversation

pkalita-lbl
Copy link
Collaborator

These changes are related to the issues uncovered while trying to integrate [email protected] into nmdc-runtime (microbiomedata/nmdc-runtime#560)

The immediate cause of the problem was that the WorkflowExecutionActivity class became abstract while still being used as the range of the activity_set slot. This isn't necessarily wrong from a modeling perspective, but it does cause some confusing in LinkML's JSON Schema generator. The generator is more equipped to handle this situation when the --include-range-class-descendants flag is used. This flag instructs the generator to do more work in flattening out the class hierarchy in defined in the LinkML schema when going to the JSON Schema representation (which has no concept of class hierarchy). Arguably this should be the default for the JSON Schema generator, but I need to work that out on the LinkML side.

These changes also add a new unit test that make sure that both JSON Schema artifacts generated from the schema are compatible with the fastjsonschema library that nmdc-runtime uses. This will give us an earlier failure if something similar crops up again.

Verified

This commit was signed with the committer’s verified signature.
pkalita-lbl Patrick Kalita
…chema`

Verified

This commit was signed with the committer’s verified signature.
pkalita-lbl Patrick Kalita
Copy link

PR Preview Action v1.4.7
🚀 Deployed preview to https://microbiomedata.github.io/nmdc-schema/pr-preview/pr-2083/
on branch gh-pages at 2024-06-20 20:22 UTC

Copy link
Member

@turbomam turbomam left a comment

Choose a reason for hiding this comment

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

I haven't run this locally, but since it passes the GHA checks and if you think the test really tests what needs to be tested, then I approve!

@pkalita-lbl pkalita-lbl merged commit 82b558d into main Jun 21, 2024
3 checks passed
@pkalita-lbl pkalita-lbl deleted the bugfix-use-include-range-class-descendants-in-gen-json-schema branch June 21, 2024 16:02
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.

None yet

2 participants