Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Properties Cypher-从引用上的属性引用节点_Properties_Neo4j_Nodes_Cypher_Relationships - Fatal编程技术网

Properties Cypher-从引用上的属性引用节点

Properties Cypher-从引用上的属性引用节点,properties,neo4j,nodes,cypher,relationships,Properties,Neo4j,Nodes,Cypher,Relationships,给定一个关系上的属性是节点键的图,如何返回关系属性引用的节点 因此,根据图表: Node(user1 { type: "user", uid: "u1", name: "test user" }) Node(user2 { type: "user", uid: "u2", name: "test user 2}) Node(cat1 { type: "category", cid: "c1", name: "Nice person"}) Rel( (user1)-[:SAYS { cid: "

给定一个关系上的属性是节点键的图,如何返回关系属性引用的节点

因此,根据图表:

Node(user1 { type: "user", uid: "u1", name: "test user" })
Node(user2 { type: "user", uid: "u2", name: "test user 2})
Node(cat1 { type: "category", cid: "c1", name: "Nice person"})

Rel( (user1)-[:SAYS { cid: "c1" }]->(user2) )
如何返回cat1节点以及给定user1的user2节点

(例如,返回值将包括cat1以及user1和user2的定义)

逻辑起点是:

START user1 = node:auto_node_index(uid = "u1")
MATCH (user1)-[cat:SAYS]->(user2)
RETURN user1, cat, user2;
但我不知道接下来该怎么办

如果这变得太复杂,我总是可以将类别的属性放入关系中(显然),但这会促使我使用辅助存储介质来存放类别定义(因为它们将是图中的孤立节点)

谢谢!
r/Steve

嗯,实际上相当容易。把问题打出来让我对这个问题想得更清楚。这项工作:

START user1 = node:node_auto_index(uid = "u1"), c = node:node_auto_index(type = "category")
MATCH (user1)<-[cat:SAYS]-(user2)
WHERE c.cid = cred.cid
RETURN user1, cat, user2, c;
START user1=node:node\u auto\u index(uid=“u1”),c=node:node\u auto\u index(type=“category”)

匹配(user1)我想你会得到一个
未知标识符:cred
——你是说
cat
?我有点不明白你为什么要这样建模。想详细说明一下你的用例吗?是的,那是个打字错误。玩弄LinkedIn的代言实现之类的东西。所以user1支持user2。