need a heads up with java-rest-api bindings for neo4j

105 views
Skip to first unread message

niku

unread,
May 22, 2012, 7:30:24 AM5/22/12
to Neo4j
I have been using embedded neo4j for a while. My requirements have
changed now. Can someone provide me more insight of using java-rest-
bindings practically in code?
I've build the bindings using maven.

Need a quick heads up.

Thanks,
Uday

Peter Neubauer

unread,
May 22, 2012, 1:11:51 PM5/22/12
to ne...@googlegroups.com

Hi there,
Thru should be a drop in replacement for your embedded database, except that you should try to use cypher instead of the embedded traversal framework on order to minimize network overhead.

Look at the unit tests and let us know how it goes!

Send from mobile.

niku

unread,
May 23, 2012, 3:30:29 AM5/23/12
to Neo4j
Is there any tutorial/docs available for startup on java-rest-bindings
apart from the unit tests?

On May 22, 10:11 pm, Peter Neubauer <neubauer.pe...@gmail.com> wrote:
> Hi there,
> Thru should be a drop in replacement for your embedded database, except
> that you should try to use cypher instead of the embedded traversal
> framework on order to minimize network overhead.
>
> Look at the unit tests and let us know how it goes!
>
> Send from mobile.

Michael Hunger

unread,
May 23, 2012, 4:01:25 AM5/23/12
to ne...@googlegroups.com
There isn't yet but please raise an issue on github

Michael

Sent from mobile device

Michael Hunger

unread,
Oct 11, 2012, 3:32:54 AM10/11/12
to ne...@googlegroups.com
Unfortunately I haven't found time to write one.

Perhaps someone from the list can chime in and help out, or you start one yourself, we welcome any contribution.

In general it is not complicated. For simple use-cases you use it like the embedded API.

For more high volume operations use the RestCypherQueryEngine with cypher queries and/or the RestAPI with executeBatch() which records your operations and sends them to the server as a single batch-rest-operation.

There is also a "pseudo" transaction support that does the same as executeBatch.

HTH

Michael

Am 11.10.2012 um 09:10 schrieb divyanshu das:

Any updates on this? any tutorials for beginners?
--
 
 

divyanshu das

unread,
Oct 11, 2012, 3:54:01 AM10/11/12
to ne...@googlegroups.com
Hi Michael,

I am using netbeans 7.1.2. I downloaded the git project  https://github.com/neo4j/java-rest-binding/
In the readme it was mentioned:- Build it locally. Then use the maven / ivy dependency or copy the jar into your app.

I imported that maven project in netbeans and used clean and build option. I got a build failure error.
>>Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.11:test (default-test) on project neo4j-rest-graphdb
Is there any other way to get those jar files?
I already have the code in embedded API but I need to convert it to rest API. 

Thanks

Peter Neubauer

unread,
Oct 11, 2012, 10:40:56 AM10/11/12
to ne...@googlegroups.com
Divyanshu,
you can get the needed dependencies in one place so you can mount them
in Netbeans with:

cd java-rest-binding

mvn dependency:copy-dependencies

and they will be copied into

target/dependency

Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html
> --
>
>

divyanshu das

unread,
Oct 11, 2012, 2:57:32 PM10/11/12
to ne...@googlegroups.com
Hi peter,
Thanks for the help. I installed maven2 and the command worked like charm. I got all the dependencies and imported them to the my netbeans project. 

1)However, I am using neo4j-1.6.1-community edition and the neo4j dependencies are for 1.8 edition. Is there a way to get those dependencies for 1.6.1 edition?

2)One more issue is that, when I add this line in my main function:-
RestAPI restAPI = new RestAPIFacade("http://localhost:7474/db/data");

It says cannot find symbol, RestAPI. That of course means that I need to write import statement for the particular class. There are quite a lot of dependencies and finding a particular class is not easy. Is there a documentation where I can get this information?

divyanshu das

unread,
Oct 11, 2012, 3:20:13 PM10/11/12
to ne...@googlegroups.com
I added the import statements:-
import org.neo4j.rest.graphdb.*;
import org.neo4j.rest.graphdb.RestAPI;

netbeans hint says that package does not exist. even though I have all these dependencies imported. 

Peter Neubauer

unread,
Oct 11, 2012, 3:57:33 PM10/11/12
to ne...@googlegroups.com
Hi there,
for that version, you probably should write a pom.xml
(http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-setup.html#_add_neo4j_as_a_dependency)
that depends on
http://m2.neo4j.org/index.html#nexus-search;quick~neo4j-rest-graphdb,
something like


<dependency>
<groupId>service.local.repositories.releases.content.org.neo4j</groupId>
<artifactId>neo4j-rest-graphdb</artifactId>
<version>1.6.M02</version>
</dependency>


and then do the mvn dependency:copy-dependencies on that project

Cheers,

/peter neubauer

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

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


> --
>
>

divyanshu das

unread,
Oct 12, 2012, 12:59:23 AM10/12/12
to ne...@googlegroups.com
oh great! I will do that. thanks a lot.
Reply all
Reply to author
Forward
0 new messages