I'm trying to convert the GraphResultSet object to JSON format similar to datastax studio returns. I'm trying to use Graphson. Is there any sample codes convert the result object to JSON?
i tried the following from the tikerpop blueprints but its not working
List<GraphNode> gf=((GraphResultSet) resultSet).all();
Vertex v = (Vertex) gf.get(0).asVertex();
JSONObject json = null;
try {
json = GraphSONUtility.jsonFromElement((Element) v,getElementPropertyKeys((Element) v, false), GraphSONMode.COMPACT);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I'm getting a GraphResultSet object from dse, It has vertex and edges. I wanted to output in JSON format.