neo4j-spark-skill

Read and write Neo4j graph data with Apache Spark and Databricks DataFrames.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-spark-skill-cardox6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-spark-skill
Source: https://github.com/cardox6/steuer-graph/tree/main/.agents/skills/neo4j-spark-skill
Command: npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-spark-skill-cardox6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Moving large datasets between Neo4j and Spark or Databricks requires correct connector configuration, version matching, and write strategies; misconfiguration causes deadlocks, duplicate nodes, or out-of-memory failures. This Skill provides the exact Maven coordinates, option tables, and code patterns to do it correctly. ## Core Features & Use Cases - DataFrame Reads: Load Neo4j data via label scans, Cypher queries, or relationship scans with partition and batch tuning for large graphs. - DataFrame Writes: Write nodes with CREATE or MERGE (SaveMode + node.keys) and relationships with source/target key mapping, including deadlock avoidance via coalesce(1). - Databricks Integration: Cluster library installation, secrets-based credential management, Unity Catalog notes, and Delta Lake to Neo4j ingestion pipelines. - Use Case: You have a Delta Lake table of customers and orders in Databricks and need to build a Neo4j graph; this Skill gives you the exact PySpark code to MERGE customer nodes, then write ORDERED relationships with proper key mapping. ## Quick Start Ask the assistant to write PySpark code that reads a Delta table and writes it to Neo4j as Customer nodes using the Neo4j Spark connector with MERGE on customer_id.

Frequently Asked Questions about neo4j-spark-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Spark DataFrame to Neo4j?▼

Use df.write.format("org.neo4j.spark.DataSource") with a SaveMode and either labels for node writes or relationship for edge writes. For MERGE behavior use mode Overwrite with the node.keys option, and create a uniqueness constraint on the key properties first.

How do I read Neo4j data into a Spark DataFrame?▼

Use spark.read.format("org.neo4j.spark.DataSource") with exactly one of three options: labels for a node scan, query for a custom Cypher read, or relationship with source and target labels. Tune large reads with the partitions and batch.size options.

Which Neo4j Spark connector version works with Databricks?▼

On Databricks Runtime 17.3 LTS with Spark 4.x use org.neo4j.connectors:spark:6.0.0-s_2.13. On DBR 14.3 to 16.4 LTS with Spark 3.x use org.neo4j:neo4j-connector-apache-spark_2.13:5.5.0_for_spark_3. Use Single User access mode, not Shared.

Why does my Neo4j relationship write deadlock in Spark?▼

Relationship writes deadlock when multiple Spark partitions lock the same nodes concurrently. Apply coalesce(1) before the write so relationships are written from a single partition, and ensure the source and target nodes already exist.

Why does Overwrite mode create duplicate nodes in Neo4j?▼

Overwrite uses MERGE on the node.keys properties, so duplicates appear when no uniqueness constraint exists on those properties. Create a constraint such as CREATE CONSTRAINT FOR (n:Label) REQUIRE n.prop IS UNIQUE before writing.

When should I not use the Neo4j Spark connector?▼

Use the Neo4j Python driver instead for lightweight application queries over bolt, the Cypher skill for query authoring, and GDS for graph algorithms. The Spark connector is intended for bulk DataFrame-scale reads and writes, not transactional app traffic.