neo4j-getting-started-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNeo4j Getting-Started Skill
Neo4j 入门技能
Guide a user or agent from zero to a working Neo4j application by executing the 8 stages below in order.
At the start of each stage: read the corresponding file and follow its instructions. Only load the stage you are currently executing — not all at once.
${CLAUDE_SKILL_DIR}/references/<stage-name>.md"User" means both a human developer and an autonomous coding agent.
引导用户或Agent按以下8个阶段逐步完成从0到搭建可运行Neo4j应用的全流程。
每个阶段开始时:读取对应的文件并遵循其中的指令。仅加载当前正在执行的阶段——不要一次性加载所有阶段。
${CLAUDE_SKILL_DIR}/references/<stage-name>.md"用户"既指人类开发者,也指自主编码Agent。
Project Structure
项目结构
All generated code, data, scripts, queries, and notebooks must be written to the working directory so the user can inspect, reuse, and re-run them after the session ends. Never generate output only as text in the conversation — always write it to a file.
Organize files into this layout. Create subdirectories before writing files.
.env ← DB credentials (gitignored, loaded by python-dotenv)
aura.env ← Aura API credentials (gitignored, never overwrite)
progress.md ← stage-by-stage progress (this skill writes it)
requirements.txt ← Python dependencies
schema/
schema.json ← graph model definition
schema.cypher ← DDL: constraints + indexes
reset.cypher ← wipe all data (keep schema)
data/
generate.py ← synthetic data generator (DATA_SOURCE=synthetic)
import.py ← CSV/file importer (DATA_SOURCE=csv or relational)
*.csv ← any provided or generated data files
queries/
queries.cypher ← validated Cypher query library
scripts/
provision_aura.py ← Aura provisioning script (generated during provision stage)
notebook.ipynb ← app artifact (root — standard jupyter convention)
app.py ← app artifact (root — streamlit run app.py)
main.py ← app artifact (root — uvicorn main:app)
graphrag_app.py ← app artifact (root)Root-level files (, , app code) stay at root because tooling expects them there. Everything else goes in the appropriate subfolder.
.envrequirements.txt所有生成的代码、数据、脚本、查询和笔记本文件必须写入工作目录,以便用户在会话结束后可以检查、复用和重新运行。切勿仅在对话中以文本形式生成输出——务必写入文件。
按照以下布局组织文件。写入文件前先创建子目录。
.env ← 数据库凭证(已加入git忽略,由python-dotenv加载)
aura.env ← Aura API凭证(已加入git忽略,切勿覆盖)
progress.md ← 阶段式进度记录(本技能负责写入)
requirements.txt ← Python依赖项
schema/
schema.json ← 图模型定义
schema.cypher ← DDL:约束 + 索引
reset.cypher ← 清空所有数据(保留模型)
data/
generate.py ← 合成数据生成器 (DATA_SOURCE=synthetic)
import.py ← CSV/文件导入器 (DATA_SOURCE=csv或relational)
*.csv ← 任何提供或生成的数据文件
queries/
queries.cypher ← 已验证的Cypher查询库
scripts/
provision_aura.py ← Aura资源部署脚本(在部署阶段生成)
notebook.ipynb ← 应用产物(根目录——遵循Jupyter标准约定)
app.py ← 应用产物(根目录——streamlit run app.py)
main.py ← 应用产物(根目录——uvicorn main:app)
graphrag_app.py ← 应用产物(根目录)根目录文件(、、应用代码)保留在根目录,因为工具链默认在此处查找。其余所有文件放入对应的子文件夹。
.envrequirements.txtProgress Tracking
进度跟踪
The skill maintains in the working directory to support resumability.
progress.mdOn startup:
- Check if exists.
progress.md - If it exists, find the first pending stage:
bash
grep -B1 "^status: pending" progress.md | grep "^###" | head -1 - Resume from that stage. Read its context block (the key=value lines beneath the header) to restore ,
DOMAIN,USE_CASE, etc. — do not re-ask the user for information already recorded.NEO4J_URI - For each completed stage, read every file listed in its line before proceeding. These files are the ground truth — do not reconstruct their content from memory.
files=- → re-read before model, load, query, or build stages
schema/schema.json - → re-read before build stage
queries/queries.cypher - → re-read before import or reset
data/generate.py
- If does not exist, start from
progress.md.0-prerequisites
On stage completion — update (or create) :
progress.md- If the stage's section already exists, update
###→status: pendingand append any new key=value lines.status: done - If the section doesn't exist, append it following the format below.
Format:
markdown
undefined本技能在工作目录中维护文件,以支持任务续接。
progress.md启动时:
- 检查是否存在。
progress.md - 如果存在,找到第一个待处理阶段:
bash
grep -B1 "^status: pending" progress.md | grep "^###" | head -1 - 从该阶段恢复。读取其上下文块(标题下方的key=value行)以恢复、
DOMAIN、USE_CASE等信息——不要重新询问用户已记录的信息。NEO4J_URI - 在继续之前,读取每个已完成阶段行中列出的所有文件。这些文件是真实依据——不要凭记忆重构其内容。
files=- → 在模型、加载、查询或构建阶段前重新读取
schema/schema.json - → 在构建阶段前重新读取
queries/queries.cypher - → 在导入或重置前重新读取
data/generate.py
- 如果不存在,从
progress.md阶段开始。0-prerequisites
阶段完成时 —— 更新(或创建):
progress.md- 如果该阶段的部分已存在,将
###更新为status: pending并追加任何新的key=value行。status: done - 如果该部分不存在,按照以下格式追加。
格式:
markdown
undefinedNeo4j Getting-Started — Progress
Neo4j Getting-Started — Progress
<!-- Resume: grep for "status: pending" to find the next stage -->
<!-- Resume: grep for "status: pending" to find the next stage -->
0-prerequisites
0-prerequisites
status: done
status: done
1-context
1-context
status: done
DOMAIN=social
USE_CASE=friend recommendations
EXPERIENCE=beginner
DB_TARGET=aura-free
DATA_SOURCE=synthetic
APP_TYPE=notebook
EXEC_METHOD=query-api
status: done
DOMAIN=social
USE_CASE=friend recommendations
EXPERIENCE=beginner
DB_TARGET=aura-free
DATA_SOURCE=synthetic
APP_TYPE=notebook
EXEC_METHOD=query-api
2-provision
2-provision
status: done
NEO4J_URI=neo4j+s://abc123.databases.neo4j.io
status: done
NEO4J_URI=neo4j+s://abc123.databases.neo4j.io
3-model
3-model
status: done
labels=Person,Post
relationships=FOLLOWS,POSTED
constraints=2
status: done
labels=Person,Post
relationships=FOLLOWS,POSTED
constraints=2
4-load
4-load
status: done
nodes=200 Person, 50 Post
relationships=1400 FOLLOWS, 300 POSTED
status: done
nodes=200 Person, 50 Post
relationships=1400 FOLLOWS, 300 POSTED
5-explore
5-explore
status: pending
status: pending
6-query
6-query
status: pending
status: pending
7-build
7-build
status: pending
---status: pending
---Execution Protocol
执行协议
For each stage:
- Announce the stage:
"## Stage: <name> — <purpose>" - Read
${CLAUDE_SKILL_DIR}/references/<name>.md - Execute the instructions in that file
- Verify the stage's completion condition
- Update with
progress.mdand stage-specific contextstatus: done - Proceed to the next stage (HITL: pause for approval first)
If a stage fails, recover using the error guidance in the stage reference file. Do not skip stages unless the skip condition below explicitly permits it.
每个阶段执行步骤:
- 宣布当前阶段:
"## Stage: <name> — <purpose>" - 读取
${CLAUDE_SKILL_DIR}/references/<name>.md - 执行该文件中的指令
- 验证阶段完成条件
- 更新,设置
progress.md并添加阶段特定上下文status: done - 进入下一阶段(HITL模式:先暂停等待用户批准)
如果某个阶段失败,使用该阶段参考文件中的错误指导进行恢复。除非以下跳过条件明确允许,否则请勿跳过阶段。
Stages
阶段说明
Stages run in the numbered order shown. Each depends on the one before it completing successfully (except where a skip condition applies). Read the linked reference file when entering each stage.
0-prerequisites → 1-context → 2-provision → 3-model → 4-load → 5-explore → 6-query → 7-buildShared capabilities used across multiple stages:
- Cypher execution: (3 options;
${CLAUDE_SKILL_DIR}/references/capabilities/execute-cypher.mdchosen inEXEC_METHOD)context - Cypher authoring rules: (or defer to
${CLAUDE_SKILL_DIR}/references/capabilities/cypher-authoring.md)neo4j-cypher-authoring-skill - MCP configuration: (used in
${CLAUDE_SKILL_DIR}/references/capabilities/mcp-config.mdandprerequisites)build - Query validation: — batch-validate all queries in one call (used in
${CLAUDE_SKILL_DIR}/scripts/validate_queries.py)query
阶段按所示编号顺序运行。每个阶段依赖前一个阶段成功完成(除非适用跳过条件)。进入每个阶段时请阅读对应的参考文件。
0-prerequisites → 1-context → 2-provision → 3-model → 4-load → 5-explore → 6-query → 7-build多个阶段共用的能力:
- Cypher执行:(3种选项;
${CLAUDE_SKILL_DIR}/references/capabilities/execute-cypher.md在EXEC_METHOD阶段选择)context - Cypher编写规则:(或委托给
${CLAUDE_SKILL_DIR}/references/capabilities/cypher-authoring.md)neo4j-cypher-authoring-skill - MCP配置:(用于
${CLAUDE_SKILL_DIR}/references/capabilities/mcp-config.md和prerequisites阶段)build - 查询验证:—— 批量验证所有查询(用于
${CLAUDE_SKILL_DIR}/scripts/validate_queries.py阶段)query
0 — prerequisites
prerequisites0 — prerequisites
prerequisitesPurpose: Verify and install required CLI tools before doing anything else.
Reference:
Completes when: binary is reachable; has entry.
Never skip.
Reference:
${CLAUDE_SKILL_DIR}/references/0-prerequisites.mdCompletes when:
neo4j-mcp.gitignore.envNever skip.
目标:在开始其他操作前,验证并安装所需的CLI工具。
参考文件:
完成条件:二进制文件可访问;包含条目。
切勿跳过。
参考文件:
${CLAUDE_SKILL_DIR}/references/0-prerequisites.md完成条件:
neo4j-mcp.gitignore.env切勿跳过。
1 — context
context1 — context
contextPurpose: Collect domain, use-case, experience, infrastructure target, data source, and output type. Detect for Cypher execution.
Reference:
Completes when:, , , , , , are known.
Skip condition: all variables already provided in conversation context.
EXEC_METHODReference:
${CLAUDE_SKILL_DIR}/references/1-context.mdCompletes when:
DOMAINUSE_CASEEXPERIENCEDB_TARGETDATA_SOURCEAPP_TYPEEXEC_METHODSkip condition: all variables already provided in conversation context.
目标:收集领域、用例、经验水平、基础设施目标、数据源和输出类型。检测Cypher执行的。
参考文件:
完成条件:、、、、、、均已确定。
跳过条件:所有变量已在对话上下文中提供。
EXEC_METHOD参考文件:
${CLAUDE_SKILL_DIR}/references/1-context.md完成条件:
DOMAINUSE_CASEEXPERIENCEDB_TARGETDATA_SOURCEAPP_TYPEEXEC_METHOD跳过条件:所有变量已在对话上下文中提供。
2 — provision
provision2 — provision
provisionPurpose: Provision a running Neo4j database and save credentials to .
Reference:
Completes when: exists with ; connectivity verified.
Skip condition: → write from user credentials, proceed to .
.envReference:
${CLAUDE_SKILL_DIR}/references/2-provision.mdCompletes when:
.envNEO4J_URI/USERNAME/PASSWORD/DATABASESkip condition:
DB_TARGET=existing.env3-model目标:部署运行中的Neo4j数据库并将凭证保存到。
参考文件:
完成条件:文件存在,包含;已验证连接性。
跳过条件: → 从用户凭证写入,直接进入阶段。
.env参考文件:
${CLAUDE_SKILL_DIR}/references/2-provision.md完成条件:
.envNEO4J_URI/USERNAME/PASSWORD/DATABASE跳过条件:
DB_TARGET=existing.env3-model3 — model
model3 — model
modelPurpose: Design or discover a graph data model suited to the use-case.
Reference:
Completes when: and written.
Skip condition: → use demo schema, proceed to .
HITL checkpoint (HITL mode only — skip entirely in autonomous mode): show model draft, wait for approval.
Reference:
${CLAUDE_SKILL_DIR}/references/3-model.mdCompletes when:
schema.jsonschema.cypherSkip condition:
DATA_SOURCE=demo4-loadHITL checkpoint (HITL mode only — skip entirely in autonomous mode): show model draft, wait for approval.
目标:设计或发现适合该用例的图数据模型。
参考文件:
完成条件:已写入和。
跳过条件: → 使用演示模型,直接进入阶段。
HITL检查点(仅HITL模式——自主模式下完全跳过):展示模型草稿,等待用户批准。
参考文件:
${CLAUDE_SKILL_DIR}/references/3-model.md完成条件:已写入
schema.jsonschema.cypher跳过条件:
DATA_SOURCE=demo4-loadHITL检查点(仅HITL模式——自主模式下完全跳过):展示模型草稿,等待用户批准。
4 — load
load4 — load
loadPurpose: Apply schema constraints, then import data (demo, synthetic, CSV, or documents).
Reference:
Depends on: (constraints must exist before import).
Completes when: node count ≥ 50; scripts written; written.
Reference:
${CLAUDE_SKILL_DIR}/references/4-load.mdDepends on:
3-modelCompletes when: node count ≥ 50;
import/reset.cypher目标:应用模型约束,然后导入数据(演示数据、合成数据、CSV或文档)。
参考文件:
依赖:(导入前必须存在约束)。
完成条件:节点数≥50;已写入脚本;已写入。
参考文件:
${CLAUDE_SKILL_DIR}/references/4-load.md依赖:
3-model完成条件:节点数≥50;已写入
import/reset.cypher5 — explore
explore5 — explore
explorePurpose: Deliver a visual entry point to the graph — the "it clicks" moment.
Reference:
Completes when: browser URL printed to user, or notebook visualization cell added.
Hard gate — never skip.
Reference:
${CLAUDE_SKILL_DIR}/references/5-explore.mdCompletes when: browser URL printed to user, or notebook visualization cell added.
Hard gate — never skip.
目标:提供图的可视化入口点——即“豁然开朗”的时刻。
参考文件:
完成条件:已向用户打印浏览器URL,或已添加笔记本可视化单元格。
硬性要求——切勿跳过。
参考文件:
${CLAUDE_SKILL_DIR}/references/5-explore.md完成条件:已向用户打印浏览器URL,或已添加笔记本可视化单元格。
硬性要求——切勿跳过。
6 — query
query6 — query
queryPurpose: Generate and validate a Cypher query library for the use-case.
Reference:
Completes when: has ≥5 queries; ≥2 traversals; ≥3 return results.
Reference:
${CLAUDE_SKILL_DIR}/references/6-query.mdCompletes when:
queries.cypher目标:为该用例生成并验证Cypher查询库。
参考文件:
完成条件:包含≥5个查询;≥2个遍历查询;≥3个查询返回结果。
参考文件:
${CLAUDE_SKILL_DIR}/references/6-query.md完成条件:
queries.cypher7 — build
build7 — build
buildPurpose: Generate a runnable application, dashboard, notebook, or agent integration.
Reference:
Completes when: artifact exists, passes syntax check, returns non-empty use-case results.
Reference:
${CLAUDE_SKILL_DIR}/references/7-build.mdCompletes when: artifact exists, passes syntax check, returns non-empty use-case results.
目标:生成可运行的应用、仪表板、笔记本或Agent集成。
参考文件:
完成条件:产物存在,通过语法检查,返回非空的用例结果。
参考文件:
${CLAUDE_SKILL_DIR}/references/7-build.md完成条件:产物存在,通过语法检查,返回非空的用例结果。
Success Gates (all 7 required)
成功校验(需全部满足)
| Gate | Stage | Condition |
|---|---|---|
| provision | |
| model | ≥2 node labels, ≥1 rel type, ≥1 constraint in DB |
| load | |
| query | ≥5 queries; ≥2 traversals; ≥3 return ≥1 result |
| explore | Browser URL or notebook viz delivered to user |
| build | Artifact exists, passes syntax, returns non-empty results |
| build | MCP config or agent framework code present (if requested) |
| 校验项 | 对应阶段 | 条件 |
|---|---|---|
| provision | |
| model | 数据库中存在≥2个节点标签、≥1种关系类型、≥1个约束 |
| load | |
| query | ≥5个查询;≥2个遍历查询;≥3个查询返回≥1条结果 |
| explore | 已向用户提供浏览器URL或笔记本可视化内容 |
| build | 产物存在,通过语法检查,返回非空结果 |
| build | 存在MCP配置或Agent框架代码(如果已请求) |
Fast Paths
快速路径
| Situation | Action |
|---|---|
| Skip |
| Skip custom modeling; use demo schema; jump to |
| Skip |
| 场景 | 操作 |
|---|---|
| 跳过 |
| 跳过自定义建模;使用演示模型;直接进入 |
| 跳过 |
HITL vs Autonomous Mode
HITL vs 自主模式
HITL (conversational): pause after for model review; pause after for data review.
modelloadAutonomous (CI-like, all context provided upfront): never pause for approval at any stage; auto-approve all decisions; proceed immediately through all 8 stages; print browser URL to stdout; target ≤15 min from DB running.
How to detect autonomous mode — check at the start of stage 1:
Autonomous if ANY of the following are true:
- The initial prompt contains all of: ,
DOMAIN,USE_CASE,EXPERIENCE,DB_TARGET,DATA_SOURCE(or equivalent phrasing like "Domain: X, use-case: Y, ...")APP_TYPE - The session was started with or similar non-interactive flag
--auto-approve - All context variables are already recorded in (resuming an autonomous run)
progress.md
HITL if: the user opened a fresh conversation without providing full context upfront.
In autonomous mode: every HITL checkpoint in every stage reference file is automatically skipped. Do not ask for approval. Do not say "does this look right?" Do not pause. Continue to the next step immediately.
HITL(对话式):在阶段后暂停等待模型审核;在阶段后暂停等待数据审核。
modelload自主模式(类CI,所有上下文提前提供):任何阶段都不暂停等待批准;自动批准所有决策;立即执行完所有8个阶段;向标准输出打印浏览器URL;目标是数据库运行后≤15分钟完成。
如何检测自主模式——在阶段1开始时检查:
满足以下任一条件即为自主模式:
- 初始提示包含所有以下内容:、
DOMAIN、USE_CASE、EXPERIENCE、DB_TARGET、DATA_SOURCE(或等效表述,如“Domain: X, use-case: Y, ...”)APP_TYPE - 会话通过或类似非交互标志启动
--auto-approve - 所有上下文变量已记录在中(恢复自主运行任务)
progress.md
HITL模式:用户发起新对话但未提前提供完整上下文。
自主模式下:所有阶段参考文件中的HITL检查点均自动跳过。 请勿请求批准。请勿询问“这样看起来对吗?”。请勿暂停。立即进入下一步。
Final Summary (deliver after all gates pass)
最终总结(所有校验项通过后提供)
Step 1 — write to the working directory using the template below.
Fill in every from and the actual generated files.
This is a required output — do not skip it.
README.md<placeholder>progress.mdIMPORTANT — portable commands: All re-run commands in README.md MUST use (never an absolute path like or ). The README is shared with others who have different Python installs.
python3/opt/homebrew/bin/python3.14/usr/local/bin/python3markdown
undefined步骤1 —— 将写入工作目录,使用以下模板。从和实际生成的文件中填充所有。这是必填输出——请勿跳过。
README.mdprogress.md<placeholder>重要——可移植命令:README.md中的所有重新运行命令必须使用(绝对路径如或绝不允许)。README会分享给其他拥有不同Python安装环境的用户。
python3/opt/homebrew/bin/python3.14/usr/local/bin/python3markdown
undefined<DOMAIN> Graph — <USE_CASE>
<DOMAIN> Graph — <USE_CASE>
A synthetic <DOMAIN> graph built with Neo4j, covering <USE_CASE>.
Generated by the neo4j-getting-started-skill on <date>.
使用Neo4j构建的合成<DOMAIN>图,覆盖<USE_CASE>场景。
由neo4j-getting-started-skill于<date>生成。
What's in the graph
图中包含内容
| Label | Count | Description |
|---|---|---|
| <Label> | <N> | <one line> |
Relationships: <TYPE1>, <TYPE2>, ...
Constraints: <N> uniqueness constraints applied
Constraints: <N> uniqueness constraints applied
| 标签 | 数量 | 描述 |
|---|---|---|
| <Label> | <N> | <单行描述> |
关系类型: <TYPE1>, <TYPE2>, ...
约束: 已应用<N>个唯一性约束
约束: 已应用<N>个唯一性约束
Explore visually
可视化探索
Open in Neo4j Browser:
<browser_url>
Use from to connect, then run:
NEO4J_PASSWORD.envcypher
// Starter query — shows the full graph sample
MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 50在Neo4j Browser中打开:
<browser_url>
使用中的连接,然后运行:
.envNEO4J_PASSWORDcypher
// 入门查询——显示完整图样本
MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 50Files
文件说明
| File | Purpose | Re-run |
|---|---|---|
| Graph model | — |
| Constraints + indexes | |
| Wipe data, keep schema | |
| Regenerate synthetic data | |
| Re-import CSVs into Neo4j | |
| Query library | Paste into Neo4j Browser |
| <app type> | |
| Python dependencies | |
(Omit row when ; omit row when .)
data/generate.pyDATA_SOURCE=csvdata/import.pyDATA_SOURCE=synthetic| 文件 | 用途 | 重新运行命令 |
|---|---|---|
| 图模型定义 | — |
| 约束 + 索引 | |
| 清空数据,保留模型 | |
| 重新生成合成数据 | |
| 将CSV重新导入Neo4j | |
| 查询库 | 粘贴到Neo4j Browser中运行 |
| <应用类型> | |
| Python依赖项 | |
(当时省略行;当时省略行。)
DATA_SOURCE=csvdata/generate.pyDATA_SOURCE=syntheticdata/import.pyRun the app
运行应用
bash
python3 -m venv .venv # skip if .venv already exists
source .venv/bin/activate
pip install -r requirements.txt
<run command><For FastAPI only — include this section:>
Open http://localhost:8000/docs for the interactive API docs.
<For MCP integration — include this section when APP_TYPE includes mcp:>
bash
python3 -m venv .venv # 如果.venv已存在则跳过
source .venv/bin/activate
pip install -r requirements.txt
<run command><仅FastAPI需包含此部分:>
打开http://localhost:8000/docs查看交互式API文档。
<当APP_TYPE包含mcp时需包含此部分:>
MCP integration
MCP集成
To query your graph directly from Claude:
Claude Code — copy into :
mcp-claude-code.json.claude/settings.jsonbash
cp mcp-claude-code.json .claude/settings.jsonThen reload Claude Code ( or restart). Ask: "What node labels are in my Neo4j database?"
/reloadClaude Desktop — merge into
, then restart Claude Desktop.
mcp-claude-desktop.json~/Library/Application Support/Claude/claude_desktop_config.jsonAvailable MCP tools: , , .
get-schemaread-cypherwrite-cypher要直接从Claude查询你的图:
Claude Code —— 将复制到:
mcp-claude-code.json.claude/settings.jsonbash
cp mcp-claude-code.json .claude/settings.json然后重新加载Claude Code(或重启)。提问:"我的Neo4j数据库中有哪些节点标签?"
/reloadClaude Desktop —— 将合并到,然后重启Claude Desktop。
mcp-claude-desktop.json~/Library/Application Support/Claude/claude_desktop_config.json可用MCP工具:, , 。
get-schemaread-cypherwrite-cypherReset and reload
重置与重新加载
bash
source .env
cypher-shell -a $NEO4J_URI -u $NEO4J_USERNAME -p $NEO4J_PASSWORD --file schema/reset.cypher
source .venv/bin/activate
python3 data/generate.py # or skip if using your own CSVs
python3 data/import.pybash
source .env
cypher-shell -a $NEO4J_URI -u $NEO4J_USERNAME -p $NEO4J_PASSWORD --file schema/reset.cypher
source .venv/bin/activate
python3 data/generate.py # 如果使用自定义CSV则跳过
python3 data/import.pySample queries
示例查询
cypher
// <use-case-specific query 1 — fill in from queries/queries.cypher>
<query>
// <use-case-specific query 2>
<query>(Cypher comments use , not .)
//--cypher
// <用例特定查询1 —— 从queries/queries.cypher中填充>
<query>
// <用例特定查询2>
<query>(Cypher注释使用,而非。)
//--Next steps
下一步
- Explore GraphAcademy to deepen your Neo4j knowledge
- Edit to change the dataset, then re-run
data/*.csvdata/import.py - Extend the model: add new node labels or relationship types in
schema/schema.json
**Step 2 — print this to the conversation:**
✓ Neo4j Getting-Started — Complete
Database: <NEO4J_URI>
Browser: https://browser.neo4j.io/?connectURL=<encoded>
── What was generated (keep these files) ───────────────────────
schema/schema.json Graph model definition
schema/schema.cypher Re-apply constraints/indexes: cypher-shell ... --file schema/schema.cypher
schema/reset.cypher Wipe data, keep schema: cypher-shell ... --file schema/reset.cypher
data/generate.py Regenerate synthetic data: source .venv/bin/activate && python3 data/generate.py
data/*.csv Source data files — edit to change the dataset
data/import.py Re-import from CSVs: source .venv/bin/activate && python3 data/import.py
queries/queries.cypher Query library — paste into Neo4j Browser or run with cypher-shell
<app-file> <run-command>
requirements.txt Install deps: source .venv/bin/activate && pip install -r requirements.txt
── Gates ───────────────────────────────────────────────────────
db_running ✓ model_valid ✓ data_present ✓ queries_work ✓
graph_visible ✓ app_generated ✓ integration_ready ✓/–
── Next steps ──────────────────────────────────────────────────
- Explore: open the Browser URL → run MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 50
- Iterate: edit data/*.csv → source .venv/bin/activate && python3 data/import.py (reset first)
- Learn: https://graphacademy.neo4j.com
Omit lines that don't apply (e.g. omit `data/import.py` when `DATA_SOURCE=synthetic`,
omit `data/generate.py` when `DATA_SOURCE=csv`).- 探索GraphAcademy以深化Neo4j知识
- 编辑以更改数据集,然后重新运行
data/*.csvdata/import.py - 扩展模型:在中添加新的节点标签或关系类型
schema/schema.json
**步骤2 —— 将以下内容打印到对话中:**
✓ Neo4j 入门流程 —— 完成
数据库: <NEO4J_URI>
浏览器: https://browser.neo4j.io/?connectURL=<encoded>
── 已生成的文件(请保留这些文件) ───────────────────────
schema/schema.json 图模型定义
schema/schema.cypher 重新应用约束/索引: cypher-shell ... --file schema/schema.cypher
schema/reset.cypher 清空数据,保留模型: cypher-shell ... --file schema/reset.cypher
data/generate.py 重新生成合成数据: source .venv/bin/activate && python3 data/generate.py
data/*.csv 源数据文件——编辑可更改数据集
data/import.py 从CSV重新导入: source .venv/bin/activate && python3 data/import.py
queries/queries.cypher 查询库——粘贴到Neo4j Browser或用cypher-shell运行
<app-file> <运行命令>
requirements.txt 安装依赖: source .venv/bin/activate && pip install -r requirements.txt
── 校验项 ───────────────────────────────────────────────────────
db_running ✓ model_valid ✓ data_present ✓ queries_work ✓
graph_visible ✓ app_generated ✓ integration_ready ✓/–
── 下一步 ──────────────────────────────────────────────────
- 探索: 打开浏览器URL → 运行MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 50
- 迭代: 编辑data/*.csv → source .venv/bin/activate && python3 data/import.py(先重置)
- 学习: https://graphacademy.neo4j.com
省略不适用的行(例如,当`DATA_SOURCE=synthetic`时省略`data/import.py`行,当`DATA_SOURCE=csv`时省略`data/generate.py`行)。