如何让本地的 Neo4j 支持 APOC 库

APOC 是啥

Neo4j 3.x introduced the concept of user-defined procedures and functions. Those are custom implementations of certain functionality, that can’t be (easily) expressed in Cypher itself. They are implemented in Java and can be easily deployed into your Neo4j instance, and then be called from Cypher directly.

The APOC(Awesome Procedures On Cypher) library consists of many (about 450) procedures and functions to help with many different tasks in areas like data integration, graph algorithms or data conversion.

如何让本地的 Neo4j 支持 APOC 库

前提:已安装 Neo4j.

如官网介绍的,APOC 的版本要与 Neo4j 相匹配,需要确保两者版本号的前两位数是相同的。

如何让本地的 Neo4j 支持 APOC 库_第1张图片

到这个仓库(https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/)下载对应版本的 apoc-x.x.x.x-all.jar 文件,并将其放到 $NEO4J_HOME/plugins 文件夹下,其中 $NEO4J_HOME 指 Neo4j 在你电脑安装中的位置,如:D:\neo4j-community-4.2.18

之后使用 neo4j restart 重启 Neo4j 后便可使用 APOC 库了。

以下,是一个使用 APOC 中集合相似度计算函数(sorensenDiceSimilarity)的例子:

如何让本地的 Neo4j 支持 APOC 库_第2张图片

你可能感兴趣的:(环境配置,neo4j,知识图谱,人工智能)