title: Returning edge properties in gremlin using tree function
body: <p>Query</p>
  <pre><code>g.withSack(0).V().hasLabel('A').has('label_A','A').union(__.emit().repeat(sack(sum).by(constant(1)).in()),emit().repeat(sack(sum).by(constant(-1)).out())).project('level','properties').by(sack()).by(tree().by(valueMap().by(unfold())).unfold().unfold())
  
  </code></pre>
  <p>Output</p>
  <pre><code>[
      {
          &quot;level&quot;: 0,
          &quot;properties&quot;: {
              &quot;key&quot;: {
                  &quot;label_A&quot;: &quot;A&quot;
              },
              &quot;value&quot;: {}
          }
      },
      {
          &quot;level&quot;: 1,
          &quot;properties&quot;: {
              &quot;key&quot;: {
                  &quot;label_A&quot;: &quot;A&quot;
              },
              &quot;value&quot;: {
                  &quot;{label_B=&quot;B&quot;}&quot;: {}
              }
          }
      },
      {
          &quot;level&quot;: 2,
          &quot;properties&quot;: {
              &quot;key&quot;: {
                  &quot;label_A&quot;: &quot;A&quot;
              },
              &quot;value&quot;: {
                  &quot;{label_B=B}&quot;: {
                      &quot;{label_C=C}&quot;: {}
                  }
              }
          }
      },
  
  </code></pre>
  <p>The query only returns the properties of nodes. Please modify the query so that it returns properties of nodes as well as relations respectively in tree format.</p>