-
Notifications
You must be signed in to change notification settings - Fork 212
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
json-schema for json export #125
Comments
For an update, I've decided not to use .escher filenames. Instead, every JSON map starts with an informative section, so you can see what the file is in a text editor. E.g.,
|
I think that makes sense. (Also FYI your schema url doesn't resolve) On Mon, Oct 6, 2014 at 2:52 PM, Zachary King notifications@github.com
|
Yeah. It isn’t live yet. On Mon, Oct 6, 2014 at 6:20 PM, Ali Ebrahim notifications@github.com
|
Actually, the link WAS wrong. Here's a correct one: https://zakandrewking.github.io/escher/escher/jsonschema/1-0-0# |
Speaking of this, can you tell me if I am on the right track with a spec file (still incomplete)
|
Yeah. That's the basic idea. You might need the equivalents of these attributes on the top level for it to validate:
And for array, you need to wrap it in an "object", like this:
|
Noted. Thanks. On Mon, Oct 20, 2014 at 12:55 PM, Zachary King notifications@github.com
|
Ok, regarding #170, why would you have an annotation attribute for metabolites and not for reactions? SBML would also be ok but much harder to implement I guess. I generated a couple of universal models from metanetx and using cobrapy's reaction.annotation was pretty useful in that respect. Is there any specific reason to not include this in the JSON spec? |
There isn't really a good reason not to include it in the JSON spec, other than "laziness." If it makes your life easier, we can include this in the JSON format (from the cobrapy perspective, not sure about the escher perpsective). I brought up SBML for storage of these efforts for a kind of different reason: in my quest to make cobrapy more "maintainable", I wanted to focus on specific use cases for each of the supported I/O formats to avoid duplication of effort and features: SBML - general purpose storage of models If we go with this, it would make sense for SBML to be the places where features like this get supported. While working with SBML files and all their various flavors is often a pain (and getting support for features we need will probably take way too much time and effort), the unfortunate fact is that it is the standard for modeling, and cobra should probably "play ball" and use it. I'd like to know your general thoughts on this, @zakandrewking and @phantomas1234 @phantomas1234 What are your use cases for reaction.annotation? Was it something like |
Laziness doesn't really count though because I served you the PR on a golden platter 😃 @aebrahim I guess I was not aware that the JSON schema was primarily intended for escher (given that bigg.ucsd.edu currently doesn't serve SBML via the API I thought the JSON models would be a good way to serialize models). In principle I agree that SBML should be the standard for storing models (if they can be read fast enough). pickles are just too large and too slow to read. I found the JSON files to be very convenient for non-sharing serialization. Anyways, I just hacked my way around it by adding annotation myself to |
Yeah I'm just that lazy :) In all seriousness though, Zak and I have talked about updating the JSON format anyways, and I'd like to do them at the same time (so the format only has to change once), so this wouldn't get merged until that is finalized. SBML I/O is now a lot faster than it used to be with libsbml (by a factor of 2-3x for large models like iJO1366). And yes, I definitely intend to consult Andreas on how to do this for SBML. Can you send me an example of the type of annotation you have with your models? |
Also, I don't think the new bigg serves JSON models via the api. They're treated just like the SBML models (static exported files). |
Some comments:
|
OK. So looks like this should definitely get merged. On Tue, Jul 21, 2015 at 6:22 PM, Zachary A. King notifications@github.com
|
The defined format changed a few things in a compatible way by marking some attributes as optional. This fixes opencobra#125
The defined format changed a few things in a compatible way by marking some attributes as optional. This fixes opencobra#125 and replaces opencobra#170
To ensure the long-term viability of exported JSON models, it would be good to define a schema for them. json-schema lets you define these easily, and validators are available in a number of languages, including Python and JavaScript.
Escher will use json-schema for defining the Escher map file format. We can also consider .escher and .cobra filename extensions to clarify which file is which.
I can help out with this.
The text was updated successfully, but these errors were encountered: