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

jsonschema oneOf -> linkml:union_of (slightly different definitions?) #107

Open
sierra-moxon opened this issue Oct 10, 2022 · 2 comments
Open

Comments

@sierra-moxon
Copy link
Member

Running schema-automator import-json-schema.
JSONSchema has a "oneOf" definition:
Screen Shot 2022-10-10 at 10 45 37 AM

schemauto -import-json-schema vrs.json results in:

Screen Shot 2022-10-10 at 10 45 55 AM

https://linkml.io/linkml-model/docs/union_of/
indicates that the domain element consists exactly of the members of the element in the range.

I think JSONSchema oneOf means "if the data matches any one of these independent schemas, then allow it, else fail" in terms of validation. The LinkML definition of union_of implies that the data must match all of the members in the array. Am I reading this correctly?

@sierra-moxon sierra-moxon changed the title jsonschema oneOf -> linkml:union_of (slightly different definitions) jsonschema oneOf -> linkml:union_of (slightly different definitions?) Oct 10, 2022
@cmungall
Copy link
Member

I think the linkml metamodel could be better specified, but they are essentially the same

however, since 1.3 it is better to map json schema composition (https://json-schema.org/understanding-json-schema/reference/combining.html) to linkml boolean operators https://linkml.io/linkml/faq/modeling.html#how-do-i-do-the-equivalent-of-json-schema-composition

@nlharris
Copy link
Contributor

So is this a bug, or does the documentation need improving, or what?

@sierra-moxon sierra-moxon transferred this issue from linkml/linkml Nov 18, 2022
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

No branches or pull requests

3 participants