failed to invoke procedure in APOC NLP

Viewed 65

Im trying to run this code & every time I get the same error. I tried both google API and Azure but both return similar error.

MATCH (a:Article) CALL apoc.nlp.gcp.entities.graph(a, { key: $apiKey, nodeProperty: "body", writeRelationshipType: "ENTITY" }) YIELD graph AS g RETURN g;

Error msg: Failed to invoke procedure apoc.nlp.gcp.entities.graph: Caused by: java.lang.NoSuchMethodError:

Plus, I manually added the APOC nlp jar package to my APOC plugin folder. Any solution would be appreciated!

2 Answers

Assuming that you have pasted the JAR file in the plugins directory for your database, please make sure that in the configuration file present in the conf directory of your database, the following setting is present:

dbms.security.procedures.unrestricted=apoc.*

Once you do this, then your library should be available to use, also make sure that if the following setting is present:

dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*

then apoc.nlp.* is also part of it.

The first setting basically allows the mentioned procedures full access to the database, and the second property is used only when you need to load a subset of a large library.

Also, make sure that the Executable JAR file is directly within the plugins directory, there is no requirement of creating a separate directory for APOC. I am using neo4j 3.5, and it works for me.

Fixed the issue with downgrading the neo4j DB from 4.4 to 4.0!

Related