First, why do you say it works sometimes ? That sounds like a bug to me in
that case. Can you please start with a small dataset so you know and being
sure that you know whats going on in the graph ?
CREATE (Pontus:People { name:'Pontus Lundin' }),(John:People { name: 'John
Hellberg' }),(Jack:People { name: 'Jack Hellberg' }),(Sandra:People { name:
'Sandra Johansson', sex:'female' }),(Fredrik:People { name:'Fredrik
Hansson' }),(Nils:People { name:'Nils Poppe'
}),(Pontus)-[:FRIEND]->(Jack),(Jack)-[:FRIEND]->(Sandra),(John)-[:FRIEND]->(Jack),(Jack)-[:FRIEND]->(John),(Sandra)-[:FRIEND]->(Fredrik),(Fredrik)-[:FRIEND]->(Ronny),(Pontus)-[:FRIEND]->(John),(Pontus)-[:FRIEND]->(Fredrik),(Sandra)-[:FRIEND]->(Nils);
This creates a graph with fof where i would like to query for fof where i
am not already friend with.
POST http://localhost:7474/db/data/node/0/traverse/node
{"order":"breadth_first","uniqueness":"node_global","prune_evaluator":{"name":"none","language":"builtin"},
"return_filter":{ "body":"position.length()>2", "language":"javascript" },
"relationships":{"direction":"out","type":"FRIEND"},"max_depth":3}
Will return Nils Poppe which is a friend to Sandra. Sandra is also Friend
to Fredrik but i am already friend to him so he is excluded.
As for your second question i dont know if that is possible with the REST
API i dont think so
The actual docs for path is
http://components.neo4j.org/neo4j/2.0.1/apidocs/org/neo4j/graphdb/Path.html
but you will have to use cypher and do yet another query and a simple query
like this will return the number:
MATCH (n)-[r]-(friends)
RETURN count(r), type(r);
Den lördagen den 5:e april 2014 kl. 02:25:48 UTC+2 skrev Rio Eduardo:
>
> Lundin, Do you know the way how to count many relationships in the graph
> because I don't see it in the doc(method for the position object(the path))?
>
> Thank you.
>
> On Saturday, April 5, 2014 12:43:01 AM UTC+7, Lundin wrote:
>>
>> Have you tried experimenting with ther filter and the path length ?
>> endNod() is not the only method for the position object(the path), Mabey
>> position.length>1 or something.
>>
>> Den fredagen den 4:e april 2014 kl. 18:10:33 UTC+2 skrev Rio Eduardo:
>>>
>>> Please anyone in this group help me. I already posted my problem at
>>>
>>>
>>> http://stackoverflow.com/questions/22861424/neo4j-traversal-to-find-friends-of-friends-that-are-not-friends-with-the-user
>>>
>>> Thank you.
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.