-
Notifications
You must be signed in to change notification settings - Fork 8
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
Docs for manipulating and serializing schemas #27
Comments
The workflow that I'm imagining from integration would involve either:
model = read_json_acset(LabelledPetriNet, "model.json")
framework_name = acset_name(model) (how to know that Then, to get the schema of the framework associated with the given model, I'd do as you described: s = acset_schema(constructor_for_LabelledPetriNet{Symbol}())
JSON3.write(s) However, how do I get the constructor for a given model framework if all I have its string name constructor_for_LabelledPetriNet = ???("LabelledPetriNet") I can do this but I'd need to have loaded the model: s = acset_schema(model)
JSON3.write(s) |
The name of a type is the constructor for that type. Given a string, if you want to look up what julia type that string refers to, I guess you could eval it. This doesn't handle the fact that you would need to have imported the right module into your namespace. For example But since this is related to designing software around schemas. It might be better if we just collected all the schemas and made a documentation page with the Catlab representation, edge list representation, and the graphviz drawing of the schema. Trying to do this at runtime seems weird, since after you get this information, you are going to do human initiated software development to customize the application to the schema, right? |
A documentation page with the schemas etc. could be quite handy. After we get this info, I think that's when the human user is going to start doing model operations (build, edit, transform, etc.) with constraints that we'd hypothetically infer from the schemas. |
I think you would have to put the parenthesis in there to get eval to try and call the constructor. |
From a conversation with Nelson in ASKEM:
This should be in the docs somewhere.
The text was updated successfully, but these errors were encountered: