使用Neo4J Traversal API在其他计算机上运行的Neo4J上执行遍历 [英] Using Neo4J Traversal API to perform traversal on Neo4J running on other machine

查看:154
本文介绍了使用Neo4J Traversal API在其他计算机上运行的Neo4J上执行遍历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读了遍历API之后,我喜欢BranchSelectorExpanderUniqueness的概念.就像描述如何遍历一样.换句话说,我感觉要对要执行的遍历进行声明式描述.流利的API非常适合用于此目的.但是,它似乎只能用于可通过文件系统访问其数据库的neo4j,即我们需要指定graph.db文件夹路径.这实质上意味着我们只能在嵌入式模式下使用它.我们可以使用遍历API对在远程计算机上运行的图形执行遍历吗?

After reading through Traversal API, I liked the idea the concept of BranchSelector, Expander and Uniqueness. It is something like describing how traversal should be made. In other words, I felt it like giving declarative description of traversal to be performed. The fluent API is well suited for this purpose. However it seems that it can only be used to target neo4j whose database can be accessed through file system, that is we need to specify graph.db folder path. This essentially means we can only use it in embedded mode. Can we use traversal API to perform traversal on graph running on remote machine?

尤其是我想方便地使用API​​(BranchSelectorExpanderUniqueness)来执行遍历.

Especially I want to have the convenience of API (BranchSelector, Expander and Uniqueness) available to perform traversal.

我读到我们可以使用bolt访问嵌入式neo4j.但是,这似乎并不意味着我们可以从远程计算机使用嵌入式neo4j.

I read we can use bolt to access embedded neo4j. However this does not seem to mean that we can use embedded neo4j from remote machine.

因此,如果我无法访问图形数据库的物理(或目录)位置,似乎他们无法使用遍历API.是吗?

So it seems that their is no way to use Traversal API if I cannot have access to physical (or directory) location of graph database. Is it so?

推荐答案

Traversal API 仅在代码与数据共存时才能使用,否则通常会非常慢.问题在于它不是纯声明性的,因为您可以提供PathExpanderEvaluator等的实现,而不是仅使用预定义的常量.

The Traversal API can only be used if the code is colocated with the data, otherwise it would usually be awfully slow. The problem is that it's not purely declarative, since you can provide implementations of PathExpander, Evaluator, etc. instead of only using pre-defined constants.

但是,有几种方法可以使代码共置:

However, there are several ways of having this code colocated:

  • one is indeed by using Neo4j in embedded mode, as you have noted
  • another one is by extending Neo4j, using either used-defined procedures / functions, or unmanaged extensions

有关Neo4j社区开发的程序集合,请参见 APOC ,包括一些遍历.

See APOC for a collection of procedures developed by the Neo4j community, including some traversals.

这篇关于使用Neo4J Traversal API在其他计算机上运行的Neo4J上执行遍历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆