Open cmungall opened 8 years ago
http://jsonmodels.readthedocs.org/en/latest/readme.html
allows you to go from an OM to JSONSchema - but not vice versa.
from 2012: http://stackoverflow.com/questions/12465588/convert-a-json-schema-to-a-python-class
warlock or this: https://github.com/cwacek/python-jsonschema-objects
I have two experimental branches towards this effort:
Jsonschema validates the omim and variant example, accurately fails on the journal example since we're using "human" instead of "patient." However, the patient example fails due to:
KeyError: 'urn:jsonschema:org:monarchinitiative:ppk:model:condition:TemporalRegion'
urllib.error.URLError:
I assume this has to do with the lines $ref: urn:jsonschema... jsonschema attempts to resolve the url and fails.
Similarly, python-jsonschema-objects fails when loading the schema:
builder = jsonobjects.ObjectBuilder(self.schema)
Exception: urllib.error.URLError:
I'm not familiar with JSONschema enough to know if the use of $ref and referring to an object within the schema is legal and this is a bug in these packages, or if we're using this incorrectly.
Update: this is fixed by changing $ref to id, or we could alternatively follow this pattern of internal referencing.
Bindings can be made automatically based on schema def, depends on this ticket:
https://github.com/phenopackets/phenopacket-format/issues/31