Use of Google NLP with APOC setting up the key

Hello,

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 4.2.0.4
The documentation indicates to do the following
:param apiKey => ("")
Because of the json structure key this doesn't work

Kind regards, KT

@ktielens

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',
    write:true
  })
  YIELD graph

Koji,

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