14.8.2 Getting Label Values
You can retrieve the vertex or edge label values of a graph as shown:
PgxGraph g = session.getGraph("bank_graph_analytics");
String query =
      "SELECT LABEL(v), COUNT(*) "
    + "FROM MATCH (v) "
    + "GROUP BY LABEL(v) "
    + "ORDER BY COUNT(v) DESC";
PgqlResultSet resultSet = g.queryPgql(query);
resultSet.print();The result may appear as shown:
+-----------------------+
| LABEL(n)   | COUNT(*) |
+-----------------------+
|  ACCOUNT   | 1000     |
+-----------------------+Parent topic: Labels and Properties