diff --git "a/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/config.json" "b/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/config.json" new file mode 100644 index 0000000000000000000000000000000000000000..8c09f76e1585596feb0aca0e053741fd0603fa4f --- /dev/null +++ "b/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/config.json" @@ -0,0 +1,5 @@ +{ + "node_id": "", + "keywords": ["Neo4j 查询语言", "Cypher", "图遍历", "查询语言"], + "export": ["more-cypher.json"] +} \ No newline at end of file diff --git "a/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/more-cypher.json" "b/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/more-cypher.json" new file mode 100644 index 0000000000000000000000000000000000000000..c94a5b36780b78b78628437ebab9d1792eaa5926 --- /dev/null +++ "b/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/more-cypher.json" @@ -0,0 +1,6 @@ +{ + "type": "code_options", + "author": "shiny", + "source": "more-cypher.md", + "notebook_enable": false +} \ No newline at end of file diff --git "a/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/more-cypher.md" "b/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/more-cypher.md" new file mode 100644 index 0000000000000000000000000000000000000000..604ad282ba12789c47c9226fb2e2c89532c19079 --- /dev/null +++ "b/data/2.Neo4j \344\270\255\351\230\266/1.Cypher\346\237\245\350\257\242\350\257\255\350\250\200/more-cypher.md" @@ -0,0 +1,47 @@ +# 深入 Cypher 查询语言 + +我们已经知道,Neo4j 的属性图模型是由节点和关系组成的,它们也可能有与之关联的属性。然而,节点和关系是构建属性图模型中最有价值和最强大的部分 - 模式的简单组件。模式由节点和关系元素组成,可以表达简单或复杂的遍历和路径。 + +模式识别是大脑工作方式的基础。正因为如此,人类非常擅长使用模式(想想可视化图表甚至记忆匹配游戏)。Cypher 也很大程度上基于模式,旨在识别数据中这些模式的各种版本,使其成为用户学习的一种简单且合乎逻辑的语言。 + +在您阅读本指南时,您将看到 Cypher 代码中的注释,以帮助解释语法或查询正在做什么。Cypher 中的注释与许多编程语言中的相同。您可以通过`//`以斜线开头并在斜杠后放置文本来添加注释。就像在其他语言中一样,以两个正斜杠开头的行将意味着该行上的任何内容都将成为注释。 + +由于 Cypher 使用 ASCII-Art 来表示模式,我们需要一种视觉方式来表示上述模式的每个组件。我们知道属性图模型的主要组成部分是节点和关系。请记住,节点是图中的数据实体,您通常可以通过查找数据模型中的名词或对象来识别节点。在我们的示例中`Jennifer`,`Michael`、`Graphs`、 和`Neo4j`是我们的节点。 + +为了充分利用图数据库的强大功能,我们还需要表达节点之间的关系。关系在 Cypher 中使用箭头`-->`或`<--`两个节点之间表示。请注意语法在视觉表示中如何看起来像连接我们的节点的箭头和线。附加信息,例如节点如何连接(关系类型)以及与关系有关的任何属性,可以放在箭头内的方括号中。 + +我们已经讨论了如何为节点、关系和标签编写 Cypher。我们的属性图数据模型的最后一部分是用于属性的。请记住,属性是名称-值对,可为我们的节点和关系提供更多详细信息。 + +节点和关系构成了图形模式的构建块。这些构建块可以组合在一起来表达简单或复杂的模式。模式是图形最强大的功能。在 Cypher 中,它们可以写成一条连续的路径,也可以分成更小的模式并用逗号连接在一起。 + +```cypher +(p:Person {name: "Jennifer"})-[rel:LIKES]->(g:Technology {type: "Graphs"}) +``` + +更多信息请访问: + +问题: + +当遇到Cypher问题时,可以在Neo4j Browser里使用哪个命令获取帮助信息? + +## 答案 + +`:help cypher` + +## 选项 + +### A + +`:play cypher` + +### B + +`:help cypher` + +### C + +`cypher --help` + +### D + +`help cypher` \ No newline at end of file diff --git "a/data/2.Neo4j \344\270\255\351\230\266/1.\346\237\245\350\257\242\350\257\255\350\250\200 Cypher/config.json" "b/data/2.Neo4j \344\270\255\351\230\266/1.\346\237\245\350\257\242\350\257\255\350\250\200 Cypher/config.json" deleted file mode 100644 index 25bb6452ed2756627e162690bc31f79b072b4b27..0000000000000000000000000000000000000000 --- "a/data/2.Neo4j \344\270\255\351\230\266/1.\346\237\245\350\257\242\350\257\255\350\250\200 Cypher/config.json" +++ /dev/null @@ -1,4 +0,0 @@ -{ - "node_id": "", - "keywords": [] -} \ No newline at end of file