This is a test version of Biostars. For the public version, visit https://www.biostars.org.
More examples of parser_v1.0.py usage?

Continuing my effort to parse CWL into a Neo4j graph database...

Michael pointed me at the automatically generated parser_v1.0.py code and some examples in the cwl-utils repository. These are pretty simple examples and I'm finding it a bit overwhelming to dig through the generated source and understand how it works. Are there any more complex examples out there? Any hidden documentation?

I looked at the cwltool repo, but it doesn't appear to use the auto-generated parser (and it's got way more features/complexity than I need). I think parser_v1.0.py might be what I require to get my job done. Any additional info/examples would be appreciated before I start to explore it via source examination and code probing.

Ref: Parse CWL to graph data structure or database?

python cwl parser
>>> import cwl_utils.parser_v1_0 as cwl
>>> help(cwl)

is helping. Doh!

More examples would still be useful. Another approach that I may look at: export to RDF and use rdflib to parse.

2 answers

https://github.com/common-workflow-language/cwl-utils/pull/5/files#diff-c2d1289b0a4afdb88cb4b82391c703b8 is quite advanced!

The same pull request includes some nice improvements to the autogenerated parser_v1.0.py for programatic CWL object creation.

Thanks for pointing me to that, Michael. Possible naive question:

If parser_v1_0.py is auto generated from some Schema Salad description, how is it that the parser_v1_0.py file is shown as edited in the pull request? Would that not require changes to the Schema Salad description (in another repo) and regeneration of the parser? I'm still trying to come to grips with the pieces of this CWL processing puzzle.

Anyway, I'll look at your new tool source to see how you used the parser.

For those coming here via search, I'm going to wrap up this thread and answer my own question:

Other than Michael's (much appreciated) answer above, I was unable to find any examples of using the auto-generated parser in "larger" projects. That doesn't mean that it isn't useful, though. For more context (parsing CWL to a graph), and hopefully more useful information, please see my answer to my other question.

Log in to answer this question.