neo4jclient

Neo4j Client, how to retrieve node by id?

旧城冷巷雨未停 提交于 2019-12-06 16:03:23
I am trying to figure out the way to retrieve node by id. MATCH (n) WHERE ID(n) = {id} RETURN n , is the Cypher I used with REST interface. Now using fluent syntax of Neo4j Client for .net I cannot find the function name in Neo4J.Cypher namespace, like for instance ALL. Anybody knows how to re-write that query in fluent syntax? client.Cypher .Match("(node:Employee)") .Where(node=>**?**(node)== 3) .Return(node) There is no ID function name in the codebase, so you have to go old skool I'm afraid - the code below still uses parameters... client.Cypher .Match("(node:Employee)") .Where("ID(n) =

Neo4jClient - Create index from within Neo4jClient?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 04:28:14
问题 Is there a way to create an index from within Neo4jClient? I've done a raw query, but don't think that's the best option. My reason for doing so is in testing purposes where I need to drop/recreate databases to test performance of different designs. 回答1: You can do indexes like: graphClient.Cypher .Create("INDEX ON :Label(Property)") .ExecuteWithoutResults(); and constraints like: graphClient.Cypher .CreateUniqueConstraint("identity", "property") .ExecuteWithoutResults(); (originally from How

Batch insert nodes and relations neo4jclient

我的未来我决定 提交于 2019-12-05 07:52:47
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 + ":Node {node})") .WithParams(new { node }) .ExecuteWithoutResults(); } Current method for inserting

Neo4JClient - How To Add Node to Index

守給你的承諾、 提交于 2019-12-05 05:56:10
问题 I need a very simple example of how to add a node to an index with using Neo4JClient In the following C# code I have created an index and an employee node. Question: In the following code, how can the node that was created be added to the index? The solutions should allow for the ability to search on EmployeeID or Name. class Program { static void Main(string[] args) { //Connect to Neo4J var graphClient = new GraphClient(new Uri(@"http://localhost:7474/db/data")); graphClient.Connect(); /

Returning multiple columns in Neo4jClient Cypher Query

喜你入骨 提交于 2019-12-04 17:35:31
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 queries into a single query like this var queryItem = _graphClient .Cypher .Start(new { n = Node

Neo4jClient - Create index from within Neo4jClient?

亡梦爱人 提交于 2019-12-04 09:54:38
Is there a way to create an index from within Neo4jClient? I've done a raw query, but don't think that's the best option. My reason for doing so is in testing purposes where I need to drop/recreate databases to test performance of different designs. Chris Skardon You can do indexes like: graphClient.Cypher .Create("INDEX ON :Label(Property)") .ExecuteWithoutResults(); and constraints like: graphClient.Cypher .CreateUniqueConstraint("identity", "property") .ExecuteWithoutResults(); (originally from How to Create a Node with Neo4jClient in Neo4j v2? ) 来源: https://stackoverflow.com/questions

ASP.NET and Neo4jClient - where to store the connection?

十年热恋 提交于 2019-12-04 09:31:44
The C# Neo4JClient has GraphClient where you have to call .Connect() var client = new GraphClient(new Uri("http://localhost:7474/db/data")); client.Connect(); In all of the examples that I've seen, it's in a Console app, so they declare GraphClient in Main() and re-use it. And the documentation mentions how its Thread Safe and to only have one instance per database and to not call .Connect() multiple times. But what about in ASP.NET applications? Should I be sticking it in some static class that is accessed by the pages (or store it in the Application state)? Like this: public class

Neo4J create temp variable within Cypher

社会主义新天地 提交于 2019-12-04 03:45:53
问题 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

How to Create a Node with Neo4jClient in Neo4j v2?

和自甴很熟 提交于 2019-12-03 05:18:15
问题 Under Neo4j v1.9.x, I used the following sort of code. private Category CreateNodeCategory(Category cat) { var node = client.Create(cat, new IRelationshipAllowingParticipantNode<Category>[0], new[] { new IndexEntry(NeoConst.IDX_Category) { { NeoConst.PRP_Name, cat.Name }, { NeoConst.PRP_Guid, cat.Nguid.ToString() } } }); cat.Nid = node.Id; client.Update<Category>(node, cat); return cat; } The reason being that the Node Id was auto generated and I could use it later for a quick look up, start

Remote Neo4j web console

帅比萌擦擦* 提交于 2019-12-02 20:26:29
问题 I am using Neo4j 2.0 server on Cent-OS machine. This needs be accessed from a remote web-based console. In the database,the server data location points to the folder containing the data. When I start the database and try to access it from a remote machine, the data doesn't show up. What could be the reason for this ?? I modeled the database on a windows machine and then take this data to remote unix machine and point that server to this folder(which is created on windows, but on UNIX based