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

BloodGroup example from Data Connect specification #2

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

jfuerth
Copy link
Contributor

@jfuerth jfuerth commented Apr 13, 2021

This type has been mentioned in the Data Connect (formerly Seach) specification for some time. Adding it here as suggested in ga4gh-discovery/data-connect#96.

allOf:
- "$ref": "https://schemablocks.org/schemas/sb-phenopackets/v1.0.0/OntologyClass.json#/properties"
- properties:
id:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm... IMO the correct way would be to reference https://schemablocks.org/schemas/sb-phenopackets/current/OntologyClass.json#properties So you would have

type: array
items:
  $ref: "https://schemablocks.org/schemas/sb-phenopackets/current/OntologyClass.json#properties"

... and then have a note about the option in the description. But this, actually, shows the shortcomings of the subtractive model in JSON Schema where it is (AFAIK) harder then to both recycle an object, but specify its values; your direct definition is more compact...

A testing middle-way would be to use your definition, but with the OntologyClass id, label syntax. But I'm no specialist on JSON Schema...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review and feedback! The model I submitted was meant to do these things:

  1. Specify that the attribute is an OntologyClass
  2. Accept OntologyClass objects that are HPO BloodGroups, like { "id": "HP:0032442", "label": "O"}
  3. Reject OntologyClass objects that are not HPO BloodGroups, like { "id": "HP:0040068", "label": "Abnormality of limb bone"}

Under the id property, the allOf array with const & title entries is just an alternative way of modelling an enum while being able to label each enumerated constant. JSON Schema's enum doesn't allow attaching any kind of description to each enum constant, and this is apparently the recommended workaround.

I'm definitely not sure I did this the best way, or even in a good way :). Just wanted to follow up to clarify my intent.

I would love to be able to specify "this property is an OntologyClass which is a reachable subclass of HP:0032224 (ABO blood group)"... maybe we could come up with a technique for modelling this. Being able to link JSON Schemas to existing OWL ontologies could be really powerful.

Copy link
Contributor

@mbaudis mbaudis left a comment

Choose a reason for hiding this comment

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

Just merging, since playground & proposed status & discussions needed.

@mbaudis
Copy link
Contributor

mbaudis commented Apr 13, 2021

Mostly to challenge & test. Low-level status.

@mbaudis mbaudis closed this Apr 13, 2021
@mbaudis mbaudis reopened this Apr 13, 2021
@mbaudis mbaudis merged commit bd069fc into ga4gh-schemablocks:master Apr 13, 2021
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.

2 participants