...
Code Block | ||
---|---|---|
| ||
#!/bin/bash echo "Backup Script for Exporting Ontology from Graph Database Using enapso-graphdb-cli" # Set Variables DB_URL="http://localhost/fuseki" REPOSITORY_NAME="Test" FORMAT="application/x-trig" EXPORT_FILE="export.trig" REPORT_FILE="report.txt" TRIPLESTORE="fuseki" # Remove Previous Report File echo "Removing Previous Report File..." rm report.txt$REPORT_FILE # Export ontology enapsogdb export --dburl $DB_URL --repository $REPOSITORY_NAME --targetfile $EXPORT_FILE --triplestore $TRIPLESTORE >> $REPORT_FILE 2>&1 echo "Backup made successfully" |
...
Code Block | ||
---|---|---|
| ||
#!/bin/bash echo "Running Script for Restoring Graph Database Repository Using enapso-graphdb-cli Tool" # Set Variables DB_URL="http://localhost/fuseki" REPOSITORY_NAME="Test" FORMAT="application/x-trig" SOURCE_FILE="export.trig" REPORT_FILE="report.txt" TRIPLESTORE="fuseki" # Remove Previous Report File echo "Removing Previous Report File..." rm Report/EnapsoTestReport.txt$REPORT_FILE # Import ontology enapsogdb import --dburl $DB_URL --repository $REPOSITORY_NAME --sourcefile $SOURCE_FILE --format $FORMAT --triplestore $TRIPLESTORE >> $REPORT_FILE 2>&1 # Rebuild cache (if applicable) curl -X POST http://localhost/enapso-dev/graphdb-management/v1/build-cache >> $REPORT_FILE echo "Graph Database Repository Successfully Restored" |
...