Live data from Hacker News

Graph query languages: Cypher vs. Gremlin vs. nGQL

nebula-graph.io

1–10 of 66 posts

Re: Graph query languages: Cypher vs. Gremlin vs. nGQL

#5
post #3

I rather like Cypher, easy to get into with the (node)-[edge]->(node) construction, difficult in the middle (until you realise that WITH is very different to SQL's), then a delight. Gremlin, so they let Java's horrible camelCase leak into their syntax? Oh my ...

I've been using Cypher (neo4j) for a bit over a year now, and I low it. We'd need a dozen JOINs to do some of our queries in SQL, but in Cypher it's very natural to write complex relationships.

Overuse of WITH does make it a bit more imperative, but also makes it easy to shape the result in the form you want it in. Cypher has been a joy to work with. Gremlin, by comparison, does not attract me at all.

Re: Graph query languages: Cypher vs. Gremlin vs. nGQL

#6
post #3

I rather like Cypher, easy to get into with the (node)-[edge]->(node) construction, difficult in the middle (until you realise that WITH is very different to SQL's), then a delight. Gremlin, so they let Java's horrible camelCase leak into their syntax? Oh my ...

You write Gremlin in the programming language of your choice and with that comes the idioms of that language. For Java that means, camelCased syntax as that is what Java developers expect. So a function like hasLabel("person") looks right to them. In C#, that same function is HasLabel("person") and in Clojure it is (has-label :person) and so on. Gremlin isn't meant to be an embedded string within your programming language. It is actual code within your programming language.

Re: Graph query languages: Cypher vs. Gremlin vs. nGQL

#7
Sorry, but this article fails big time: no mention at all of SPARQL.

For application developers, having access to general public Knowledge Graphs like DBPedia and WikiData can be a very good resource.

While I am also a big fan of more general graph databases like Neo4J, not even mentioning SPARQL is such a HUGE OMISSION that I have to suspect some commercially motivated bias in this article.

The decision of which graph data platform to use is not always black and white. Use SPARQL with a RDF/OWL data store or a more general graph data store like Neo4J as appropriate. Learn both technologies.

Re: Graph query languages: Cypher vs. Gremlin vs. nGQL

#8
post #4

Is anybody still using SPARQL?

I am using SPARQL on a commercial product I am developing and also for a future product (I am a solo developer, so one product at a time).

As I mentioned in another comment, the SPARQL endpoints for WikiData and DBPedia are fantastic resources, for some projects.

Re: Graph query languages: Cypher vs. Gremlin vs. nGQL

#9
post #3

I rather like Cypher, easy to get into with the (node)-[edge]->(node) construction, difficult in the middle (until you realise that WITH is very different to SQL's), then a delight. Gremlin, so they let Java's horrible camelCase leak into their syntax? Oh my ...

You write Gremlin in the programming language of your choice and with that comes the idioms of that language. For Java that means, camelCased syntax as that is what Java developers expect. So a function like hasLabel("person") looks right to them. In C#, that same function is HasLabel("person") and in Clojure it is (has-label :person) and so on. Gremlin isn't meant to be an embedded string within your programming lan…

Well I stand corrected. I was judging from the examples in the linked article, so will have another look ...

Re: Graph query languages: Cypher vs. Gremlin vs. nGQL

#10
post #4

Is anybody still using SPARQL?

Yes.. I work on several projects that leverage SPARQL. The article is also remiss in not mentioning the work the W3C is doing along with Neo4J to do its own alignment (https://www.w3.org/Data/events/data-ws-2019/). Indeed, this article seems very self serving in its omissions. There is a follow up meeting planned soon for that too.

Also, much of the work in validation (SHACL, Shex) of graphs leverages SPARQL so it's not going anwhere soon. I would like to see it evolve to allow more vertex based searches without the need for extensions though.

Post reply on HN