0
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
1 <tool id="SADI-Docker-tab2rdf" name="SADI - Tab-to-RDF" version="0.1">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
2
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
3 <!-- Modified by Mikel EgaƱa Aranguren, very hacky -->
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
4
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
5 <description>Converter</description>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
6
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
7 <requirements>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
8 <container type="docker">mikeleganaaranguren/sadi:v6</container>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
9 </requirements>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
10 <command>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
11 #if $namespace.choose_namespace=="none"
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
12 python /sadi/tab2rdf.py $input_file $output_file $output_format none
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
13 #for $i in $triples
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
14 ${i.s_col} ${i.p_val} ${i.o_col} ${i.o_type}
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
15 #end for
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
16 #else
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
17 python /sadi/tab2rdf.py $input_file $output_file $output_format $namespace.choosen_namespace
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
18 #for $i in $triples
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
19 ${i.s_col} ${i.p_val} ${i.o_col} ${i.o_type}
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
20 #end for
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
21 #end if
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
22 </command>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
23 <inputs>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
24 <param name="input_file" type="data" format="tabular" label="Input File (tabular)"/>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
25
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
26 <conditional name="namespace">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
27 <param name="choose_namespace" type="select" label="Add namespace?">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
28 <option value="none">No (The tab file includes complete URIs for each resource)</option>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
29 <option value="yes_choose_namespace">Yes</option>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
30 </param>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
31 <when value="yes_choose_namespace">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
32 <param name="choosen_namespace" type="text" size="50" value="http://localhost/" label="Namespace" />
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
33 </when>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
34 </conditional>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
35
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
36 <param name="output_format" type="select" label="Output Format">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
37 <option value="ntriples">N-Triples</option>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
38 <option value="turtle">Turtle</option>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
39 <option value="rdfxml">RDF/XML</option>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
40 </param>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
41 <repeat name="triples" title="Triples">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
42 <param name="s_col" type="data_column" data_ref="input_file" label="Subject (column)" />
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
43 <param name="p_val" type="text" size="50" value="a" label="Predicate (text)">
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
44 <sanitizer sanitize="False"/>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
45 </param>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
46 <param name="o_col" type="data_column" data_ref="input_file" label="Object (column)" />
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
47 <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"/>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
48 </repeat>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
49 </inputs>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
50 <outputs>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
51 <data name="output_file" format="rdf" label="${tool.name} on ${on_string}"/>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
52 </outputs>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
53 <help>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
54
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
55 **Important note**
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
56
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
57 This is a modified version of Tab2RDF, local to SADI-Docker-Galaxy (http://github.com/mikel-egana-aranguren/SADI-Docker-Galaxy).
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
58
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
59 **What it does**
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
60
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
61 Sample Input::
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
62
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
63 name age superviser
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
64 Micheal 42 John
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
65 Anne 30 Micheal
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
66
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
67 Sample Parameters::
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
68
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
69 Namespace - 'http://localhost/'
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
70 Triple 1 - c1 'age' c2(literal)
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
71 Triple 2 - c3 'supervises' c1(URI)
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
72
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
73 Sample Output::
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
74
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
75 <http://localhost/Michael> <http://localhost/age> "42"
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
76 <http://localhost/Anne> <http://localhost/age> "30"
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
77 <http://localhost/John> <http://localhost/supervises> <http://localhost/Micheal>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
78 <http://localhost/Micheal> <http://localhost/supervises> <http://localhost/Anne>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
79
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
80 **Output Format**
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
81
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
82 Output RDF format is N-Triples by default.
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
83
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
84 </help>
|
Mikel Egana <mikel.egana.aranguren@gmail.com>
parents:
diff
changeset
|
85 </tool>
|