gpt4 book ai didi

neo4j - Neo4j 中的多行执行

转载 作者:行者123 更新时间:2023-12-05 06:37:37 29 4
gpt4 key购买 nike

我正在尝试执行以下密码:

// Nodes created for Lessons, Submitter, Center and Topic
// Relations created
// Uniqueness constraints.
CREATE CONSTRAINT ON (l:Lesson) ASSERT l.name IS UNIQUE;
// Load.
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM
'file:///llis.csv' AS line
WITH line, SPLIT(line.LessonDate, '-') AS date
CREATE (lesson:Lesson { name: TOINT(line.`LessonId`) } )
SET lesson.year = TOINT(date[0]),
lesson.month = TOINT(date[1]),
lesson.day = TOINT(date[2]),
lesson.title = (line.Title),
lesson.abstract = (line.Abstract),
lesson.lesson = (line.Lesson),
lesson.org = (line.MissionDirectorate),
lesson.safety = (line.SafetyIssue),
lesson.url = (line.url)

但是,我无法在浏览器中执行此操作,因为它是分开的两行。查看错误:

节点 (562) 已经存在,标签 Lesson 和属性 name = 0

我知道我打算在 Neo4j-shell 中执行此操作。我已设法进入 Neo4j-shell,但我如何在那里运行这段代码?

最佳答案

将你的语法放在一个文件中,然后按如下方式运行它:

在 Windows 上

type yourfile.cypher | bin\cypher-shell.bat -u <user> -p <password>

在 Linux 上

cat yourfile.cypher | bin/cypher-shell -u <user> -p <password>

希望对您有所帮助,汤姆

关于neo4j - Neo4j 中的多行执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47349377/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com