Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-15-2020 10:12 AM
Hello
I have a json file on this path: C:\Users\Joao\Desktop\ProjetoFinal8150133\DadosExtraidos\new.json
When i try to invoque:
call apoc.load.json("file:///C:\Users\Joao\Desktop\ProjetoFinal8150133\DadosExtraidos\new.json")
in Neo4j, it says:
"invalid input 's':expected four hexadecimal digits specifying a unicode character(line 1, column 34(offset: 33))
What is wrong?
Thank you all and stay safe
Solved! Go to Solution.
04-21-2020 07:30 AM
Done. The solution was to put the file in the import folder and then use:
call apoc.load.json("file:/new.json")
Thank you both for your suggestions!
Have a nice day and stay safe!
04-15-2020 05:50 PM
Hello
I had the same error, so I tried to change all \ in the path to / - and that worked, but I got an another error instead:
"Failed to invoke procedure apoc.load.jsonArray
: Caused by: java.lang.RuntimeException: Import from files not enabled, please set apoc.import.file.enabled=true in your apoc.conf"
In the documents (https://neo4j.com/docs/labs/apoc/current/config/) I found a bunch of parameters that can be set in apoc.conf, but I didn't have that file so I just tried to create it with that parameter set to true. After a complete restart it worked.
(Now I have another error, but I think it's related to the json structure)
I hope this helps you
/Chris
04-16-2020 04:26 AM
The invoke procedure error was my first error, i had to go to Manage on my DB, Settings, and at the end of the file i add apoc.import.file.enabled=true, and the error has gone, cause i don't even know where the apoc.conf is located.
Where's your apoc.conf file?
04-16-2020 04:27 AM
Oh ok, in the url you've sent me there's the guide, sorry friend
04-17-2020 06:03 AM
Hello Chris. I don't seem to find the location of apoc.conf. Can u help me please?
04-17-2020 07:18 AM
Hi Costa
It should be located in the same folder as neo4j.conf, i.e c:/****/conf/apoc.conf
But since every database has it's own configuration, you have to copy the file (or create) to all databases that need that functionality.
Easiest are probably to do what I did, I copied it to all the folders containing neo4j.conf that I could find.
04-18-2020 05:52 AM
I got the neo4j.conf in the neo4j desktop in "Manage -> Settings" of the database, is that the same?
04-18-2020 11:11 AM
I think that if you manage neo4j.conf from within the program, you only manage that particular database. So you need to manage each database that you need this functionality on.
I actually created a file with only one row , apoc.import.file.enabled=true , and named it apoc.conf
Then I put it manually into the configuration folders.
For me the paths look like:
C:\Users\chris.Neo4jDesktop\neo4jDatabases\database-3369b9ac-cf14-4823-8145-217097145299\installation-4.0.3\conf\apoc.conf
04-20-2020 07:30 AM
I just need to load my json file in one database friend
I'll try to create apoc.conf file in db folder, but i think that i don't find the database folder since i've already tried it once and nothing found, but let me check
04-20-2020 07:51 AM
04-20-2020 08:46 AM
Hi @costa0096,
Please keep the file in import folder. By default file need to to placed in the import forlder of respective DB else you need to change the configuration file. Please visit https://neo4j.com/docs/labs/apoc/current/import/load-json/ for reference
04-20-2020 01:39 PM
I've done that to, but that don't solve my problem friend
04-20-2020 07:25 PM
What happened when you keep the file in the import folder?
04-20-2020 11:41 AM
Hi
You don't need '///C:' in the path
Just have 'file:/users' in the beginning of the path.
If you, like me, get another error of something like "cannot read the url or file"
you have to put one more line in apoc.conf
apoc.import.file.use_neo4j_config=false
That is to allow file import from anywhere on the computer
04-20-2020 01:39 PM
Ok friend,i'll try that and then i'll say something. Thanks 🙂
04-21-2020 07:30 AM
Done. The solution was to put the file in the import folder and then use:
call apoc.load.json("file:/new.json")
Thank you both for your suggestions!
Have a nice day and stay safe!
All the sessions of the conference are now available online