-
Notifications
You must be signed in to change notification settings - Fork 0
/
tab2rdf.xml
83 lines (66 loc) · 2.85 KB
/
tab2rdf.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<tool id="tab2rdf" name="Tab-to-RDF" version="0.1">
<!-- Modified by Mikel Egaña Aranguren, very hacky -->
<description>Converter</description>
<command interpreter="python">
#if $namespace.choose_namespace=="none"
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
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 local to biordf
**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::
<http://localhost/Michael> <http://localhost/age> "42"
<http://localhost/Anne> <http://localhost/age> "30"
<http://localhost/John> <http://localhost/supervises> <http://localhost/Micheal>
<http://localhost/Micheal> <http://localhost/supervises> <http://localhost/Anne>
**Output Format**
Output RDF format is N-Triples by default.
Raptor's Rapper has to be installed to generate the output in Turtle or RDF/XML.
</help>
</tool>