Hi,
Let's assume this beginning of Cypher query, aiming to retrieve all
shortest paths (regarding knowledge) between two users:
MATCH (u1:User {id: "1"}), (u2:User {id: "2"}), knowledgePath =allShortestPaths
(u1-[:KNOWS*..4]-(u2))
Besides, each User is linked to a UserProfile node in the graph through the
relationship ASSOCIATED_TO.
So, what I want is to end up retrieving the UserProfile's firstName
property and UserProfile's lastName property of each knowledge, including
the boundaries (the 2 extreme users).
I tried this:
MATCH (u1:User {id: "1"}), (u2:User {id: "2"}), knowledgePath =allShortestPaths
(u1-[:KNOWS*..4]-(u2))
WITH nodes(knowledgePath) as knowledgeNodes
RETURN extract(users in knowledgeNodes | extract( p in users-[:ASSOCIATED_TO
]->() | last(nodes(p)))) as knowledge
This returns me a collection of each UserProfile Node (each whole node)
.....
My preference would be:
As my specification evoked above, returning collection of only some
UserProfile's properties for each knowledge. (firstName AND lastName)
A better preference would be:
Not returning a collection of knowledge (with good properties as expected)
at once in one record, but rather distinct records, each one containing
(firstName, LastName)
What could I do to do the trick?
Thanks a lot,
Michael
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.