Try this query:
MATCH (a:USER)-[:owns]->(b:ALBUM)-[:CONTAINS]->(c:PHOTO) WITH a,b,{url: c.name} as c_photos WITH a,{album: b.name , photos: collect(c_photos)} as b_albums WITH {name: a.name, albums: collect(b_albums)} as a_users RETURN {users: collect(a_users)}
Edit
To get all the properties of a node, you can use the string representation of the node and then parse it separately using java, etc.
MATCH (a:User) WITH {user: str(a)} as users RETURN {users: collect(users)}
source share