Use of Google NLP with APOC setting up the key


The general question is how you can provide a multiline JSON structure as a :param correctly?
Google NLP APOC procedures require a key which is in itself a complex JSON structure
Trying to get Google NLP functions to work with DBMS 4.2.4 and APOC
The documentation indicates to do the following
:param apiKey => ("")
Because of the json structure key this doesn't work

Kind regards, KT


The Google apiKey is normal text, not in JSON structure.
You can create it here.

APIs & services > Credentials > +CREATE CREDENTIALS > API Key

It is used in variables like this.

  CALL apoc.nlp.gcp.entities.graph(nodes, {
    key: $apiKey,
    nodeProperty: 'body',
    writeRelationshipType: 'GCP_ENTITY',
  YIELD graph


Thanks, I now have an API key and this works.
I only worked with Google Service account keys up until now so thanks for the tip!

Kind regards, Koen

1 Like