summaryrefslogtreecommitdiffstats
path: root/src/main/scripts/add_vertex_label.sh
blob: 198de68865ec0b3fc6194b46259afa340557641d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

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}";