本文介绍了Neo4j-Cypher vs Gremlin查询语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用REST API开发Neo4j.我看到执行复杂查询的方法有两种:Cypher(Neo4j的查询语言)和Gremlin(通用图查询/遍历语言).

I'm starting to develop with Neo4j using the REST API.I saw that there are two options for performing complex queries - Cypher (Neo4j's query language) and Gremlin (the general purpose graph query/traversal language).

这就是我想知道的-是否有任何查询或操作可以通过使用Gremlin来完成,而不能通过Cypher来完成?反之亦然?

Here's what I want to know - is there any query or operation that can be done by using Gremlin and can't be done with Cypher? or vice versa?

对于我来说,Cypher似乎比Gremlin更清楚,总的来说,Neo4j中的家伙似乎正在与Cypher一起使用.但是-如果Cypher与Gremlin相比受到限制-我真的很想提前知道这一点.

Cypher seems much more clear to me than Gremlin, and in general it seems that the guys in Neo4j are going with Cypher.But - if Cypher is limited compared to Gremlin - I would really like to know that in advance.

推荐答案

对于一般查询,Cypher就足够了并且可能更快.相对于Cypher,Gremlin的优势在于您可以进行高级遍历.在Gremlin中,您可以更好地定义确切的遍历模式(或您自己的算法),而在Cypher中,引擎会尝试找到最佳的遍历解决方案本身.

For general querying, Cypher is enough and is probably faster. The advantage of Gremlin over Cypher is when you get into high level traversing. In Gremlin, you can better define the exact traversal pattern (or your own algorithms) whereas in Cypher the engine tries to find the best traversing solution itself.

由于其简单性,我个人使用了Cypher,到目前为止,我还没有遇到过必须使用Gremlin的情况(使用Gremlin graphML导入/导出功能除外).但是,我希望即使我需要使用Gremlin,我也会在网上找到特定的查询,而以后再也不会使用它.

I personally use Cypher because of its simplicity and, to date, I have not had any situations where I had to use Gremlin (except working with Gremlin graphML import/export functions). I expect, however, that even if i would need to use Gremlin, I would do so for a specific query I would find on the net and never come back to again.

您总是可以在几天之内真正快速地学习Cypher,然后继续(长期运行)通用Gremlin.

You can always learn Cypher really fast (in days) and then continue with the (longer-run) general Gremlin.

这篇关于Neo4j-Cypher vs Gremlin查询语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 01:40