Re: [Neo4j] Nested/ chained queries
Lasse, for Java, you might even look at http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-traversal.html#_new_traversal_frameworkto get some inspiration ... Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - NOSQL for the Enterprise. http://startupbootcamp.org/- Ă–resund - Innovation happens HERE. On Mon, Nov 28, 2011 at 10:16 AM, lassewesth wrote: > > maxdemarzi wrote > > > > nodes = @neo.traverse(node1, > > "nodes", > > {"order" => "breadth first", > >"uniqueness" => "node global", > >"relationships" => [{"type"=> "friends", > > "direction" => "out"}, > >{"type"=> "likes", > > "direction" => "out"}], > > "return filter" => { > > "language" => "javascript", > > "body" => "position.length() > > == 2 && position.lastRelationship().getType().name() == 'likes';"}, > >"depth" => 2}) > > > > Max, excellent explanation, thanks. I'll get busy translating that into > Java. > > -- > View this message in context: > http://neo4j-community-discussions.438527.n3.nabble.com/Nested-chained-queries-tp3536514p3541740.html > Sent from the Neo4j Community Discussions mailing list archive at > Nabble.com. > ___ > 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] Nested/ chained queries
maxdemarzi wrote > > nodes = @neo.traverse(node1, > "nodes", > {"order" => "breadth first", >"uniqueness" => "node global", >"relationships" => [{"type"=> "friends", > "direction" => "out"}, >{"type"=> "likes", > "direction" => "out"}], > "return filter" => { > "language" => "javascript", > "body" => "position.length() > == 2 && position.lastRelationship().getType().name() == 'likes';"}, >"depth" => 2}) > Max, excellent explanation, thanks. I'll get busy translating that into Java. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Nested-chained-queries-tp3536514p3541740.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Nested/ chained queries
nice Max, thanks for the follow-up! Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - NOSQL for the Enterprise. http://startupbootcamp.org/- Ă–resund - Innovation happens HERE. On Sun, Nov 27, 2011 at 12:49 AM, maxdemarzi wrote: > Sure, it's like getting friends of friends: > https://github.com/maxdemarzi/neography/blob/master/examples/facebook.rb > > This should work, but I haven't tested it, so keep an eye out for typos. > > nodes = @neo.traverse(node1, > "nodes", > {"order" => "breadth first", > "uniqueness" => "node global", > "relationships" => [{"type"=> "friends", >"direction" => "out"}, > {"type"=> "likes", >"direction" => "out"}], >"return filter" => { >"language" => "javascript", >"body" => "position.length() == > 2 && position.lastRelationship() == 'likes';"}, > "depth" => 2}) > > > -- > View this message in context: > http://neo4j-community-discussions.438527.n3.nabble.com/Nested-chained-queries-tp3536514p3539279.html > Sent from the Neo4j Community Discussions mailing list archive at > Nabble.com. > ___ > 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] Nested/ chained queries
Sure, it's like getting friends of friends: https://github.com/maxdemarzi/neography/blob/master/examples/facebook.rb This should work, but I haven't tested it, so keep an eye out for typos. nodes = @neo.traverse(node1, "nodes", {"order" => "breadth first", "uniqueness" => "node global", "relationships" => [{"type"=> "friends", "direction" => "out"}, {"type"=> "likes", "direction" => "out"}], "return filter" => { "language" => "javascript", "body" => "position.length() == 2 && position.lastRelationship() == 'likes';"}, "depth" => 2}) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Nested-chained-queries-tp3536514p3539279.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user