neo4jclient

Batch insert nodes and relations neo4jclient

巧了我就是萌 提交于 2019-12-22 05:19:19
问题 I have many nodes and edges in a list. Currently I'm looping through the list and inserting each node with a query which is very slow. How do I perform a batch insert using neo4jclient? Node object: public class myNode { public int id { get; set; } public int floor { get; set; } public double x { get; set; } public double y { get; set; } } Current method for inserting a node: public static void addNode(GraphClient client, myNode node, string nodeName) { client.Cypher .Create("(" + nodeName +

Returning multiple columns in Neo4jClient Cypher Query

人走茶凉 提交于 2019-12-21 23:04:00
问题 I am using Azure and finding the performance to be slow. In order to reduce the round trip time, I am clubbing the following queries into one query. var queryItem = _graphClient .Cypher .Start(new { n = Node.ByIndexLookup("item_idx", "SKU", sSKU1), }) .Return<Node<Item>>("n"); somewhere else in the code I have following statements var queryItem = _graphClient .Cypher .Start(new { m = Node.ByIndexLookup("item_idx", "SKU", sSKU2), }) .Return<Node<Item>>("m"); I tried to combine above two

Incorrect sort order with Neo4jClient Cypher query

别等时光非礼了梦想. 提交于 2019-12-20 05:41:36
问题 I have the following Neo4jClient code var queryItem = _graphClient .Cypher .Start(new { n = Node.ByIndexLookup("myindex", "Name", sku), }) .Match("p = n-[r:Relationship]->ci") .With("ci , r") .Return((ci, r) => new { N = ci.Node<Item>(), R = r.As<RelationshipInstance<Payload>>() }) .Limit(5) .Results .OrderByDescending(u => u.R.Data.Frequency); The query is executing fine but the results are not sorted correctly (i.e. in descending order). Here is the Payload class as well. Please let me know

Return overload fails

房东的猫 提交于 2019-12-20 02:01:11
问题 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

Return overload fails

北城以北 提交于 2019-12-20 02:01:06
问题 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

Neo4jClient - Retrieving relationship from Cypher query

你离开我真会死。 提交于 2019-12-18 09:23:34
问题 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")

Can Neo4j store a dictionary in a node?

心已入冬 提交于 2019-12-17 13:23:37
问题 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

Error with explicit conversion when using CollectAs<>

拈花ヽ惹草 提交于 2019-12-13 18:50:21
问题 Right I have a really simple problem, but I cannot for the life of me think of the really simple answer to go with it. This code is supposed to return a single 'Person', with a collection of languages and countries. return client.Cypher .Match("(person:Person)") .Where((Person person) => person.Email == username) .OptionalMatch("(person)-[:SPEAKS]-(language:Language)") .OptionalMatch("(person)-[:CURRENT_LOCATION]-(country:Country)" .Return((person, language, country) => new ProfileObject {

Returning property and count columns together in Neo4jClient Cypher Query

元气小坏坏 提交于 2019-12-13 06:13:19
问题 I have a Cypher query likes this: START n=node:permit_idx(PmtID= "111") Match n-[:Assinged]->m<-[:Assinged]-p RETURN p.PmtID, count(m); I got error when I try to do it using Neo4jClient Cypher Query var results = graphClient .Cypher .Start(new { n = Node.ByIndexLookup("permit_idx", "PmtID", "111") }) .Match("Match n-[:Assigned]->m<-[:Assigned]-p") .Return((m, p) => new { PDPmtID = "p.PmtID", MCount = "count(m)" }) .Results; If only need to return one property or one count, we can use .Return

How to import data into neo4j (neo4j-community-2.0.0) in windows 7?

China☆狼群 提交于 2019-12-13 05:59:02
问题 I got the below link to do this but the problem is that it's for linux users !!! http://blog.neo4j.org/2013/03/importing-data-into-neo4j-spreadsheet.html Please help me to get this done on windows ? Thanks in advance. I am new to neo4j and got only a little hands on experience on java. I added neo4jtools to my neo4j server from the below link https://github.com/jexp/neo4j-shell-tools then I follow this command to import few data to a graph database neo4jshell -path C:\Program Files\neo4j