Issues with Importing Multiple CSV Files to Neo4j and Using Neo4j Bloom (we couldn't find an active graph in neo4j desktop. please check that you have connected to a graph.)

I'm trying to import multiple local CSV files into Neo4j to create a graph and visualize it using Neo4j Bloom. I'm using the following Cypher code to create the graph:

//Import Data (ticket_refund)
:param file_path_root => 'file:///';
:param file_0 => 'x1.csv';
:param file_1 => 'y1.csv';
:param file_2 => 'z1.csv';
:param idsToSkip => [];

// Create constraints
CREATE CONSTRAINT `theme_name_Theme_uniq` IF NOT EXISTS
FOR (n: `Theme`)
REQUIRE (n.`theme_name`) IS UNIQUE;

CREATE CONSTRAINT `complaint_id_Complaint_uniq` IF NOT EXISTS
FOR (n: `Complaint`)
REQUIRE (n.`complaint_id`) IS UNIQUE;

// Load Theme nodes
LOAD CSV WITH HEADERS FROM ($file_path_root + $file_0) AS row
WITH row
WHERE NOT row.`complaint_theme` IN $idsToSkip AND NOT row.`complaint_theme` IS NULL
MERGE (n: `Theme` { `theme_name`: row.`complaint_theme` })
SET n.`theme_name` = row.`complaint_theme`
SET n.`theme_summary` = row.`complaint_theme_summary`;

// Load Complaint nodes
LOAD CSV WITH HEADERS FROM ($file_path_root + $file_1) AS row
WITH row
WHERE NOT row.`dms_ref` IN $idsToSkip AND NOT toInteger(trim(row.`dms_ref`)) IS NULL
MERGE (n: `Complaint` { `complaint_id`: toInteger(trim(row.`dms_ref`)) })
SET n.`complaint_id` = toInteger(trim(row.`dms_ref`))
SET n.`masked_comment` = row.`masked_comment`
SET n.`complaint_summary` = row.`complaint_summary`;

// Load relationships
LOAD CSV WITH HEADERS FROM ($file_path_root + $file_2) AS row
WITH row 
MATCH (source: `Complaint` { `complaint_id`: toInteger(trim(row.`complaint_ids`)) })
MATCH (target: `Theme` { `theme_name`: row.`complaint_theme` })
MERGE (source)-[r: `RELATED_TO`]->(target);

This script works perfectly when I run it once, and I can use Bloom without any issues. However, when I try to run the same script with different CSV files (e.g., x2.csv, y2.csv, z2.csv), I encounter a problem. After importing these new files, Bloom shows the message: "We couldn't find an active graph in Neo4j Desktop. Please check that you have connected to a graph."

Interestingly, importing the x2, y2, and z2 files individually works fine, but the problem occurs when they are imported alongside the original files.

  • Why does this issue occur when importing multiple sets of files?
  • Could it be related to memory constraints or another configuration in Neo4j?
  • How can I resolve this issue to import multiple sets of CSV files without losing connection to Bloom?

Any guidance or suggestions would be greatly appreciated!