简体   繁体   中英

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. We would like to connect to neo4j.

  1. Can we use same gremlin.net library for neo4j? Assuming gremlin server is installed.
  2. Will Neo4j.Driver library support gremlin queries? 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?
  4. Is neo4j really a better graph model than Azure cosmos?

Can we use same gremlin.net library for neo4j? Assuming gremlin server is installed.

Yes, assuming you mean Gremlin.Net and yes, Gremlin Server should be installed hosting neo4j.

Will Neo4j.Driver library support gremlin queries? What exact library to use?

I don't think that's possible. Neo4j drivers will support Cypher based queries, not Gremlin.

Any code sample to connect and create a node in neo4j using gremlin library for a .net core 3.0 application?

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). 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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