neo4jclient

Node.ByIndexLookup and Where clause throwing exception

早过忘川 提交于 2019-12-11 20:32:36
问题 I am trying to understand as to why the neo4jClient throws an exception, hope someone here could help me better understand whats going on. first of all the following code works!! qry = qry.Start(new { city = Node.ByIndexLookup(model.City.IndexName, "Label", data.RegistredAddress.City), state = Node.ByIndexLookup(model.State.IndexName, "Label", data.RegistredAddress.State), country = Node.ByIndexLookup(model.Country.IndexName, "Label", data.RegistredAddress.Country), }); qry = qry.Match("(city

How to add edges(relationship) Neo4j in a very big graph

我怕爱的太早我们不能终老 提交于 2019-12-11 10:33:57
问题 I have a simple graph model. In this graph, Each node has an attribute {NodeId} . Each Edge will link two nodes without other attributes. It is an directed graph and has about 10^6 nodes. Here is my situation: I created index on attribute {NodeId} at first.Then I created 10^6 nodes. In this time, I have a graph with 10^6 nodes and no edges. When I want to randomly add edges, I found that the speed is very slow. I can only add about 40 edges per second. Did I miss any configurations? I don't

How to get result from Cypher Query in json using Neo4j C# Client

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:04:10
问题 i am using Neo4j 2.0.3 DB and using C# client to access neodb. I could not find any way by which after querying db i can get results in the form of Json. Please give me some links or examples 回答1: You can get Cypher Query results in JSON format eg. Consider a graph with person nodes and nodes have property personId. The below query will give you result in the form of json object. MATCH (n:PERSON)-[:friend]->(friend:PERSON) RETURN {personId: n.personId, friends: collect(distinct friend

Cannot serialize member <x> because it is an interface

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:49:46
问题 Follow on question from Error with explicit conversion when using CollectAs<> Code from WebMethod 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 { Person = person.As<Person>(), Language = language.CollectAs<Language>(), Country = country.CollectAs<Country>() })

Neo4j Merge and Atomic Transaction

。_饼干妹妹 提交于 2019-12-10 23:49:24
问题 I am running the below MERGE query against my Neo4j server from a client application in 10 parallel threads, the newFoo and id parameters are the same on all 10 runs: MERGE (foo:Foo { id: {id} }) ON MATCH SET foo = {newFoo} After running this, I run the below query to expect 1 but I instead get 10 : match (f:Foo) return count(f) I thought that MERGE runs in an atomic transaction but apparently not. Am I doing something wrong here? Update Below is the code that I used to reproduce the issue:

How to format DateTimeOffset in Html.TextBoxFor?

筅森魡賤 提交于 2019-12-10 17:07:23
问题 I have a view built on Bootstrap 3 and ASP.NET MVC 5 for editing user profile information, but it displays in the incorrect format on the form. The database is Neo4j and I'm using Neo4jClient to interact with the database from .NET. Neo4jClient requires the use of DateTimeOffset objects instead of DateTime objects to use Json.NET's serializer for passing to Neo4j's REST interface. Therefore, my model uses a DateTimeOffset object to store the birthday for a user. Here is my form field in my

Neo4j over bolt protocol has very high latency

人盡茶涼 提交于 2019-12-10 13:43:45
问题 I'm using Neo4j for a project using the official Neo4j driver for .NET found here: https://www.nuget.org/packages/Neo4j.Driver This driver works over the bolt protocol, my assumption being that a specialized binary protocol would be more efficient than the HTTP API. But ever since the start of the project, I've noticed relatively high latencies from Neo4j for even very simple operations. Such as a match like the following taking 30-60ms when UserID is an indexed field and the database

Neo4jClient - Merge within ForEach with 1000 very slow (Unique Constraint)

a 夏天 提交于 2019-12-10 11:40:57
问题 This stems off of this SO question: Map params with Merge or build a Batch operation via the client? This query: FOREACH (n in {set} | MERGE (c:Label {Id : n.Id}) SET c = n) Works well for being able to update or create new nodes based on a unique key (in this case, Id). It is, however, very slow. When I try to process a list of 42000 items, in batches of 1000, it takes about 2 minutes to complete. In terms of hardware, this is running on my laptop (i7, 8GB RAM, Samsung 840 Pro SSD). By the

Neo4j .NET Client - Getting a Path from a Node to its Root

余生长醉 提交于 2019-12-08 06:35:52
问题 I'm experimenting with Neo4j for the first time. I've played a bit with the console (Cypher queries) and now I'm trying to use the .NET client to build a DAL for a .NET application. For now, my data model is very simple: I have nodes with a label "Folder". These nodes may have a "HAS_SUB_FOLDER" relationship with other folder nodes. I've successfully done some queries such as MATCH (n:Folder) OPTIONAL MATCH n<-[r:HAS_SUB_FOLDER]-parent WITH n, count(parent) AS parents WHERE parents = 0 RETURN

neo4jClient create node with dynamic label using paramters

那年仲夏 提交于 2019-12-08 02:56:13
问题 I am building an app that give users the ability to construct there own graphs. I have been using parameters for all queries and creates. But when I want to give users the ability to create a node where they can also Label it anything they want(respecting neo4j restrictions on empty string labels). How would I parameterize this type of transaction? I tried this: .CREATE("(a:{dynamicLabel})").WithParams(new {dynamicLabel = dlabel})... But this yields a syntax error with neo. I am tempted to