just used for fully demonstrable code. You don't need to create a
TinkerGraph to create a step. Just define your step and use it
On Mon, Oct 22, 2012 at 2:44 AM, Nikhanj <nikhan
...@gmail.com> wrote:
> Hi,
> When you perform g = TinkerGraphFactory.createTinkerGraph() , the
> database that you were pointing before would be lost as you are creating a
> new instance of g. How will we access the old database now ?? Can't it be
> achieved without using TinkerGraphFactory ??
> On Thursday, 11 October 2012 09:19:57 UTC-4, Stephen Mallette wrote:
>> You are calling iterate() after groupCount and that is causing that
>> error. Removing it and simply accessing m after the gremlin has
>> executed will allow you to get at the count.
>> If you explicitly want to return the value of the groupCount to the
>> next step, I guess you could define your step this way:
>> Gremlin.defineStep('fn', [Vertex, Pipe], { x ->
>> _().out(x).name.groupCount.cap})
>> and then do:
>> gremlin> g = TinkerGraphFactory.createTinkerGraph()
>> ==>tinkergraph[vertices:6 edges:6]
>> gremlin> \. test.grm
>> ==>null
>> gremlin> m = g.v(1).fn('created').next()
>> ==>lop=1
>> gremlin> m
>> ==>lop=1
>> Does that help?
>> Stephen
>> On Thu, Oct 11, 2012 at 8:14 AM, Nikhanj <nikh...@gmail.com> wrote:
>> > Hi
>> > How to have an user defined step, returning a map.
>> > I tried the below code
>> > Gremlin.defineStep('fn1',[Vertex,Pipe],
>> > {
>> > reltype,m->_().out(reltype).Name.groupCount(m).iterate();
>> > });
>> > m=[:];
>> > g.v(2).fn1('Likes',m);
>> > But i get class cast exception!!!
>> > How to resolve this ???
>> > --
> --