Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Multiple relationship of same type between two nodes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bikash Jain  
View profile  
 More options May 15 2012, 2:05 pm
From: Bikash Jain <jainbik...@gmail.com>
Date: Tue, 15 May 2012 11:05:59 -0700 (PDT)
Local: Tues, May 15 2012 2:05 pm
Subject: Multiple relationship of same type between two nodes
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.

Let me know if I am not clear on this.

Thanks,
Bikash


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 15 2012, 3:16 pm
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Tue, 15 May 2012 21:16:01 +0200
Local: Tues, May 15 2012 3:16 pm
Subject: Re: [Neo4j] Multiple relationship of same type between two nodes
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

for java, see http://docs.neo4j.org/chunked/snapshot/tutorials-cypher-java.html
for executing it from Java.

Does that do what you want?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikash Jain  
View profile  
 More options May 15 2012, 3:25 pm
From: Bikash Jain <jainbik...@gmail.com>
Date: Wed, 16 May 2012 00:55:33 +0530
Local: Tues, May 15 2012 3:25 pm
Subject: Re: [Neo4j] Multiple relationship of same type between two nodes

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 <

--
Thanks,
Bikash
9948439165

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options May 15 2012, 4:53 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Tue, 15 May 2012 22:53:37 +0200
Local: Tues, May 15 2012 4:53 pm
Subject: Re: [Neo4j] Multiple relationship of same type between two nodes

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikash Jain  
View profile  
 More options May 16 2012, 1:32 am
From: Bikash Jain <jainbik...@gmail.com>
Date: Wed, 16 May 2012 11:02:23 +0530
Local: Wed, May 16 2012 1:32 am
Subject: Re: [Neo4j] Multiple relationship of same type between two nodes

Thanks Michael for the information.

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.

Thanks a lot for your time.

On Wed, May 16, 2012 at 2:23 AM, Michael Hunger <

--
Thanks,
Bikash
9948439165

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattias Persson  
View profile  
 More options May 16 2012, 8:38 am
From: Mattias Persson <matt...@neotechnology.com>
Date: Wed, 16 May 2012 14:38:52 +0200
Local: Wed, May 16 2012 8:38 am
Subject: Re: [Neo4j] Multiple relationship of same type between two nodes

This has to do with the default (NODE_GLOBAL) uniqueness of a traversal.
Try setting it to RELATIONSHIP_GLOBAL or NODE_PATH, like:

  Traversal.description().uniqueness( Uniqueness.RELATIONSHIP_GLOBAL )....

2012/5/15 Bikash Jain <jainbik...@gmail.com>

--
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikash Jain  
View profile  
 More options May 17 2012, 9:39 am
From: Bikash Jain <jainbik...@gmail.com>
Date: Thu, 17 May 2012 19:09:04 +0530
Local: Thurs, May 17 2012 9:39 am
Subject: Re: [Neo4j] Multiple relationship of same type between two nodes

Thanks Mattias,

That worked :)

On Wed, May 16, 2012 at 6:08 PM, Mattias Persson
<matt...@neotechnology.com>wrote:

--
Thanks,
Bikash
9948439165

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »