Re: [Neo4j] Node.hasRelationship question

2010-10-28 Thread Mattias Persson
2010/10/28 Walaa Eldin Moustafa wa.moust...@gmail.com Hi Mattias, Even if I pass nulls, I will still have to build an index on some key (property). I do not want to do that because it adds the property index overhead for something that I am not actually using. I think it's definately worth

Re: [Neo4j] Node.hasRelationship question

2010-10-28 Thread Francois Kassis
...@neotechnology.com Sent: Thursday, October 28, 2010 10:48 AM To: Neo4j user discussions user@lists.neo4j.org Subject: Re: [Neo4j] Node.hasRelationship question 2010/10/28 Walaa Eldin Moustafa wa.moust...@gmail.com Hi Mattias, Even if I pass nulls, I will still have to build an index on some

Re: [Neo4j] Node.hasRelationship question

2010-10-28 Thread Walaa Eldin Moustafa
By the way, does the underlying code for index.get(kay, value, start, end) iterate over all the relationships of start and checks if one is connected to end, or it does perform a direct look up to get the edges between (start, end)? No looping, just a direct lookup. Maybe RelationshipIndex

[Neo4j] Node.hasRelationship question

2010-10-27 Thread Walaa Eldin Moustafa
I am looking for a method that is if given a node n1, can answer the query if n1 has a relationship of type t with node n2, something along the lines of: boolean b = n1.hasRelatioship(n2,t); I know we can answer this question by iterating over n1's getRelationships() and testing them. However, I

Re: [Neo4j] Node.hasRelationship question

2010-10-27 Thread Marko Rodriguez
Hi, You could try Gremlin -- http://gremlin.tinkerpop.com ... g:count($n1/ou...@label='t']/i...@id=$n2_id) 0 It will iterate over all out edges of n1, but, you will find more flexibility in determining if particular paths exist. That is, if you plan more complicated expressions. If

Re: [Neo4j] Node.hasRelationship question

2010-10-27 Thread Mattias Persson
2010/10/27, Walaa Eldin Moustafa wa.moust...@gmail.com: I am looking for a method that is if given a node n1, can answer the query if n1 has a relationship of type t with node n2, something along the lines of: boolean b = n1.hasRelatioship(n2,t); I know we can answer this question by

Re: [Neo4j] Node.hasRelationship question

2010-10-27 Thread Walaa Eldin Moustafa
Thanks Marko. I was actually referring to something more efficient than iterating over all the nodes. Gremlin is something that I definitely want to try, but not for that project. On Wed, Oct 27, 2010 at 4:16 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, You could try Gremlin --

Re: [Neo4j] Node.hasRelationship question

2010-10-27 Thread Walaa Eldin Moustafa
Hi Mattias, Even if I pass nulls, I will still have to build an index on some key (property). I do not want to do that because it adds the property index overhead for something that I am not actually using. By the way, does the underlying code for index.get(kay, value, start, end) iterate over