use of apoc.export.util.ExportConfig in project neo4j-apoc-procedures by neo4j-contrib.
the class ExportCypher method graph.
@Procedure
@Description("apoc.export.cypher.graph(graph,file,config) - exports given graph object incl. indexes as cypher statements to the provided file")
public Stream<DataProgressInfo> graph(@Name("graph") Map<String, Object> graph, @Name(value = "file", defaultValue = "") String fileName, @Name(value = "config", defaultValue = "{}") Map<String, Object> config) throws IOException {
if (Util.isNullOrEmpty(fileName))
fileName = null;
Collection<Node> nodes = (Collection<Node>) graph.get("nodes");
Collection<Relationship> rels = (Collection<Relationship>) graph.get("relationships");
String source = String.format("graph: nodes(%d), rels(%d)", nodes.size(), rels.size());
return exportCypher(fileName, source, new NodesAndRelsSubGraph(db, nodes, rels), new ExportConfig(config), false);
}
Aggregations