Neo4j using Gremlin query in .net core 3.0 - neo4j

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.
Can we use same gremlin.net library for neo4j? Assuming gremlin
server is installed.
Will Neo4j.Driver library support gremlin
queries? What exact library to use?
Any code sample to connect and
create a node in neo4j using gremlin library for a .net core 3.0
application?
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.

Related

Object Mapping for neo4j in Java EE with JPA

I was wondering if I could use the libraries from org.springframework.data.graph as a JPA Persistence Provider in Java EE. I haven't tried this yet, but was wondering if it is even reasonable to expect this to work in Java EE, or if the JPA implementations would only work with Spring.
I'm just getting started with neo4j and have done some basic things using the neo4j JDBC Driver with some Cypher statements, but am looking for a way to use neo4j in Java EE the same way I would with a relational store like MySQL.
While JPA provides a great abstraction layer for relational databases when it was devised, it doesn't quite have the flexibility to abstract NoSQL databases.
If you want a JPA/Hibernate like experience though the Neo4J OGM might be the thing you want. You can check out the documentation here too.
That said, if you use a Spring container then you may want to check out Spring Data Neo4J (Version 4.2.0.RELEASE is going to be out in a couple of weeks), which wraps the OGM and provides developers with concepts found in Spring Data.
The Neo4J JDBC driver is meant to be more of a crutch to help developers connect to Neo4J over JDBC. I wouldn't recommend building any production type applications on it.

API for PL/SQL to Neo4j equivalent

Is any API or tool available to convert PL/SQL procedure, functions to neo4j equivalent ?? Currently I use Oracle 10 as my data source and planning to switch to Neo4j.
No, there is not such a tool. Also it could be hard to do that, because Oracle is a RDBMS and Neo4j is a Graph database.
I'm not saying it's not possible, but you'll doing it once and it's better to write them by your own. And then ask here on StackOverflow if you aren't sure how to replicate in the Neo4j.

Neo4j: difference between tinkerpop gremlin and aurelius gremlin

as I was wandering in the Web looking for a Gremlin implementation for Neo4j I found these two possible solutions:
https://github.com/thinkaurelius/neo4j-gremlin-plugin
http://tinkerpop.incubator.apache.org/docs/3.0.2-incubating/#neo4j-gremlin
Does anybody know what is the difference between the two in practice?
I saw that 1. is a Neo4j plugin while it's not really clear to me what the second is, and if it would lock the entire database thus not allowing other connections (I noticed that it requires the path to the data folder).
Which one is preferred in the neo4j community?
Cheers,
Alberto
I'm not sure there's really a difference as there isn't a direct comparison to be made. The second link is to the TinkerPop project and specifically to the Neo4j implementation of TinkerPop APIs. It runs in an embedded mode and does not yet have support for HA (though we hope to have that soon). The Neo4j implementation can be run in Gremlin Server which let's you send Gremlin to it as a REST, websockets, etc endpoint.
The project in the first link you provided uses that implementation to allow you to send Gremlin to Neo4j Server - so the first project depends on the second.
Your rule of thumb should be activity in the source code.
neo4j-gremlin-plugin has 3 commits this year - https://github.com/thinkaurelius/neo4j-gremlin-plugin/commits/master
tikerpop is much more active - https://github.com/apache/incubator-tinkerpop/commits/master/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j
neo4j-gremlin-plugin
Extending existing Neo4j server with support for Gremlin Query Language.
TinkerPop Neo4j-Gremlin
Extending Gremlin console with support for Neo4j server.

SOA Architecture, Android and Neo4j?

I am working on scientific project and i am currently studying the possibility to use graph databases.
The software architecture that we developed is service oriented with android clients.
I want to know if Neo4j can be used in my case and the most important if i can execute Cypher requests from Android.
Cheers
As #MarcoCI mentioned you can emit Cypher queries via REST. Neo4j therefore has the transactional Cypher endpoint and the legacy Cypher endpoint.
Another idea would be to encapsulate your actions on a use-case level within unmanaged extensions and let your Android client trigger those. Unmanaged extensions are basically java code deployed to the Neo4j server that expose new REST endpoints. Within its implementation you might use Cypher or core API.

JCR (JackRabbit, ModeShape) vs. Graph (Neo4j)

In order to store hierarchical data, can a graph database (Neo4j) be viewed as an alternative to JCR based solutions (ModeShape, JackRabbit)? Or do they belong to 2 different level of abstraction meaning that a JCR implementation could use Neo4j under the hood?
Thank you for your help.
Both, people are building CMS applications with Neo4j as storage backend (see http://structr.org)
A JCR implementation could also be done using Neo4j, some people worked on that in the past, we also have a group using Neo4j as backend storage for Apache Shindig.
You also might want to take a look at OrientDB (http://www.orientdb.org/) which combines features of a Graph-DB (as Neo4j) with those of a Document-DB. There even seems to be a prototype implementation using OrientDB as a storage-adapter for Jackrabbit (https://github.com/eiswind/jackrabbit-orient) that illustrates the implementation of such a hybrid approach.

Resources