<p dir="auto">If a cypher query returning nodes is executed using the transactional REST endpoint essential meta-information is missing (e.g. labels). This disallows creating generic mapping frameworks for languages, An example:</p>
<p dir="auto">CDO (<a href="https://github.com/buschmais/cdo-neo4j">http://github.com/buschmais/cdo-neo4j</a>) allows the user to map annotated Java interfaces to nodes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Label
public interface Person {
// represents nodes labeled with Person
  public String getName();
  public void setName(String name);
}

@Label
public interface Customer extends Person { 
// represents nodes labeled with Customer and Person
  public int getCustomerNo();
  public void setCustomerNo(int customerNo);
}"><pre class="notranslate"><code class="notranslate">@Label
public interface Person {
// represents nodes labeled with Person
  public String getName();
  public void setName(String name);
}

@Label
public interface Customer extends Person { 
// represents nodes labeled with Customer and Person
  public int getCustomerNo();
  public void setCustomerNo(int customerNo);
}
</code></pre></div>
<p dir="auto">The user now may issue cypher queries using the CDO interface</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="List&lt;Person&gt; persons = cdoManager.createQuery(&quot;match (p:Person) return p&quot;, Person.class).execute();"><pre class="notranslate"><code class="notranslate">List&lt;Person&gt; persons = cdoManager.createQuery("match (p:Person) return p", Person.class).execute();
</code></pre></div>
<p dir="auto">CDO will execute this query but for each node returned by the query it needs to decide whether to create an instance of Person or Customer - this can only be achieved if the labels are availabe as metadata.</p>
<p dir="auto">Note: As also relationships may be of different types and can be mapped to language specific types (e.g. Java classes) they should also contain metadata (i.e. their type) if they are part of the return clause.</p>
<p dir="auto">I've currently got an ugly workaround in place to get the labels for a node returned in the transactional HTTP endpoint REST format that calls the URI for labels. It would be awesome if there were a format that had (all in one response):</p>
<ol dir="auto">
<li>node id</li>
<li>labels--one big list</li>
<li>properties</li>
<li>nothing else; no bloat!</li>
</ol>