Re: [Neo4j] Gremlin plugin and script engine question
Hey Alfredas, Be sure to iterate your pipeline x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}.iterate(); x * NOTE: You can also do: g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4} -1 but the convention is no longer with us in Gremlin 1.4-SNAPSHOT. HTH, Marko. http://markorodriguez.com On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote: Dear all, This concerns gremlin plugin and the script engine. Maybe there's an explanation for this behavior: 1) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; gremlin x; == v[7] == v[3] == v[5] 2) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; x; returns nothing... Thanks, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin plugin and script engine question
Thanks! What exactly does iterate() do? A On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez okramma...@gmail.com wrote: Hey Alfredas, Be sure to iterate your pipeline x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}.iterate(); x * NOTE: You can also do: g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4} -1 but the convention is no longer with us in Gremlin 1.4-SNAPSHOT. HTH, Marko. http://markorodriguez.com On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote: Dear all, This concerns gremlin plugin and the script engine. Maybe there's an explanation for this behavior: 1) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; gremlin x; == v[7] == v[3] == v[5] 2) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; x; returns nothing... Thanks, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin plugin and script engine question
It iterates. Sorry, couldn't resist. ;-) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Alfredas Chmieliauskas Sent: Thursday, November 17, 2011 12:31 PM To: Neo4j user discussions Subject: Re: [Neo4j] Gremlin plugin and script engine question Thanks! What exactly does iterate() do? A On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez okramma...@gmail.com wrote: Hey Alfredas, Be sure to iterate your pipeline x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}.iterate(); x * NOTE: You can also do: g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4} -1 but the convention is no longer with us in Gremlin 1.4-SNAPSHOT. HTH, Marko. http://markorodriguez.com On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote: Dear all, This concerns gremlin plugin and the script engine. Maybe there's an explanation for this behavior: 1) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; gremlin x; == v[7] == v[3] == v[5] 2) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; x; returns nothing... Thanks, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin plugin and script engine question
What exactly does iterate() do? A Gremlin expression yields a Pipeline and PipelineS,E implements IteratorS,E Thus, a Gremlin expression doesn't return the results of a traversal, only a lazy iterator for .next()'ing results. For people doing a traversal to yield a sideEffect (e.g. aggregate, groupCount, etc.), iterate() is there to while(hasNext()) { next() } for you to fill up your side effect data structure. Finally, the Gremlin REPL automagically iterates and System.out.printlns() any objects in an Iterator it gets so thats why the behavior in the Gremlin REPL looks like a Gremlin expression returns results. Hope that is clear, Marko. http://markorodriguez.com A On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez okramma...@gmail.com wrote: Hey Alfredas, Be sure to iterate your pipeline x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}.iterate(); x * NOTE: You can also do: g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4} -1 but the convention is no longer with us in Gremlin 1.4-SNAPSHOT. HTH, Marko. http://markorodriguez.com On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote: Dear all, This concerns gremlin plugin and the script engine. Maybe there's an explanation for this behavior: 1) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; gremlin x; == v[7] == v[3] == v[5] 2) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; x; returns nothing... Thanks, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin plugin and script engine question
Got it. Thanks! Rick -1 A On Thu, Nov 17, 2011 at 6:36 PM, Marko Rodriguez okramma...@gmail.com wrote: What exactly does iterate() do? A Gremlin expression yields a Pipeline and PipelineS,E implements IteratorS,E Thus, a Gremlin expression doesn't return the results of a traversal, only a lazy iterator for .next()'ing results. For people doing a traversal to yield a sideEffect (e.g. aggregate, groupCount, etc.), iterate() is there to while(hasNext()) { next() } for you to fill up your side effect data structure. Finally, the Gremlin REPL automagically iterates and System.out.printlns() any objects in an Iterator it gets so thats why the behavior in the Gremlin REPL looks like a Gremlin expression returns results. Hope that is clear, Marko. http://markorodriguez.com A On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez okramma...@gmail.com wrote: Hey Alfredas, Be sure to iterate your pipeline x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}.iterate(); x * NOTE: You can also do: g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4} -1 but the convention is no longer with us in Gremlin 1.4-SNAPSHOT. HTH, Marko. http://markorodriguez.com On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote: Dear all, This concerns gremlin plugin and the script engine. Maybe there's an explanation for this behavior: 1) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; gremlin x; == v[7] == v[3] == v[5] 2) gremlin x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops 4}; x; returns nothing... Thanks, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user