{"id":23420776,"url":"https://github.com/weknow-network/weknow.cypher.builder","last_synced_at":"2026-02-27T09:11:59.074Z","repository":{"id":62355876,"uuid":"228364256","full_name":"weknow-network/Weknow.Cypher.Builder","owner":"weknow-network","description":"This library is still in alpha phase. this means that the API still constantly changing.","archived":false,"fork":false,"pushed_at":"2023-03-12T13:34:01.000Z","size":1630,"stargazers_count":2,"open_issues_count":20,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T08:48:33.247Z","etag":null,"topics":["csharp","cypher","cypher-query","neo4j","netcore","orm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weknow-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-16T10:43:37.000Z","updated_at":"2023-07-27T12:06:07.000Z","dependencies_parsed_at":"2024-11-14T14:36:47.642Z","dependency_job_id":null,"html_url":"https://github.com/weknow-network/Weknow.Cypher.Builder","commit_stats":{"total_commits":612,"total_committers":4,"mean_commits":153.0,"dds":0.6666666666666667,"last_synced_commit":"3b4704b4b1b58a6f510ea8f89ca9a8e1a4ded226"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weknow-network%2FWeknow.Cypher.Builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weknow-network%2FWeknow.Cypher.Builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weknow-network%2FWeknow.Cypher.Builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weknow-network%2FWeknow.Cypher.Builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weknow-network","download_url":"https://codeload.github.com/weknow-network/Weknow.Cypher.Builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578856,"owners_count":21127713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","cypher","cypher-query","neo4j","netcore","orm"],"created_at":"2024-12-23T02:11:53.133Z","updated_at":"2026-02-27T09:11:59.035Z","avatar_url":"https://github.com/weknow-network.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weknow Cypher Builder **Beta**.  \n[![Build \u0026 Deploy NuGet](https://github.com/weknow-network/Weknow.Cypher.Builder/actions/workflows/Deploy.yml/badge.svg)](https://github.com/weknow-network/Weknow.Cypher.Builder/actions/workflows/Deploy.yml)\n\n\n## Usage\n- [**Weknow.Cypher.Builder:**](https://www.nuget.org/packages/Weknow.Cypher.Builder) Produce Cypher Query from structural C# builder.  \n  `dotnet add package Weknow.Cypher.Builder`\n- [**Weknow.GraphDbClient.Abstraction:**](https://www.nuget.org/packages/Weknow.GraphDbClient.Abstraction) Abstract Graph Database client.  \n  `dotnet add package Weknow.GraphDbClient.Abstraction`\n- [**Weknow.GraphDbClient.Redis:**](https://www.nuget.org/packages/Weknow.GraphDbClient.Redis) Client implementation for Redis Graph (Not implementes yet).  \n  `dotnet add package Weknow.GraphDbClient.Redis`\n- [**Weknow.GraphDbClient.Neo4j:**](https://www.nuget.org/packages/Weknow.GraphDbClient.Neo4j) Client implementation for Neo4j.  \n  `dotnet add package Weknow.GraphDbClient.Neo4j`\n\n## Goals\nCypher Builder aim to be developer friendly library for cypher query.\nIt bring as match intellisense \u0026 cypher correction as it can while keeping the Cypher expression readable and well documented.  \n\nWhen this library evolve over time, we consider:\n- Source code generation which will provide a type-safe parameters \n- Analyzer which will recommend best practice\n\n## Samples\n\n```cs\nvar n = Variables.Create();\nvar Id = Parameters.Create();\nCypherCommand cypher = _(() =\u003e Match(N(n, Person \u0026 Manager, new { Id }))\n                        .Return(n));\n```\nProduce: \n```cypher\nMATCH (n:Person:Manager {{ Id: $Id }}) RETURN n\n```\n\n---\n\n```cs\nvar items = Parameters.Create();\nvar n = Variables.Create();\nvar map = Variables.Create\u003cFoo\u003e();\n\nCypherCommand cypher = _(() =\u003e\n                        Unwind(items, map,\n                        Merge(N(n, Person, new { map.__.Id, map.__.Name }))\n                        .OnCreateSet(n, map)\n                        .Return(n)),\n                        cfg =\u003e cfg.Naming.Convention = CypherNamingConvention.SCREAMING_CASE);\n\n```\nProduce: \n```cypher\nUNWIND $items AS map\nMERGE (n:me1.Member.Name {{ Id: map.Id, Name: map.Name }})\n  ON CREATE SET n = map\nRETURN n\n```\n\n\u003e Note: *The label `Person` become `me1.Member.Name` because of the `SCREAMING_CASE` convention*\n\n\n## GraphDb Client\n\n### Make your first insert\n\n1. Define a schema\n\n```cs\npublic ILabel Person =\u003e throw new NotImplementedException();\npublic IType Follow =\u003e throw new NotImplementedException();\n```\n\u003e Yes, we believe in schema 😃\n\n2. Create entity class/record.\n\n```cs\n[Dictionaryable(Flavor = Flavor.Neo4j)]\nprivate partial record Person(string name, int age);\n```\n\n\u003e Node: [`[Dictionaryable]`](https://github.com/weknow-network/Weknow.Mapping.Generation) is using [Weknow.Mapping.Generation.SrcGen](https://www.nuget.org/packages/Weknow.Mapping.Generation.SrcGen) in order to generate serialization code out of `record Person`.\n\n3. Write a Cypher query.\n\n```cs\nvar map = Parameters.Create\u003cPersonEntity\u003e();\n\nCypherCommand cypher = _(user =\u003e\n                        Create(N(user, Person, map)));\n````\n\u003e Produce: `CREATE (user:Person $map)`\n\n4. To execute the query, you can use [GraphDb Client](GraphDB-Client).\n\n```cs\nCypherParameters prms = cypher.Parameters\n                              .AddOrUpdate(nameof(map), new Person(\"Nina\", 76));\nawait _graphDB.RunAsync(cypher, prms);\n```\n\n---\n\nSee more on our [wiki](https://github.com/weknow-network/Weknow.Cypher.Builder/wiki)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweknow-network%2Fweknow.cypher.builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweknow-network%2Fweknow.cypher.builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweknow-network%2Fweknow.cypher.builder/lists"}