# Get node and relationship attributes from apoc.path.expand()

**URL:** <https://community.neo4j.com/t/get-node-and-relationship-attributes-from-apoc-path-expand/13164>\
**Category:** Cypher\
**Created:** [December 27, 2019, 7:23am UTC](https://community.neo4j.com/t/get-node-and-relationship-attributes-from-apoc-path-expand/13164 "2019-12-27T07:23:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![info6](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/info6/32/4097_2.png) [@info6](https://community.neo4j.com/u/info6)\
**Post date:** [December 27, 2019, 7:23am UTC](https://community.neo4j.com/t/get-node-and-relationship-attributes-from-apoc-path-expand/13164/1 "2019-12-27T07:23:40Z")

</div>

Hi

I am trying to get the distinct nodes and relationships from the following Cypher query:

```auto
MATCH (p:Person {name :'John James Smith'}) 
CALL apoc.path.expand(p,'former_member|current_member','+team|person',0,3) 
YIELD path as pp 
RETURN pp;

```

I have had some success in getting the node details by using UNWIND:

```auto
MATCH (p:Person {name :'John James Smith'}) 
CALL apoc.path.expand(p,'former_member|current_member','+team|person',0,3) 
yield path as pp 
UNWIND nodes(pp) as n
RETURN n.name as PName, n.team_nickname as NickName

```

but I'm not able to get anything about the relationships.

Any help or insights is greatly appreciated.

Cheers

---

<div class="post-metadata">

**Author:** ![elaine\_rosenber](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/elaine_rosenber/32/27409_2.png) [@elaine\_rosenber](https://community.neo4j.com/u/elaine_rosenber)\
**Post date:** [December 27, 2019, 1:18pm UTC](https://community.neo4j.com/t/get-node-and-relationship-attributes-from-apoc-path-expand/13164/2 "2019-12-27T13:18:12Z")

</div>

Can you call UNWIND relationships(pp) to get the relationships in the paths?

Elaine
