Monday 15 March 2010

graph - How to add a new property to an existing vertex in gremlin? -



graph - How to add a new property to an existing vertex in gremlin? -

i have problem finding way of adding new property existing vertex using gremlin. ex property add: property "name" value "anna".

first seek find vertex want add together property to. by: g.v(id), id id of vertex i'm looking for.

then i've tried adding property vertex doing: g.v(id).property("name","anna"), not work , gives me error saying:

"message":"","error":"javax.script.scriptexception: groovy.lang.missingmethodexception: no signature of method: groovy.lang.missingmethodexception.property() applicable argument types: (java.lang.string, java.lang.string) values:

it says here http://www.tinkerpop.com/docs/3.0.0.m1/#giraph-gremlin under "mutation graph" way add together new property existing vertex.

any suggestions?

you can accomplish sideeffect:

g = tinkergraphfactory.createtinkergraph() g.v[0].map ==>{name=lop, lang=java} g.v[0].sideeffect{it.foo = 'bar'} g.v[0].map ==>{name=lop, foo=bar, lang=java}

i guess in script need add together .iterate() @ end of modification statement.

graph gremlin rexster

No comments:

Post a Comment