More examples of parser_v1.0.py usage?
2
0
Entering edit mode
5.3 years ago
mcpherson ▴ 40

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 • 1.5k views
ADD COMMENT
1
Entering edit mode
>>> 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.

ADD REPLY
1
Entering edit mode
5.3 years ago

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.

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
1
Entering edit mode

It is a good question; it is a complicated system!

Yes, while working on the PR I made changes to schema_salad's codegen; see https://github.com/common-workflow-language/schema_salad/pull/263 which has been since merged. I did not make any changes to the schema salad description of CWL itself at this time.

ADD REPLY
0
Entering edit mode
5.3 years ago
mcpherson ▴ 40

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.

ADD COMMENT

Login before adding your answer.

Traffic: 2133 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6