如何启用Neo4J相似性算法

时间:2019-09-08 09:40:44

标签: neo4j

我正在从Docker映像中使用Neo4j 3.5.9,并且正在尝试使用Jaccard Similarity algorithm。但是,当我运行这样的查询时:

describe("User", () => {
  let result: any;
  before(TestContext.create);
  after(TestContext.reset);

  it("should have many posts", () => {});
  it("name should be unique", () => {});
  it("name should not be empty", () => {});
});

我遇到以下错误:

URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. 
Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

“ RETURN algo.similarity.jaccard([1,2,3],[1,2,4,5])AS相似度”

我是否需要以某种方式在docker容器中启用此(实验性)算法?欢迎提出建议。

1 个答案:

答案 0 :(得分:1)

如果要继续使用docker,可以通过以下方式安装图形算法库:

  1. Download the library并将其解包(在示例中为$HOME/servers/neo4j/plugins

  2. 使用其他参数运行docker映像:

    docker run -p7687:7687 -p7474:7474 \
        -v $HOME/servers/neo4j/plugins:/plugins \ 
        --env NEO4J_dbms_security_procedures_unrestricted=algo\.\* \ 
        neo4j:3.5.8
    

-v $HOME/servers/neo4j/plugins:/plugins-将文件夹安装在plugins目录的左侧,并相应地更改

--env NEO4J_dbms_security_procedures_unrestricted=algo\.\*-设置配置选项,如https://neo4j.com/docs/graph-algorithms/current/introduction/#_neo4j_server所述,带有NEO4J前缀和下划线的语法是Neo4j docker image的约定。