简体   繁体   English

Neo4j 在 .net core 3.0 中使用 Gremlin 查询

[英]Neo4j using Gremlin query in .net core 3.0

We currently use gremlin.net library in a net core 3.0 application to connect to Azure Cosmos db.我们目前在 net core 3.0 应用程序中使用 gremlin.net 库来连接到 Azure Cosmos db。 We would like to connect to neo4j.我们想连接到neo4j。

  1. Can we use same gremlin.net library for neo4j?我们可以为 neo4j 使用相同的 gremlin.net 库吗? Assuming gremlin server is installed.假设安装了 gremlin 服务器。
  2. Will Neo4j.Driver library support gremlin queries? Neo4j.Driver 库是否支持 gremlin 查询? What exact library to use?要使用什么确切的库?
  3. Any code sample to connect and create a node in neo4j using gremlin library for a .net core 3.0 application?使用gremlin库为.net core 3.0应用程序连接和在neo4j中创建节点的任何代码示例?
  4. Is neo4j really a better graph model than Azure cosmos? neo4j 真的是比 Azure Cosmos 更好的图模型吗?

Can we use same gremlin.net library for neo4j?我们可以为 neo4j 使用相同的 gremlin.net 库吗? Assuming gremlin server is installed.假设安装了 gremlin 服务器。

Yes, assuming you mean Gremlin.Net and yes, Gremlin Server should be installed hosting neo4j.是的,假设您的意思是Gremlin.Net ,是的,Gremlin Server 应该安装托管 neo4j。

Will Neo4j.Driver library support gremlin queries? Neo4j.Driver 库是否支持 gremlin 查询? What exact library to use?要使用什么确切的库?

I don't think that's possible.我不认为那是可能的。 Neo4j drivers will support Cypher based queries, not Gremlin. Neo4j 驱动程序将支持基于 Cypher 的查询,而不是 Gremlin。

Any code sample to connect and create a node in neo4j using gremlin library for a .net core 3.0 application?使用gremlin库为.net core 3.0应用程序连接和在neo4j中创建节点的任何代码示例?

The beauty of Gremlin is that the code examples for one graph database are the same for any other and for the most part, Gremlin in Java is the same as Gremlin in .NET or any other programming language (aside from changes that make Gremlin more ergonomic to the programming language itself). Gremlin 的美妙之处在于,一个图形数据库的代码示例对于任何其他图形数据库都是相同的,并且在大多数情况下,Java 中的 Gremlin 与 .NET 或任何其他编程语言中的 Gremlin 相同(除了使 Gremlin 更符合人体工程学的更改之外)到编程语言本身)。 So, if you want to create a node then it's always going to be:所以,如果你想创建一个节点,那么它总是:

using static Gremlin.Net.Process.Traversal.AnonymousTraversalSource;

var g = Traversal().WithRemote(
    new DriverRemoteConnection(new GremlinClient(new GremlinServer("localhost", 8182))));
g.AddV("person").Property("name","Bob").Iterate();

Is neo4j really a better graph model than Azure cosmos? neo4j 真的是比 Azure Cosmos 更好的图模型吗?

My personal opinion is that you try them both and determine which is better for yourself given you requirements.我个人的意见是,您可以同时尝试它们,然后根据您的要求确定哪个更适合您。 That is the choice that Apache TinkerPop and Gremlin help to give you in that you can try lots and lots of different graph systems out there to find the one best suited to your needs.这是Apache TinkerPop和 Gremlin 为您提供的选择,因为您可以尝试大量不同的图形系统,以找到最适合您需求的系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM