neo4jclient

How to create an embedded Neo4j database in c#

眉间皱痕 提交于 2019-12-01 21:26:29
How do I create an embedded Neo4j database in c#? I want to perform queries on this embedded database for testing and then discard it. Currently i'm using neo4jclient for performing queries on the database running on my system(localhost) but want to do this on an embedded database. How do I go about this? This feature is present in Java in the following way: GraphDatabaseFactory graphDbFactory = new GraphDatabaseFactory(); GraphDatabaseService graphDb = graphDbFactory .newEmbeddedDatabase("data/dbName"); Looking for something along these lines in c#. It's not possible to do that. Neo4j is a

Neo4J create temp variable within Cypher

别来无恙 提交于 2019-12-01 21:04:10
So my Top-Level problem is I am trying to return whether a MERGE resulted in the creation of a new Node or not. In order to do this I was thinking I could just create a simple temp boolean setting it to TRUE using ON CREATE How I imagine it working: MERGE(: Person {id:'Tom Jones'}) WITH false as temp_bool ON CREATE set temp_bool = true RETURN temp_bool Obviously this does not work. I am looking for a way to create arbitrary temp values within a Cypher query, and have the ability to return those variables in the end. Thanks FrobberOfBits You can do what you want, here's how (combination of my

Return overload fails

ぃ、小莉子 提交于 2019-12-01 18:35:23
I'm following this little write up: https://github.com/Readify/Neo4jClient/wiki/cypher but I'm doing it from Powershell. so what I have so far is [System.Reflection.Assembly]::LoadFrom("C:\...\Newtonsoft.Json.6.0.3\lib\net40\NewtonSoft.Json.dll") [System.Reflection.Assembly]::LoadFrom("C:\...\Neo4jClient.1.0.0.662\lib\net40\Neo4jClient.dll") $neo = new-object Neo4jClient.GraphClient(new-object Uri("http://localhost:7474/db/data")) $q=$neo.Cypher.Match("n").Return({param($m) $m}); with which I would mean to retrieve all nodes in the database. the Return() method is shown in the example to

Constructing a method call

為{幸葍}努か 提交于 2019-12-01 09:37:36
in trying to follow this guide: https://github.com/Readify/Neo4jClient/wiki/cypher-examples#get-all-users-by-label I need to create a lambda expression in order to provide it to the Return method. In C# it looks like this: .Return(n => n.As<Project>()) and in Powershell I've gone about it this way (as per @PetSerAl's suggestion: Return overload fails ): $exp = [System.Linq.Expressions.Expression] $param = $exp::Parameter([Neo4jClient.Cyper.ICypherResultItem], "n") $body = $exp::TypeAs($p, (new-object Project).GetType()) $lambda = $exp::Lambda([Func[Project]], $body, $p) such that the parameter

Neo4jClient - Retrieving relationship from Cypher query

别说谁变了你拦得住时间么 提交于 2019-11-29 16:56:42
I'm having trouble retrieving matched relationships from a Cypher query. I have this simple trial code: var movie = client.Create(new Movie { Title = "The Matrix" }); client.Create(new Actor { Name = "Keanu Reeves" }, new ActedIn(movie, new ActedInPayload { Role = "Neo" })); client.Create(new Actor { Name = "Hugo Weaving" }, new ActedIn(movie, new ActedInPayload { Role = "Agent Smith" })); var actorsAndRoles = client .Cypher .Start(new { movie = movie }) .Match("actor-[r:ACTED_IN]->movie") .Return((actor, r) => new { Actor = actor.As<Node<Actor>>() // ActedIn = r.As<?????>() }) .Results;

Can Neo4j store a dictionary in a node?

↘锁芯ラ 提交于 2019-11-27 15:19:44
I an working on c# and use neo4jclient. I know neo4jclient can create a node if I pass a class object to it (I have tried it) Now in my class I want to add a dictionary property, this doesn't work. My code: GraphClient client = getConnection(); client.Cypher .Merge("(user:User { uniqueIdInItsApp: {id} , appId: {appId} })") .OnCreate() .Set("user = {newUser}") .WithParams(new { id = user.uniqueIdInItsApp, appId = user.appId, newUser = user }) .ExecuteWithoutResults(); The User contains a property that is a Dictionary in C#. When executing the cypher it shows the error MatchError: Map() (of

Casting nodes of an unknown type

流过昼夜 提交于 2019-11-27 09:51:44
In using Neo4j I'm able to create an array of nodes with labels and then create relationships between those nodes. The labels are essentially mappings to my POCOs (the Dog label relates to a Dog POCO in C#) and these POCOs implement from a simple base POCO containing only an ID property. When I know the type/label of the node to retrieve, I'm able to cast it using the node.As < T > syntax within the return statement. However, when doing things such as traversing a path between nodes, I will not know the type of the node that I am traversing. While it is technically possible to cast the node as

Casting nodes of an unknown type

懵懂的女人 提交于 2019-11-26 14:58:28
问题 In using Neo4j I'm able to create an array of nodes with labels and then create relationships between those nodes. The labels are essentially mappings to my POCOs (the Dog label relates to a Dog POCO in C#) and these POCOs implement from a simple base POCO containing only an ID property. When I know the type/label of the node to retrieve, I'm able to cast it using the node.As < T > syntax within the return statement. However, when doing things such as traversing a path between nodes, I will