Search code examples
c#.netrelationshipneo4jneo4jclient

Neo4jClient Create and Update a Relationship


I have a Neo4j Graphdatabase with access via the Neo4jClient. (It is a .NET client for the REST api of Neo4j)

There is the beginning of a documentation.

What I have done

The connection to the database works.

Client = new GraphClient(new Uri("http://localhost:7474/db/data"));
Client.Connect();

This way I can insert Nodes...

Client.Create(new myNodeClass { name = "Nobody" });

... and query them.

Node<myNodeClass> Node = Client.Get<WordNode>(138);
return Node.Data.name;

What I want to do

I simply want to add and update relationships between Nodes. (The type of relationship have to be numeric.)

Unfortunately there is no documentation about relationships yet.

There is a command named CreateRelationship. But I can't get it work.

Client.CreateRelationship(Neo4jClient.NodeReference<TSourceNode>, TRelationship);

Can you give me an example of adding and updating (numeric) relationships?


Solution

  • you could have a look at the tests, http://hg.readify.net/neo4jclient/src/4693da483a90/Test/RelationshipTests.cs or contact the author on the Neo4j mailing list, groups.google.com/group/neo4j ?