On 2 June 2015 at 09:49, Menaka Madushanka <[email protected]> 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

Reply via email to