I am imlpementing the Titan graph database with Rexster and Cassandra.
I try to add an edge like this in Ruby with Gremlin:
query = 'a = g.addVertex(null,[name:\'' +
someName +
'\']); g.addEdge(null, g.getVertex(' +
someVertexId + '), a, \'labelname\', [weight:' +
someFloatValue.round(5) + 'd]); g.commit();'
#This formats to the following:
#"a = g.addVertex(null,[name:'myawesomename']); g.addEdge(null, g.getVertex(1337), a, 'labelname', [weight:0.30685d]); g.commit();"
After running this I get the following error:
#<Rexster::Rest::RexsterError: Graph server returned error: javax.script.ScriptException: java.lang.IllegalArgumentException: The type of given name is not a label: labelname>
It seems like I have not defined the label with the name labelname
, I got that. However, I can not for the life of me figure out how to add this label so I am able to add this edge to the graph.
Adding vertices works fine by the way.
I am using the rexster_ruby gem which connects to a ubuntu 12.04 machine with titan-server 0.4.0 running the titan.sh
script.