Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
user defined steps
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nikhanj  
View profile  
 More options Oct 11 2012, 8:14 am
From: Nikhanj <nikhan...@gmail.com>
Date: Thu, 11 Oct 2012 05:14:31 -0700 (PDT)
Local: Thurs, Oct 11 2012 8:14 am
Subject: user defined steps

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 ???


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Mallette  
View profile  
 More options Oct 11 2012, 9:19 am
From: Stephen Mallette <spmalle...@gmail.com>
Date: Thu, 11 Oct 2012 09:19:51 -0400
Local: Thurs, Oct 11 2012 9:19 am
Subject: Re: [Neo4j] user defined steps
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikhanj  
View profile  
 More options Oct 22 2012, 2:44 am
From: Nikhanj <nikhan...@gmail.com>
Date: Sun, 21 Oct 2012 23:44:21 -0700 (PDT)
Local: Mon, Oct 22 2012 2:44 am
Subject: Re: [Neo4j] user defined steps

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 ??


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Mallette  
View profile  
 More options Oct 22 2012, 5:54 am
From: Stephen Mallette <spmalle...@gmail.com>
Date: Mon, 22 Oct 2012 05:54:37 -0400
Local: Mon, Oct 22 2012 5:54 am
Subject: Re: [Neo4j] user defined steps
"g" is just a variable and TinkerGraphFactory.createTinkerGraph(), was
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
against your instance of "g" or whatever variable name you choose.

Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »