Is it possible to return in a single cypher query distinct nodes and edges of a specific path. For instance, using the movies graph the query below return separately movies and actors, I'd like to return all nodes together. using path p = (...) and nodes(p) actually returns pairs of nodes regardless the use of distinct.
match (m:Movie {name: "Rain"}) -- (p:Person) return {nodes: collect(distinct {name: m.title}), actors: collect(distinct {name: a.name}), links: collect({source: m.title, target: a.name})}
Thanks in advance for any help, Pierre