-
Notifications
You must be signed in to change notification settings - Fork 10
/
convertToOneTurtle.sh
executable file
·57 lines (53 loc) · 1.52 KB
/
convertToOneTurtle.sh
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
#!/usr/bin/bash
# To load the examples into a SPARQL endpoint they should be concatenated into one example file. Use the script `convertIntoOneTurtle.sh` provide the project name with a `-p` parameter
# This expects the Jena tools to be available in your $PATH. e.g. `export PATH="$JENA_HOME/bin:$PATH"`
# ./convertToOneTurtle.sh -p uniprot
project="uniprot"
while getopts anuhrsgmcbop: option; do
case "$option" in
a) project="all";;
p) project="$OPTARG";;
u) project="uniprot";;
h) project="hamap";;
r) project="rhea";;
s) project="swisslipids";;
g) project="glyconnect";;
m) project="metanetx";;
c) project="covid";;
n) project="nextprot";;
b) project="bgee";;
o) project="oma";;
h) help; exit 0;;
*) help; exit 1;;
esac
done
pattern="$project"
case "$project" in
trembl)
;&
swiss-prot)
if [ ! -L "${project}" ]
then
ln -s UniProt "${project}"
fi
;;
uniprot)
project="uniprot";
pattern="UniProt";;
nextprot)
pattern="neXtProt";;
bgee)
pattern="Bgee";;
all)
pattern='*';;
esac
if [ -f examples_${project}.ttl ]
then
rm examples_${project}.ttl
fi
if which riot
then
cat examples/prefixes.ttl examples/$pattern/*.ttl | riot --syntax=turtle --formatted=turtle > examples_${project}.ttl
else
rapper -q -i turtle <(cat examples/prefixes.ttl examples/${pattern}/*.ttl) -o turtle > examples_${project}.ttl
fi