I am working on a small POC project to benchmark neo4j graph DB
against our current mysql implementation of the same feature.
We have our database model in such a way, where we will have to create
multiple relationship of same type (but different properties) between
two node.
However during node traversal, we want to retrive all the relationship
between those 2 nodes (currently I see the traversal framework return
only one relationship and not all. I might be wrong. ) But couldn't
find how to do that using either GraphAlgoFactory or Traversal
frameWork.
I am using, neo4j in JAVA and is embedded in our tomcat server.
(adding neo4j jar in tomcat).
We also want to do that upto a depth of 4 and between two consecutive
node, we need all the relationships.
On Tue, May 15, 2012 at 8:05 PM, Bikash Jain <jainbik...@gmail.com> wrote:
> Hi,
> I am working on a small POC project to benchmark neo4j graph DB
> against our current mysql implementation of the same feature.
> We have our database model in such a way, where we will have to create
> multiple relationship of same type (but different properties) between
> two node.
> However during node traversal, we want to retrive all the relationship
> between those 2 nodes (currently I see the traversal framework return
> only one relationship and not all. I might be wrong. ) But couldn't
> find how to do that using either GraphAlgoFactory or Traversal
> frameWork.
> I am using, neo4j in JAVA and is embedded in our tomcat server.
> (adding neo4j jar in tomcat).
> We also want to do that upto a depth of 4 and between two consecutive
> node, we need all the relationships.
In the mean time I found out that GraphAlgoFactory.allSimplePaths actually
returns all the relationship between two nodes.
Will Cypher query be faster compared to the above mentioned approach? I am
actually not much familiar with cypher queries. So will try get a hang of
it in the mean time.
I am also looking for a way to hook up my filtering logic in allSimplePaths
api. Doesn't look like I can filter out anything except based on
RelationshipType and Direction. Let me know if I am missing something
obvious here.
Thanks a lot for your response.
On Wed, May 16, 2012 at 12:46 AM, Peter Neubauer <
> If you can write, you can code - @coderdojomalmo
> If you can sketch, you can use a graph database - @neo4j
> On Tue, May 15, 2012 at 8:05 PM, Bikash Jain <jainbik...@gmail.com> wrote:
> > Hi,
> > I am working on a small POC project to benchmark neo4j graph DB
> > against our current mysql implementation of the same feature.
> > We have our database model in such a way, where we will have to create
> > multiple relationship of same type (but different properties) between
> > two node.
> > However during node traversal, we want to retrive all the relationship
> > between those 2 nodes (currently I see the traversal framework return
> > only one relationship and not all. I might be wrong. ) But couldn't
> > find how to do that using either GraphAlgoFactory or Traversal
> > frameWork.
> > I am using, neo4j in JAVA and is embedded in our tomcat server.
> > (adding neo4j jar in tomcat).
> > We also want to do that upto a depth of 4 and between two consecutive
> > node, we need all the relationships.
> In the mean time I found out that GraphAlgoFactory.allSimplePaths actually returns all the relationship between two nodes.
> Will Cypher query be faster compared to the above mentioned approach? I am actually not much familiar with cypher queries. So will try get a hang of it in the mean time.
> I am also looking for a way to hook up my filtering logic in allSimplePaths api. Doesn't look like I can filter out anything except based on RelationshipType and Direction. Let me know if I am missing something obvious here.
> Thanks a lot for your response.
> On Wed, May 16, 2012 at 12:46 AM, Peter Neubauer <peter.neuba...@neotechnology.com> wrote:
> Bikash,
> you can do a Cypher query which will give you unique relationships, e.g.
> http://tinyurl.com/cmk9bby where there are multiple relationships
> between node 1 and 2 (see the setup)
> start a = node(1) match p=a-[r:related]->()-->() return p, r
> If you can write, you can code - @coderdojomalmo
> If you can sketch, you can use a graph database - @neo4j
> On Tue, May 15, 2012 at 8:05 PM, Bikash Jain <jainbik...@gmail.com> wrote:
> > Hi,
> > I am working on a small POC project to benchmark neo4j graph DB
> > against our current mysql implementation of the same feature.
> > We have our database model in such a way, where we will have to create
> > multiple relationship of same type (but different properties) between
> > two node.
> > However during node traversal, we want to retrive all the relationship
> > between those 2 nodes (currently I see the traversal framework return
> > only one relationship and not all. I might be wrong. ) But couldn't
> > find how to do that using either GraphAlgoFactory or Traversal
> > frameWork.
> > I am using, neo4j in JAVA and is embedded in our tomcat server.
> > (adding neo4j jar in tomcat).
> > We also want to do that upto a depth of 4 and between two consecutive
> > node, we need all the relationships.
allSimplePaths looks impressive in the initial testing I have done. I will
do a load testing probably at a later stage.
However I have few small requirements.
1. How can I traverse all path (all relationship between nodes) from a
starting node and with a specified depth?
allSimplePath is meant for a pair of node. But I want to find all nodes
from a given starting node with all relationship between all the nodes.
2. Is there a way to pluggin filtering logic in allSimplePaths api apart
from RelationShip Type and direction.
Something similar to what we have in our Traverser frameWork.
michael.hun...@neotechnology.com> wrote:
> Right now the GraphAlgoFactory.allSimplePaths is probably still faster as
> it has direct access to the low level API.
> If you want to use cypher please make sure to reuse the execution-engine
> and use parameters for eventual start and end-nodes.
> Michael
> But feel free to test it for your case and please report back to us.
> Thanks a lot
> Michael
> Am 15.05.2012 um 21:25 schrieb Bikash Jain:
> Thanks Peter for the quick response.
> In the mean time I found out that GraphAlgoFactory.allSimplePaths actually
> returns all the relationship between two nodes.
> Will Cypher query be faster compared to the above mentioned approach? I am
> actually not much familiar with cypher queries. So will try get a hang of
> it in the mean time.
> I am also looking for a way to hook up my filtering logic in
> allSimplePaths api. Doesn't look like I can filter out anything except
> based on RelationshipType and Direction. Let me know if I am missing
> something obvious here.
> Thanks a lot for your response.
> On Wed, May 16, 2012 at 12:46 AM, Peter Neubauer <
> peter.neuba...@neotechnology.com> wrote:
>> Bikash,
>> you can do a Cypher query which will give you unique relationships, e.g.
>> http://tinyurl.com/cmk9bby where there are multiple relationships
>> between node 1 and 2 (see the setup)
>> start a = node(1) match p=a-[r:related]->()-->() return p, r
>> If you can write, you can code - @coderdojomalmo
>> If you can sketch, you can use a graph database - @neo4j
>> On Tue, May 15, 2012 at 8:05 PM, Bikash Jain <jainbik...@gmail.com>
>> wrote:
>> > Hi,
>> > I am working on a small POC project to benchmark neo4j graph DB
>> > against our current mysql implementation of the same feature.
>> > We have our database model in such a way, where we will have to create
>> > multiple relationship of same type (but different properties) between
>> > two node.
>> > However during node traversal, we want to retrive all the relationship
>> > between those 2 nodes (currently I see the traversal framework return
>> > only one relationship and not all. I might be wrong. ) But couldn't
>> > find how to do that using either GraphAlgoFactory or Traversal
>> > frameWork.
>> > I am using, neo4j in JAVA and is embedded in our tomcat server.
>> > (adding neo4j jar in tomcat).
>> > We also want to do that upto a depth of 4 and between two consecutive
>> > node, we need all the relationships.
> I am working on a small POC project to benchmark neo4j graph DB
> against our current mysql implementation of the same feature.
> We have our database model in such a way, where we will have to create
> multiple relationship of same type (but different properties) between
> two node.
> However during node traversal, we want to retrive all the relationship
> between those 2 nodes (currently I see the traversal framework return
> only one relationship and not all. I might be wrong. ) But couldn't
> find how to do that using either GraphAlgoFactory or Traversal
> frameWork.
> I am using, neo4j in JAVA and is embedded in our tomcat server.
> (adding neo4j jar in tomcat).
> We also want to do that upto a depth of 4 and between two consecutive
> node, we need all the relationships.
>> I am working on a small POC project to benchmark neo4j graph DB
>> against our current mysql implementation of the same feature.
>> We have our database model in such a way, where we will have to create
>> multiple relationship of same type (but different properties) between
>> two node.
>> However during node traversal, we want to retrive all the relationship
>> between those 2 nodes (currently I see the traversal framework return
>> only one relationship and not all. I might be wrong. ) But couldn't
>> find how to do that using either GraphAlgoFactory or Traversal
>> frameWork.
>> I am using, neo4j in JAVA and is embedded in our tomcat server.
>> (adding neo4j jar in tomcat).
>> We also want to do that upto a depth of 4 and between two consecutive
>> node, we need all the relationships.