properties - Cypher - Referencing a Node from a property on a reference -


given graph property on relationship key node, how can return node referenced relationship property?

so, given graph:

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) ) 

how can return cat1 node along user2 node given user1?

(e.g., return values include definition of cat1 along user1 , user2).

the logical starting point is:

start user1 = node:auto_node_index(uid = "u1") match (user1)-[cat:says]->(user2) return user1, cat, user2; 

but clueless go here.

if becomes complicated put properties of categories relationship (obviously), tend drive me towards using secondary storage medium home category definitions (because orphaned nodes in graph).

thanks! r/steve

hmmm. easy actually. typing out question made me think more problem. works:

start user1 = node:node_auto_index(uid = "u1"), c = node:node_auto_index(type = "category") match (user1)<-[cat:says]-(user2) c.cid = cred.cid return user1, cat, user2, c; 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -