Neo4jD–.NET client for Neo4j Graph DB
Last couple of days I was working on a small light weight .NET client for Neo4j. The client framework is still in progress. This post gives some existing Api’s in Neo4jD to perform basic graph operations. In Neo4j two main entities are Nodes and Relationships. So my initial focus for the client library is to deal with Node and Relationship. The communication between client and Neo4j server is in REST Api’s and the response from the server is in json format.
Let’s go through some of the Neo4j REST Api’s and the equivalent api’s in Neo4jD, you can see more details of Neo4j RestAPi’s here.
The below table will show how to call Neo4j REST Api directly from an application and the right hand will show how to do the same operation using Neo4jD client.
|Neo4j Api||Equivalent Neo4jD Api|
Response (click here to see full response)
|Node sony=new Node();
|Get Node by ID|
The Neo4jD will create a Rest request to fetch the Node with Id 1 and parse the json response and set the properties and required field.
|Create Relationship between two Nodes|
|Node sony=Node.Get(1); //Get an existing node
//Create a new node
Node viji=new Node();
RelationShip relation=sony.CreateRelationshipTo(viji, “wife”);
Client lib is still missing some basic features and I am working on it.
The next important part of the library is Graph traversing. Neo4j supports REST api, Cypher and Germlin for Graph traversing. I am currently writing a query creator for Germlin. So the initial version of Neo4jD will only support Germlin.
If any one wants to join the project feels free to send me a personal mail or add a comment. You all can have a look at the code in Git.