-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_df_experiment.sh
More file actions
executable file
·44 lines (35 loc) · 1.17 KB
/
run_df_experiment.sh
File metadata and controls
executable file
·44 lines (35 loc) · 1.17 KB
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
#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
# Change to the DfAnalyzer directory
cd /opt/dlprov/DfAnalyzer
# Start and restore the MonetDB database
echo "Restoring the database..."
#./restore-database.sh # Uncomment if you need to restore the database
monetdbd stop data || { echo "Failed to stop MonetDB"; exit 1; }
monetdbd start data || { echo "Failed to start MonetDB"; exit 1; }
monetdb start dataflow_analyzer || { echo "Failed to start the dataflow_analyzer database"; exit 1; }
# Generate provenance document
cd /opt/dlprov/generate-prov
# Restore Neo4j database
python restore_neo4j.py
if [ $? -ne 0 ]; then
echo "Error: Failed to restore neo4j database."
exit 1
fi
echo "Neo4j was restored."
echo "Running provenance generation..."
# Run the Python script and capture the output
output=$(python query_dftag.py)
echo "output was '$output'"
if [[ $output ]]; then
python generate_prov.py --df_tag "$output"
if [ $? -ne 0 ]; then
echo "Provenance generation not completed."
exit 1
fi
echo "Provenance generation completed successfully."
else
echo "Error executing the script."
exit 1
fi
echo "Experiment completed!"