Tutorial TWDS - MedCAT & Neo4j

I tried using this tutorial on my personal colab but it doesn’t give the same results shown here:

TWDS - MedCAT & Neo4j Tutorial.ipynb

The script fails at “import patients” showing this error:

ClientError: [Statement.ExternalResourceFailed] Couldn’t load the external resource at: file:/var/lib/neo4j/import/patients.csv (Transactions committed: 0)

I also add the following cell, but still don’t work:

!mkdir /var/lib/neo4j
!mkdir /var/lib/neo4j/import
!mkdir /var/lib/neo4j/conf
!sudo chmod 777 /var/lib/neo4j
!sudo chmod 777 /var/lib/neo4j/import
!sudo chmod 777 /var/lib/neo4j/conf
!echo 'dbms.directories.import=/var/lib/import' | tee /var/lib/neo4j/conf/neo4j.conf
!echo 'dbms.security.allow_csv_import_from_file_urls=true' | tee /var/lib/neo4j/conf/neo4j.conf
!sudo chmod 640 /var/lib/neo4j/conf/neo4j.conf
!set NEO4J_HOME=/var/lib/neo4j
!set NEO4J_CONF=/var/lib/neo4j/conf

I try also to implement a local project on my laptop with pycharm and neo4j desktop. The script goes a little bit futher, but the first query return un empty set and the second raise an error.
Can somebody help me?

Hi @Pablo,

can you please give a bit more information, where are you trying to run the scripts and do you have neo4j installed and running there?

Once you run the data preparation script, is the file /var/lib/neo4j/import/patients.cs created?

I run the scripts on Colab like the tutorial, but I can’t connect to ‘bolt://localhost:7867’ (I tried with default setting user=‘neo4j’ and password=‘neo4j’) so I created a free Neo4j Sandbox.

Neo4j on colab is not installed in the /var/lib, so I had to create manually the directories.
Yes, the file /var/lib/neo4j/import/patients.csv is created but the scripts can’t laod the file.

Hi @Pablo, you’ll need to run the Jupyter notebook on a Linux machine where you have neo4j installed. Otherwise, you need to manually move the files onto the machine where neo4j is installed and specify the appropriate IP address or hostname in the Jupyter notebooks.