Package org.neo4j.cypher.export

Examples of org.neo4j.cypher.export.DatabaseSubGraph


    private String doExport(ProgressReporter reporter, boolean types) throws IOException, XMLStreamException {
        try (Transaction tx = db.beginTx()) {
            StringWriter writer = new StringWriter();
            XmlGraphMLWriter xmlGraphMLWriter = new XmlGraphMLWriter();
            Config config = Config.config();
            xmlGraphMLWriter.write(new DatabaseSubGraph(db), writer, reporter, types ? config.withTypes() : config);
            tx.success();
            return writer.toString().trim();
        }
    }
View Full Code Here


    }

    private String doOutput(GraphDatabaseService db) throws IOException {
        StringWriter writer = new StringWriter();
        try (Transaction tx = db.beginTx()) {
            DatabaseSubGraph subGraph = new DatabaseSubGraph(db);
            MultiStatementCypherSubGraphExporter exporter = new MultiStatementCypherSubGraphExporter(subGraph);
            exporter.export(new PrintWriter(writer),1000);
            writer.close();
            tx.success();
        }
View Full Code Here

    public void testDump() throws Exception {
        GraphDatabaseService db = new TestGraphDatabaseFactory().newImpermanentDatabase();
        createData(db);
        CsvFormat format = new CsvFormat(db);
        StringWriter writer = new StringWriter();
        format.dump(new DatabaseSubGraph(db), writer,new TestReporter(), config());
        String output = writer.toString();
        System.out.println("output = " + output);
        assertEquals("id:id,labels:label,foo,age:int\n" +
                     "0,,bar,\n" +
                     "1,:User,,28\n" +
View Full Code Here

        GraphDatabaseService db = getServer().getDb();

        Format exportFormat = new XmlGraphMLFormat(db);
        String query = Config.extractQuery(parser);
        SubGraph graph = query.isEmpty() ? new DatabaseSubGraph(db) : cypherResultSubGraph(query,relsBetween);
        exportFormat.dump(graph, writer, reporter, config);
        writer.close();
        reporter.progress("Wrote to GraphML-file " + fileName);
        return Continuation.INPUT_COMPLETE;
    }
View Full Code Here

TOP

Related Classes of org.neo4j.cypher.export.DatabaseSubGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.