title: cypher: how to return distinct relationship types?
body: <p>How to return the distinct relationship types from all paths in <code>cypher</code>?</p>
  
  <p>Example query:</p>
  
  <pre><code>MATCH p=(a:Philosopher)-[*]-&gt;(b:SchoolType)
  RETURN DISTINCT EXTRACT( r in RELATIONSHIPS(p)| type(r) ) as RelationshipTypes
  </code></pre>
  
  <p>This returns a collection for each path p.</p>
  
  <p>I would like to return a single collection contain the distinct relationship types across all collections.</p>
  
  <p>Here is a link to a graph gist to run the query-</p>
  
  <p><a href="http://gist.neo4j.org/?7851642" rel="nofollow">http://gist.neo4j.org/?7851642</a></p>