Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-01-2022 09:29 AM
Hello,
I am trying to import à json file with :
CALL apoc.load.json("file:///A novel knowledge graph development for industry design A case study on indirect coal liquefaction process.json")
YIELD value
RETURN value;
I can read from local file (apoc.conf created) but I get :
Failed to invoke procedure apoc.load.json
: Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:///A novel knowledge graph development for industry design A case study on indirect coal liquefaction process.json
my APOC version is "4.4.0.1" and my json file is UTF-8 encoded
it is perfectly red by vscode and json viewer
Am I missing something ?
Thank you for any clue you could provide.
All the best,
PEF
Solved! Go to Solution.
01-01-2022 06:40 PM
the original error was more than likely because the file name had spaces in the name and your apoc reference needs to url encode rhe spaces to %20
01-01-2022 01:00 PM
is the issue with the content of the file or the name of the file.
if you copy/rename the file to test.json and then try CALL apoc.load.json("file:///test.json" ......
are you able to read the file. If you are then this would suggest its not the content in the file rather an issue with name, and if thats the case maybe the name needs to be url encoded and thus try
CALL apoc.load.json("file:///A%20novel%20knowledge%20graph%20development%20for%20industry%20design%20A%20case%20study%20on%20indirect%20coal%20liquefaction%20process.json" .....
01-01-2022 05:27 PM
Dana,
It seems to work fine with absolute path
now I just have to build my graph from it
Best regards,
Pierre-Emmanuel
01-01-2022 05:07 PM
Hello Dana,
Thank you so much for trying to help. I just followed your recommendation by renaming my file. Now I get something else.
my directory is right
my apoc conf file looks right
but I get
I will now try with an absolute path with use_neo4j_config=false, I will keep you updated.
Thanks again,
And Happy New Year !!!
Pierre-Emmanuel
01-01-2022 06:40 PM
the original error was more than likely because the file name had spaces in the name and your apoc reference needs to url encode rhe spaces to %20
All the sessions of the conference are now available online