-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-rdfox
executable file
·94 lines (81 loc) · 1.93 KB
/
run-rdfox
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
93
94
#! /bin/sh
case X$# in
X2) ;;
*) echo "Usage: sh $0 [ restricted | skolem ] <data-parameter>" 1>&2
exit 1
;;
esac
CHASETYPE=$1
DATASET=params-datasets/$2
DATASET_NAME=$2
if [ ! -f $DATASET ]
then
if [ ! -f $2 ]
then
echo "$DATASET not found" 1>&2
exit 1
else
DATASET=$2
DATASET_NAME=`basename $2`
fi
fi
CHASE=$CHASETYPE
case X$CHASETYPE in
Xrestricted)
CHASETYPE=standard
CHASE=restricted
;;
Xstandard)
;;
Xskolem)
;;
X*)
echo "Unrecognized chase type: " $CHASETYPE 1>&2
exit 1
;;
esac
# Sets SYS and TIME command
. support-scripts/detectSystem
# Get some info on the processor we are running on
. support-scripts/get-sysinfo.$SYS
# set some environment variables describing the dataset
. $DATASET
OUT=rdfox-$DATASET_NAME.$CHASETYPE.out
# T_TGDS not present for all data sets. Doctors does not have it.
T_TGDS=
case X$RDFOX_T_TGDS in
X) ;;
X*) T_TGDS="-t-tgds $RDFOX_T_TGDS"
;;
esac
$TIME java -jar chasebench/tools/rdfox/chaseRDFox-$SYS.jar \
-chase $CHASETYPE \
-s-sch $RDFOX_S_SCHEMA \
-t-sch $RDFOX_T_SCHEMA \
-src $DATA \
-st-tgds $RDFOX_ST_TGDS \
$T_TGDS \
-trg temp > rdfox-$DATASET_NAME.$CHASETYPE.out 2>&1
rm -rf temp
. support-scripts/get-sysinfo.$SYS
# Extracts statistics from rdfox and "/usr/bin/time -l" output
echo "Program: RDFox"
echo "Chase: $CHASE"
echo "Dataset: $DATASET_NAME"
echo Date: `date`
echo System: $OSTYPE
echo Processor: $MODEL
echo Cores: $CORES
echo Threads: $THREADS
grep 'Chase took.*in total' $OUT | sed 's/.*took \(.* ms\) in total.*/Time: \1/'
MEM=`grep 'aximum resident set size' $OUT | sed 's/ *[mM]aximum resident set size//' | sed 's/ (kbytes): //'`
# Linux (time -v) reports in kbytes, mac (time -l) reports in bytes.
case $SYS in
mac)
echo Mem: `expr \( $MEM + 524288 \) / 1048576` "MB"
;;
*)
echo Mem: `expr \( $MEM + 512 \) / 1024` "MB"
;;
esac
grep '^Total # of tuples:' $OUT | sed 's/.*: */Generated tuples: /'