Just a heads up here:
if (r.getType().equals(rel.getType()))
isn't accurate. If you read the javadocs you can see that you cannot compare
RelationshipType instances, but rather their names or use the short-hand
method on Relationship:
if (r.isType(rel.getType()))
2011/10/27 Bruno Paiva
Hello there!
First of all, thanks for the help in all my previous questions, all the
answers have been helping me to use Neo4j with success.
I have a very simple question, but I haven't found the answer yet...
I'd like to have a function, which signature would be more or less like
this:
Bruno,
There is no such function low level, but toy can use a Shortest path algo to
check this. What is the maximum length for a path between the nodes?
On Oct 27, 2011 6:14 PM, Bruno Paiva Lima da Silva bplsi...@gmail.com
wrote:
Hello there!
First of all, thanks for the help in all my previous
Easy: just one.
For now, I've written this, but I'm still not sure it is the simplest
way to write it
public boolean areConnected(Node n1,Node n2,Relationship
rel,Direction dir) throws Exception {
IterableRelationship relationships = n1.getRelationships(dir);
for
2011 18:39:01 +0200
From: bplsi...@gmail.com
To: user@lists.neo4j.org
Subject: Re: [Neo4j] Function to check whether two nodes are connected?
Easy: just one.
For now, I've written this, but I'm still not sure it is the simplest
way to write it
public boolean areConnected(Node n1
...@hotmail.com
To: user@lists.neo4j.org
Date: Thu, 27 Oct 2011 19:05:16 +0200
Subject: Re: [Neo4j] Function to check whether two nodes are connected?
There is one caveat to this method, you'd have to know which node is most
densely connected.
Suppose one of the nodes has 100,000 relationships
().equals(n2)
return true;
else if (rel2.getEndNode().equals(n1))
return true;
}
return false;
}
From: pd_aficion...@hotmail.com
To: user@lists.neo4j.org
Date: Thu, 27 Oct 2011 19:05:16 +0200
Subject: Re: [Neo4j] Function to check whether two nodes are connected
You know me and my obsession for densely connected nodes :-)
Date: Thu, 27 Oct 2011 17:37:07 +
From: peter.neuba...@neotechnology.com
To: user@lists.neo4j.org
Subject: Re: [Neo4j] Function to check whether two nodes are connected?
Good catch Niels, thanks - my brain is in jet lag mode
8 matches
Mail list logo