Exporting cypher queries results in WebAdmin

568 views
Skip to first unread message

Pablo Pareja

unread,
Jan 23, 2012, 4:02:29 PM1/23/12
to ne...@googlegroups.com
Hi,

I just wanted to let you know that I'm lately missing having a way of exporting the results of Cypher queries executed from the WebAdmin (the same thing for Gremlin).
So far I'm actively copy-pasting them from the console and whenever I get a big resultset I have to wait some time (this afternoon was about 20 seconds for around 7000 rows) till the scroll gets to the end.
Exporting the results to a plain TXT file exactly as they are plotted in the console would be enough.

Cheers,

Marko Rodriguez

unread,
Jan 23, 2012, 4:07:04 PM1/23/12
to ne...@googlegroups.com
Hi,

In Gremlin, you can do something like this:

file = new File('/tmp/myFile.txt');
g.v(1).my.gremlin.expression.each {
file.append('A result is ' + it); 
}

In short, create a file and write to it :).

Does that help?,
Marko.

Peter Neubauer

unread,
Jan 23, 2012, 4:10:04 PM1/23/12
to ne...@googlegroups.com
Pablo,
sounds like a good issue request!

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

The Neo4j Heroku Challenge               - http://neo4j-challenge.herokuapp.com/
Hack Real Problems. Win Real Prizes - http://www.t-b-d.org

Peter Neubauer

unread,
Jan 23, 2012, 4:12:47 PM1/23/12
to ne...@googlegroups.com
Also,
I think the right way to do this is to introduce a REST format
application/xml or text/csv for the cypher endpoint, that gives you
CSV instead of JSON. That makes more sense than an export from the
Webadmin.

WDYT?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

The Neo4j Heroku Challenge               - http://neo4j-challenge.herokuapp.com/
Hack Real Problems. Win Real Prizes - http://www.t-b-d.org

Pablo Pareja

unread,
Jan 23, 2012, 4:14:19 PM1/23/12
to ne...@googlegroups.com
@Marko Thanks! didn't know about that, I'll use it from now on (so happy of being able to avoid the scroll thing...)

@Peter Already created in enterprise repo -->  https://github.com/neo4j/enterprise/issues/10 

Cheers,

Pablo

On Mon, Jan 23, 2012 at 10:10 PM, Peter Neubauer <peter.n...@neotechnology.com> wrote:

Pablo Pareja

unread,
Jan 23, 2012, 4:16:23 PM1/23/12
to ne...@googlegroups.com
I'm not sure I understand exactly what you mean by that.
Would I still be able to somehow 'paste' my cypher queries somewhere in the webadmin?

Cheers,

Pablo

Michael Hunger

unread,
Jan 23, 2012, 4:25:04 PM1/23/12
to ne...@googlegroups.com
In many cases you don't have access to filesystem of the server that runs neo4j, and in the future it is very probably that file system access for non-kernel code will be prohibited.

So that said it would be rather sensible to go via the REST API, or perhaps in your case even better, use the Cypher REST-JDBC driver that Rickard Öberg wrote with any SQL client of your choice.

Those can export the result data in a variety of formats.


Cheers

Michael

Peter Neubauer

unread,
Jan 23, 2012, 4:44:22 PM1/23/12
to ne...@googlegroups.com
Mmh,
I guess for this feature, Neoclipse with Cypher support might be
exactly what you need. Radhakrishna has added a very nice Cypher
editor based on SQL-semantics, and we will put in REST-connectivity
for this to be usable with the server very soon. It has export
capabilities from SQLExplorer, see attached screenshot.

As MH points out, for Cypher, you can use the JDBC driver to point any
SQL client to your DB, see for instance my little test with
http://video.neo4j.org/U4Yq/heroku-neo4j-and-google-spreadsheet-in-10min-flat/
using Google as a client and export tool.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

The Neo4j Heroku Challenge               - http://neo4j-challenge.herokuapp.com/
Hack Real Problems. Win Real Prizes - http://www.t-b-d.org

nc.png

Pablo Pareja

unread,
Jan 24, 2012, 6:02:27 AM1/24/12
to ne...@googlegroups.com
Thanks Michael and Peter,

I didn't get the chance to try Neoclipse yet but I'm definitely more willing to do it now!

Cheers,

Pablo

Peter Neubauer

unread,
Jan 24, 2012, 9:55:37 AM1/24/12
to ne...@googlegroups.com
Pablo,
also make sure to give the JDBC driver a spin, see
http://rickardoberg.wordpress.com/2011/12/19/creating-a-jdbc-driver-for-neo4j/

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

The Neo4j Heroku Challenge               - http://neo4j-challenge.herokuapp.com/
Hack Real Problems. Win Real Prizes - http://www.t-b-d.org

Pablo Pareja

unread,
Jan 24, 2012, 11:45:50 AM1/24/12
to ne...@googlegroups.com
Peter,

Thanks, actually I have been postponing the moment to look at it because once I read 'JDBC' it kind of
reminds me of a past where I had to deal with SQL and relational DBs quite too often... :)

Cheers,

Pablo

Peter Neubauer

unread,
Jan 25, 2012, 4:40:37 AM1/25/12
to ne...@googlegroups.com
Ha!

Do you hear the DDL breathing down your neck .... buuh!

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

The Neo4j Heroku Challenge               - http://neo4j-challenge.herokuapp.com/
Hack Real Problems. Win Real Prizes - http://www.t-b-d.org

Reply all
Reply to author
Forward
0 new messages