use of org.apache.zeppelin.interpreter.graph.GraphResult in project zeppelin by apache.
the class Neo4jCypherInterpreter method renderGraph.
private InterpreterResult renderGraph(Set<Node> nodes, Set<Relationship> relationships) {
LOGGER.info("Executing renderGraph method");
List<org.apache.zeppelin.tabledata.Node> nodesList = new ArrayList<>();
List<org.apache.zeppelin.tabledata.Relationship> relsList = new ArrayList<>();
for (Relationship rel : relationships) {
relsList.add(Neo4jConversionUtils.toZeppelinRelationship(rel));
}
Map<String, String> labels = getLabels(true);
for (Node node : nodes) {
nodesList.add(Neo4jConversionUtils.toZeppelinNode(node, labels));
}
return new GraphResult(Code.SUCCESS, new GraphResult.Graph(nodesList, relsList, labels, getTypes(true), true));
}
Aggregations