-
Notifications
You must be signed in to change notification settings - Fork 0
/
explore.sh
executable file
·92 lines (73 loc) · 2.44 KB
/
explore.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
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
84
85
86
87
88
89
90
91
92
#!/bin/bash
set -e
QUERYSETS=(
./lubm/queries-sparql.sparql
./queries-for-dbpedia.sparql
./queries-for-lubm-with-filter.sparql
# ./watdiv/bin/Release/queries-all-1-1.sparql
)
DATABASES=(
./lubm/University0_0-edited.nt
# ./lubm/University0_all-edited.nt
# ./lubm/University0-4_all-edited.nt
# ./lubm/University0-9_all-edited.nt
# ./dbpedia/sparql_2023-01-24-sm.nt
./dbpedia/sparql_2023-01-24-md.nt
# ./dbpedia/sparql_2023-01-24-lg.nt
./watdiv/bin/Release/watdiv-1-unique.nt
# ./watdiv/bin/Release/watdiv-10-unique.nt
)
SEMANTICS=(
iterator
# collection
)
LOGFILE="evaluation/explore-$(date +%Y-%m-%d)-$1.log"
OUTFILE="evaluation/explore-$(date +%Y-%m-%d)-$1.csv"
echo "" > "$LOGFILE"
echo "task,query,plan,rows,duration,queryset,queries,database,triples,optimizers,joins,scans,disjunct_joins,filters" > "$OUTFILE"
cargo build --release
for DATABASE in "${DATABASES[@]}"; do
for QUERYSET in "${QUERYSETS[@]}"; do
if [[ $DATABASE == *"lubm"* ]]; then
if [[ $QUERYSET != *"lubm"* ]]; then
continue
fi
fi
if [[ $DATABASE == *"dbpedia"* ]]; then
if [[ $QUERYSET != *"dbpedia"* ]]; then
continue
fi
fi
if [[ $DATABASE == *"watdiv-1"* ]]; then
if [[ $QUERYSET != *"watdiv-1"* ]]; then
continue
fi
fi
if [[ $DATABASE == *"watdiv-5"* ]]; then
if [[ $QUERYSET != *"watdiv-5"* ]]; then
continue
fi
fi
if [[ $DATABASE == *"watdiv-10"* ]]; then
if [[ $QUERYSET != *"watdiv-1"* ]]; then
continue
fi
fi
NUMBER_OF_QUERIES=$(( $(grep -c "^$" "$QUERYSET") + 1 ))
for q in $(seq $NUMBER_OF_QUERIES); do
# if [[ $q -lt 7 ]]; then
# continue
# fi
echo $q $DATABASE $QUERYSET
# continue
OUTPUT=$(RUST_LOG=info RUST_BACKTRACE=1 ./target/release/thesis explore $QUERYSET $DATABASE -n $q 2>&1 | tee /dev/tty; echo "EXIT CODE $?")
echo "$OUTPUT" >> "$LOGFILE"
ERROR=$(echo "$OUTPUT" | grep "EXIT CODE" | sed 's/EXIT CODE//g')
if [ $ERROR -ne 0 ]; then
echo "non-zero exit code $ERROR";
exit
fi
echo "$OUTPUT" | grep -E "^explore," | cat >> "$OUTFILE"
done
done
done