taverna-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Menaka Madushanka <menaka12...@gmail.com>
Subject Re: Taverna Language Command line tool - Command line option selection
Date Fri, 05 Jun 2015 10:53:54 GMT
Thank you very much Stian for the feed-back.

> What is [tool] here?

For convert, we have to give the output file format. I used tool here to
specify the converter which convert  to the specified format.
So that it will be like this.
       tavlang -C -wfdesc ../hello.t2flow ../output/
       tavlang -C -r -json ../toConvert/ ../output/

You should not generally need to specify the format of the input as
> that is auto-guessed by WorkblowBundleIO. But how do you specify the
> output format?

 tavlang -C -wfdesc ../hello.t2flow ../output/
-wfdesc - will be the output format

So I'll change
      *-C --convert [tool] [options] [input] [output]  *
*into*
      *-C --convert [output format] [options] [input] [output]  *

Hm, where is -i used?

These were my first suggestions:

I created a simple command line argument setup for the language.
> Here is the usage
>      usage: tverna [-option] [arguments]
>                 -c,--convert <format> <workflow_file>   Convert workflows
> into the given  format
>                 -h,--help                               Display help
> information
>                 -i,--inspect <workflow_file>            Inspect the
> workflow
>                 -o,--optional                           Execute some other
> Commands
>                 -v,--validate <workflow_file>           Validate the
> workflow
>
> <format> the formats used in command line prototypes.
>
> For this Alan gave me some feed-backs.

I would expect -o to choose the _output_ file. Do you have exampes of what
> could be executed? -x would be a better choice.
>
> I do not think -i is a good idea for inspect as it suggests _input_ to me.
>
> -v is normally used for _version_


So I did some modifications. :-)

And should this not be --inspect with double-dash?

Yes. That is a mistake.

I'm not sure -r makes sense for inspect -- if you inspect multiple
> workflows, how do you know which output is from which workflow?

I thought of writing the results to a text file with the same name of the
inspected file.


Where  can I see those examples..?

I referred to the sculf2-examples
https://github.com/apache/incubator-taverna-language/tree/master/taverna-scufl2-examples

I created a simple working model of the tool with those options but I
didn't commit it. I'll do the modifications and commit so that it'l be easy.

I used commons-cli for parsing command line arguments.

I'll update the Readme.md file.

Cheers
Menaka

On 4 June 2015 at 21:21, Stian Soiland-Reyes <stain@apache.org> wrote:

> On 2 June 2015 at 09:49, Menaka Madushanka <menaka12350@gmail.com> wrote:
> > Hi everyone,
> >
> > These are the basic commands that I have decided for the tool...
>
>
> Hi!
>
> This is a good draft!
>
> Perhaps you could use it as a starting point for your README.md
> documentation - that way we are discussing and documenting at the same
> time :)
>
>
> > -C --convert [tool] [options] [input] [output]
> >
> > Options that can be used:
> >       -r - for convert recursively (workflows in a directory)
> >       -V validate and convert
> >
> > For input
> >       -single file or
> >       -a directory. (recursive case)
> >
> > For output
> >       -the directory where the converted file should be saved.
>
> What is [tool] here? I thought '--convert' would be the tool (or
> "command" if you like).
>
>
> So I guess this should do for instance *.t2flow converted to
> *.wfbundle, or *.wfbundle to *.wfdesc.
>
> Am I right in guessing these examples (I used 'tavlang' below, but a
> better name should be thought of!)?
>
>     tavlang --convert helloworld.t2flow .
>     tavlang --convert -r workflows/ converted/
>     tavlang --convert -V helloworld.t2flow validated/
>     tavlang --convert something.combine something.bundle.zip
>
> You should not generally need to specify the format of the input as
> that is auto-guessed by WorkblowBundleIO. But how do you specify the
> output format?
>
>
> WorkblowBundleIO does not understand research object bundles (as they
> are not necessarily workflow bundles), so basically the tool has to
> dispatch to either WorkblowBundleIO or
> Bundles (unless we simply split out the bundle support to a different
> command)
>
>
> Perhaps that needs to be checked first with BundleFileTypeDetector
> (which inspects the 'mimetype' file)
>
>
> https://github.com/apache/incubator-taverna-language/blob/master/taverna-robundle/src/main/java/org/apache/taverna/robundle/fs/BundleFileTypeDetector.java
>
> - if that fails than you can assume it is a workflow and give it to
> WorkblowBundleIO.readBundle() which does its own guessing if the
> mediaType parameter is null (or use guessMediaTypeForSignature()
> explicitly).
>
>
>
>
>
>
> > -I -inspect [option] [tool] [input] [output]    <insted of -i which used
> > ealier>
>
> Hm, where is -i used?
>
> And should this not be --inspect with double-dash?
>
> > Available tools:
> >     -processornames
> >     -servicetypes
>
> Perhaps we should call this [report] or something rather than [tool].
>
> > Input is the workflow file
> >
> > -V --validate [option] [input] <insted of -v>
>
> > -r --recursive Convert/ validate/ inspect the workflows in a given
> directory
>
> I'm not sure -r makes sense for inspect -- if you inspect multiple
> workflows, how do you know which output is from which workflow?
>
> Is it possible to do validation without an inspection report?  Perhaps
> --validate should be a top-level option instead of part of --inspect.
>
>
> > -v --version
> >
> > -h --help
>
> Yes, those are good options to support. -v is often "--verbose", to
> enable logging. We didn't say anything about that.. I'm not sure if we
> really have much logging in this code currently.
>
>
> >
> ----------------------------------------------------------------------------------
> > Conversion ---
> > As stated in examples there are options to convert .t2flow into
> *.wfbundle
> > and *.json.
>
> Where  can I see those examples..?
>
> > in wfdesc module: convert *.t2flow and *.wfbundle files into wfdesc.ttl
> > in Robundle module: convert the given formats into robundle.
> >
> > *** Are there any other formats that can be converted?
>
>
> For workflows you can call
> io = new WorkflowBundleIO();
> io.getSupportedWriterMediaTypes();
> io.getWriters();
>
> ..to get a list of supported media types and writers.
>
> See:
>
>
> https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/io/WorkflowBundleIO.java#L198
>
> https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/io/WorkflowBundleWriter.java
>
> The supported types are listed here:
>
> https://github.com/apache/incubator-taverna-language/tree/master/taverna-scufl2-api#usage
>
> Specifying the media type like
> "application/vnd.taverna.scufl2.workflow-bundle" is however not very
> user-friendly..
>
> The WorkflowBundleWriter does not currently proide any kind of
> short-name like "wfdesc" -- perhaps you would like to add this in a
> patch - that would be more extensible than making an additional fixed
> Map within the command line tool.  (But feel free to start with such a
> map!)
>
>
> For reference, here are a couple of the writers:
>
> https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-wfdesc/src/main/java/org/apache/taverna/scufl2/wfdesc/WfdescWriter.java
>
> https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-wfbundle/src/main/java/org/apache/taverna/scufl2/rdfxml/RDFXMLWriter.java
>
> (you should not need to reference these explicitly, just pass their
> media-type to WorkflowBundleIO).
>
>
> > Insection --
> >      There are 2 tools:
> >         1. processornames
> >         2. servicetypes
> >
> > Are there any more commands that are to be implemented?
>
> Probably, but I think those are good to start with. :)
>
>
> > For validation .....
> > What are the formats that can be used and what is the output format?
>
> We have not got validation for RO Bundles, just for workflow bundles.
> So any of those that can load in the table can be given.
>
> For the output format I think you will have to just construct some
> System.out strings or come up with something semi-structured - Alan
> might know more. A JSON output would be ideal.. but I think defining
> that could take some time.
>
>
> --
> Stian Soiland-Reyes
> Apache Taverna (incubating), Apache Commons RDF (incubating)
> http://orcid.org/0000-0001-9842-9718
>



-- 
Menaka Madushanka Jayawardena
Faculty of Engineering, <http://www.pdn.ac.lk/eng>
University of Peradeniyaya.
LinkedIn <http://lk.linkedin.com/in/menakajayawardena>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message