view tools/SADI-Docker/SADI-Docker-tab2rdf.xml @ 0:54c48f9ca32b default tip

first release
author Mikel Egana <mikel.egana.aranguren@gmail.com>
date Fri, 04 Sep 2015 23:24:45 +0200
parents
children
line wrap: on
line source

<tool id="SADI-Docker-tab2rdf" name="SADI - Tab-to-RDF" version="0.1">
  
  <!-- Modified by Mikel EgaƱa Aranguren, very hacky -->
  
  <description>Converter</description>
  
  	<requirements>
	  <container type="docker">mikeleganaaranguren/sadi:v6</container>
	</requirements>
  <command>
    #if $namespace.choose_namespace=="none"
      python /sadi/tab2rdf.py $input_file $output_file $output_format none
      #for $i in $triples
        ${i.s_col} ${i.p_val} ${i.o_col} ${i.o_type}
      #end for
    #else
      python /sadi/tab2rdf.py $input_file $output_file $output_format $namespace.choosen_namespace
      #for $i in $triples
        ${i.s_col} ${i.p_val} ${i.o_col} ${i.o_type}
      #end for  
    #end if
  </command>
  <inputs>
    <param name="input_file" type="data" format="tabular" label="Input File (tabular)"/>
    
    <conditional name="namespace">
      <param name="choose_namespace" type="select" label="Add namespace?">
        <option value="none">No (The tab file includes complete URIs for each resource)</option>
        <option value="yes_choose_namespace">Yes</option>
      </param>
      <when value="yes_choose_namespace">
        <param name="choosen_namespace" type="text" size="50" value="http://localhost/" label="Namespace" />
      </when>
    </conditional>
    
    <param name="output_format" type="select" label="Output Format">
      <option value="ntriples">N-Triples</option>
      <option value="turtle">Turtle</option>
      <option value="rdfxml">RDF/XML</option>
    </param>
    <repeat name="triples" title="Triples">
      <param name="s_col" type="data_column" data_ref="input_file" label="Subject (column)" />
      <param name="p_val" type="text" size="50" value="a" label="Predicate (text)">
	<sanitizer sanitize="False"/>
      </param>
      <param name="o_col" type="data_column" data_ref="input_file" label="Object (column)" />
      <param name="o_type" label="Check if this object is Literal (Keep unchecked if this object is URI)" type="boolean" truevalue="1" falsevalue="0" checked="False"/>
    </repeat>
  </inputs>
  <outputs>
    <data name="output_file" format="rdf" label="${tool.name} on ${on_string}"/>
  </outputs>
  <help>
    
**Important note**

This is a modified version of Tab2RDF, local to SADI-Docker-Galaxy (http://github.com/mikel-egana-aranguren/SADI-Docker-Galaxy).

**What it does**

Sample Input::

    name     age  superviser
    Micheal  42   John
    Anne     30   Micheal

Sample Parameters::

    Namespace - 'http://localhost/'
    Triple 1 - c1 'age' c2(literal)
    Triple 2 - c3 'supervises' c1(URI)

Sample Output::

    &lt;http://localhost/Michael&gt; &lt;http://localhost/age&gt; "42"
    &lt;http://localhost/Anne&gt; &lt;http://localhost/age&gt; "30"
    &lt;http://localhost/John&gt; &lt;http://localhost/supervises&gt; &lt;http://localhost/Micheal&gt;
    &lt;http://localhost/Micheal&gt; &lt;http://localhost/supervises&gt; &lt;http://localhost/Anne&gt;

**Output Format**

Output RDF format is N-Triples by default.

  </help>
</tool>