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
how to change relationship property value?
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
  4 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
 
tAds  
View profile  
 More options Aug 3 2012, 1:10 am
From: tAds <shrthp...@gmail.com>
Date: Thu, 2 Aug 2012 22:10:11 -0700 (PDT)
Local: Fri, Aug 3 2012 1:10 am
Subject: how to change relationship property value?

hello,
           I have 2 nodes that are related to each other.This relationship
has a property called weightage with a value' 70 '. I want to increase the
value. To do so, I want to retrieve the value of the property (wightage=70)
 between these two nodes.I can retrieve these two nodes.From the nodes, how
can i get the relationship and then the property of that relationship?

Thanks in advance. :)  


 
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 Aug 3 2012, 1:58 am
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Fri, 3 Aug 2012 07:58:57 +0200
Local: Fri, Aug 3 2012 1:58 am
Subject: Re: [Neo4j] how to change relationship property value?

Start a=node(2),b=node(3) match a- [r]-b set r.weightage=70 return r

/peter

Send from mobile.
On Aug 3, 2012 7:10 AM, "tAds" <shrthp...@gmail.com> wrote:


 
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.
dizus  
View profile  
 More options Aug 3 2012, 2:09 am
From: dizus <diz...@gmail.com>
Date: Thu, 2 Aug 2012 23:09:01 -0700 (PDT)
Local: Fri, Aug 3 2012 2:09 am
Subject: Re: how to change relationship property value?

http://api.neo4j.org/1.8.M06 - Look for class Node and methods family:
getRelationships().

You dont need to retrieve both nodes as you can get relationships from any
node (it's just a matter of relationship direction),
so basicly you do:

for( Relationship rel: node.getRelationships(Direction.OUTGOING,
YourRelationTypeHere) ) {  
    double w = (Double) rel.getProperty("weightage");
    if( w == 70 ) {
        w += 123.45;
       rel.setProperty("weightage", w)
    }

}

Keep in mind that node may have multiple relationship (depends on your
application logic), so probably
you need to do some additional filtering.


 
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.
Charles Bedon  
View profile  
 More options Aug 3 2012, 9:17 am
From: Charles Bedon <charles.be...@zoho.com>
Date: Fri, 03 Aug 2012 08:17:39 -0500
Local: Fri, Aug 3 2012 9:17 am
Subject: AW: [Neo4j] how to change relationship property value?

Hello

There are many ways to get a relationship from one of the related nodes:

http://api.neo4j.org/1.8.M06/org/neo4j/graphdb/Node.html#getSingleRel...

That will return a Relationship object, and from it, you can get the relationship property values:

http://api.neo4j.org/1.8.M06/org/neo4j/graphdb/Relationship.html
http://api.neo4j.org/1.8.M06/org/neo4j/graphdb/PropertyContainer.html...)

By the way, the Javadoc link for the 1.7.2/1.6.3 APIs is broken:
http://api.neo4j.org/1.7.2/
http://api.neo4j.org/1.6.3/
-------------------------------------
Charles Edward Bedón Cortázar
Network Management, Data Analysis and Free Software http://www.neotropic.co | Follow Neotropic on Twitter
Open Source Network Inventory for the masses!  http://kuwaiba.sourceforge.net | Follow Kuwaiba on Twitter
Linux Registered User #386666

---- Am Fri, 03 Aug 2012 00:10:11 -0500 tAds&lt;shrthp...@gmail.com&gt; schrieb ----

hello,            I have 2 nodes that are related to each other.This relationship has a property called weightage with a value' 70 '. I want to increase the value. To do so, I want to retrieve the value of the property (wightage=70)  between these two nodes.I can retrieve these two nodes.From the nodes, how can i get the relationship and then the property of that relationship?

Thanks in advance. :)  


 
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 »