String relationship = "MATCH (o)-[r:orgEntity_Portfolio]->(p) RETURN o.orgEntityId,p.portfolioId";
String node = "MATCH (n:portfolios) Return n.portfolioId as portfolioId,n.shortName as shortName";
ExecutionResult rs = (ExecutionResult )graphDb.execute(node);
Object object = rs.iterator();
String foo = JsonHelper.createJsonFrom(object);
-----------------------------------
When passing node or relationship parameter in execute, I am getting JSON data as below:
JSON for Node:
{ "innerJavaIterator$1" : [ { "portfolioId" : 1, "shortName" : "Single Customer View" }, { "portfolioId" : 2, "shortName" : "BAU" }] }
JSON for Relationship
{ "innerJavaIterator$1" : [ { "p.portfolioId" : 1, "o.orgEntityId" : 2 } ] }
But problem is I am using d3.js (force-directed graph) which requires Nodes and Links for preparing the chart. Can any one provide some pointer on how to get exact JSON from neo4j so can directly use to prepare the same graph chart in our application.
Thanks in Advance.