summaryrefslogtreecommitdiffstats
path: root/src/main/scripts/add_vertex_label.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scripts/add_vertex_label.sh')
-rw-r--r--src/main/scripts/add_vertex_label.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/scripts/add_vertex_label.sh b/src/main/scripts/add_vertex_label.sh
new file mode 100644
index 0000000..f026bd0
--- /dev/null
+++ b/src/main/scripts/add_vertex_label.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+filename=$1;
+
+if [ -z "${filename}" ]; then
+ echo "Please provide a graphson file";
+ exit 1;
+fi;
+
+if [ ! -f "${filename}" ]; then
+ echo "Unable to find the graphson file ${filename}";
+ exit 1;
+fi;
+
+sed 's/"label":"vertex"\(.*\)"aai-node-type":\[{"id":"\([^"]*\)","value":"\([^"]*\)"/"label":"\3"\1"aai-node-type":[{"id":"\2","value":"\3"/g' ${filename} > "with_label_${filename}"; \ No newline at end of file