Dear Devs, Dear Community & fellow Travellers,
I am currently working on a vvvv - Neo4j connector and Statement Library / Generator.
Neo4j is a Graph Database provider an i believe that there are endless application possibilities when used in vvvv gamma. Check out their website and docs if you haven’t already, even a noob like me could grasp the basic concepts of the query language “Cypher” in a couple of hours. https://neo4j.com
It comes with a c# driver on nuget.org which is easy peasy to integrate: [NuGet Gallery | Neo4j.Driver 5.27.0](Neo4j Nuget)
Neo4j .NET https://neo4j.com/docs/pdf/neo4j-driver-manual-1.7-dotnet.pdf
I currently run a neo4j instance on aws ec2 and have already successfully established connection out of vvvv gamma. There are three types of transactions you can perform which are:
- Auto Commit Transactions
- Transaction Functions
- Explicit Transactions
I managed to get an Auto Commit Transaction going by following the example code:
public void AddPerson(string name) {
using (var session = Driver.Session())
{
session.Run("CREATE (a:Person {name: $name})", new {name});
}
}
and translating it into this:
I am now trying to use Transaction Functions as they provide more functionality and allow more complex Cipher statements.
The code example for this is the following:
public void AddPerson(string name)
{
using (var session = Driver.Session())
{
session.WriteTransaction(tx => tx.Run("CREATE (a:Person {name: $name})", new {name}));
}
}
I figuered that this would include delegates and i tinkered around a little but am stuck.
This is how far i came:
I tried different delegates/different output counts/ also the System Func`1 stuff, nothing works.
Is the delegate approach even correct? What am I doing worng?
Any help would be highly appreciated and i am looking forward to build some Cypher Statement helpers that would make live easier by the power of vvvv gamma!
Thank you for your time!
J