-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathontop-entrypoint.sh
executable file
·71 lines (54 loc) · 2.03 KB
/
ontop-entrypoint.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
#!/bin/bash
ONTOP_HOME=/opt/ontop
args_array=()
if [ "${MAPPING_FILE+x}" ]; then
ONTOP_MAPPING_FILE=${MAPPING_FILE}
fi
if [ "${ONTOP_MAPPING_FILE+x}" ]; then
args_array+=("--mapping=${ONTOP_MAPPING_FILE}")
else
echo "ERROR: environment variable ONTOP_MAPPING_FILE is not set" && exit 1
fi
if [ "${ONTOLOGY_FILE+x}" ]; then
ONTOP_ONTOLOGY_FILE=${ONTOLOGY_FILE}
echo "WARNING: environment variable ONTOLOGY_FILE is deprecated. Please use ONTOP_ONTOLOGY_FILE instead"
fi
if [ "${ONTOP_ONTOLOGY_FILE+x}" ]; then
args_array+=("--ontology=${ONTOP_ONTOLOGY_FILE}")
fi
if [ "${PROPERTIES_FILE+x}" ]; then
ONTOP_PROPERTIES_FILE=${PROPERTIES_FILE}
echo "WARNING: environment variable PROPERTIES_FILE is deprecated. Please use ONTOP_PROPERTIES_FILE instead"
fi
if [ "${ONTOP_PROPERTIES_FILE+x}" ]; then
args_array+=("--properties=${ONTOP_PROPERTIES_FILE}")
else
echo "ERROR: environment variable ONTOP_PROPERTIES_FILE is not set" && exit 1
fi
if [ "${ONTOP_CONSTRAINT_FILE+x}" ]; then
args_array+=("--constraint=${ONTOP_CONSTRAINT_FILE}")
fi
if [ "${ONTOP_CORS_ALLOWED_ORIGINS+x}" ]; then
args_array+=("--cors-allowed-origins=${ONTOP_CORS_ALLOWED_ORIGINS}")
fi
if [ "${ONTOP_PORTAL_FILE+x}" ]; then
args_array+=("--portal=${ONTOP_PORTAL_FILE}")
fi
if [ "${ONTOP_DEV_MODE+x}" ]; then
args_array+=("--dev")
fi
if [ "${ONTOP_LAZY_INIT+x}" ]; then
args_array+=("--lazy")
fi
if [ -z "${ONTOP_JAVA_ARGS+x}" ]; then
ONTOP_JAVA_ARGS="-Xmx512m"
fi
if [ -z "${ONTOP_DEBUG+x}" ]; then
LOGBACK_CONFIG_FILE=${ONTOP_HOME}/log/logback-debug.xml
else
LOGBACK_CONFIG_FILE=${ONTOP_HOME}/log/logback.xml
fi
echo java ${ONTOP_JAVA_ARGS} -cp "${ONTOP_HOME}/lib/*:${ONTOP_HOME}/jdbc/*" -Dlogback.configurationFile="${LOGBACK_CONFIG_FILE}" \
it.unibz.inf.ontop.cli.Ontop materialize "${args_array[@]}" -f ntriples -o ./output/triples.nt
java ${ONTOP_JAVA_ARGS} -cp "${ONTOP_HOME}/lib/*:${ONTOP_HOME}/jdbc/*" -Dlogback.configurationFile="${LOGBACK_CONFIG_FILE}" \
it.unibz.inf.ontop.cli.Ontop materialize "${args_array[@]}" -f ntriples -o ./output/triples.nt